Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strict module #906

Closed
p5pRT opened this issue Dec 1, 1999 · 5 comments
Closed

strict module #906

p5pRT opened this issue Dec 1, 1999 · 5 comments

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Dec 1, 1999

Migrated from rt.perl.org#1841 (status was 'resolved')

Searchable as RT1841$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Dec 1, 1999

From juerg_schulthess@yahoo.com

The following code complains only for $c​:

use strict​:

$a = "";
$b = "foo";
$c = "bla";

Regards,
-- J. Schulthess
__________________________________________________
Do You Yahoo!?
Thousands of Stores. Millions of Products. All in one place.
Yahoo! Shopping​: http​://shopping.yahoo.com

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Dec 1, 1999

From [Unknown Contact. See original ticket]

Juerg Schulthess wrote​:

Some variables don't seem to be checked by the strict pragma, eg. $a, $b
Perl versions tested​: 5.004_04 (Solaris), 5.004_64 (Windows NT)

The following code complains only for $c​:

use strict​:

$a = "";
$b = "foo";
$c = "bla";

That's a feature. 'use strict' doe"sn't check for '$a' nor '$b' so you can
use them in 'sort' without complain.

Hope it helps

François Désarménien

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Dec 1, 1999

From [Unknown Contact. See original ticket]

Hi,

Juerg Schulthess​:

Some variables don't seem to be checked by the strict pragma, eg. $a, $b
Perl versions tested​: 5.004_04 (Solaris), 5.004_64 (Windows NT)

$a and $b are special (for use in sort() code).

--
Matthias Urlichs | noris network GmbH | smurf@​noris.de | ICQ​: 20193661
The quote was selected randomly. Really. | http​://www.noris.de/~smurf/
--
The number of computer scientists in a room is
inversely proportional to the number of bugs in their code.

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Dec 1, 1999

From [Unknown Contact. See original ticket]

How do I close this ticket?

-- J. Schulthess

=====
<pre>
Juerg Schulthess .`'???.
  (o o)
-=-=-=-=-=-=-=-oOOo-(_)-oOOo-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  juerg_schulthess@​yahoo.com
"I date this girl for two years -- and then the nagging
starts​: "I wanna know your name...""</pre>
__________________________________________________
Do You Yahoo!?
Thousands of Stores. Millions of Products. All in one place.
Yahoo! Shopping​: http​://shopping.yahoo.com

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Dec 1, 1999

From [Unknown Contact. See original ticket]

François Désarménien wrote

That's a feature. 'use strict' doe"sn't check for '$a' nor '$b' so you can
use them in 'sort' without complain.

True enough. But given the frequency with which this comes up, it's
certainly a bug that it's not documented.

Patch for perl5.005_62 attached.

PS Juerg​: you don't need to do anything to close a bug report.
  We just stop discussing it when we get sufficiently bored ...

Mike Guy

Inline Patch
--- ./lib/strict.pm.orig	Wed Dec  1 14:32:44 1999
+++ ./lib/strict.pm	Wed Dec  1 14:34:21 1999
@@ -56,6 +56,9 @@
 The local() generated a compile-time error because you just touched a global
 name without fully qualifying it.
 
+Because of their special use by sort(), the variables $a and $b are
+exempted from this check.
+
 =item C<strict subs>
 
 This disables the poetry optimization, generating a compile-time error if

End of patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant