Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Use of LE is deprecated

by Jonathan (Curate)
on Jul 08, 2003 at 12:51 UTC ( #272258=perlquestion: print w/ replies, xml ) Need Help??
Jonathan has asked for the wisdom of the Perl Monks concerning the following question:

hmmm Ok, this modest script doesn't compile
#!/usr/local/bin/perl -w use strict; open LE, "<y" or die "can't open y: $!"; close LE;
Use of LE is deprecated at x line 3. Not enough arguments for open at x line 3, near "open LE" syntax error at x line 3, near "LE," Use of LE is deprecated at x line 4. syntax error at b line 4, near "LE;" Execution of x aborted due to compilation errors.
It looks like using the uppercase version of any of the string comparison operators as a file handle name will fail.

It's not a big deal but Google didn't help and I would like to know why this happens?

Comment on Use of LE is deprecated
Select or Download Code
Re: Use of LE is deprecated
by bigj (Monk) on Jul 08, 2003 at 13:23 UTC

    Works for me without any problems (Perl 5.8.0). What Perl version are you talking about?

    However, I found in perldoc perldelta the following explaining changing:

    o The long deprecated uppercase aliases for the string comparison operators (EQ, NE, LT, LE, GE, GT) have now been removed.
    under the section DEPRECATIONS. Thus, upgrading your Perl will remove the problem :-)

    Greetings,
    Janek

Re: Use of LE is deprecated
by Albannach (Prior) on Jul 08, 2003 at 13:30 UTC
    The uppercase aliases for the string comparison operators were finally removed in release 5.7.0 - see perldelta. I'm not sure when they were deprecated however. Why this gives the error you see I don't know.

    Interesting... in 5.6.1 (ActiveState build 635) I get the "not enough arguments" (open without brackets) or plain old "syntax error" (open with brackets), but I don't get the deprecation warning.

    --
    I'd like to be able to assign to an luser

Re: Use of LE is deprecated
by Abigail-II (Bishop) on Jul 08, 2003 at 20:54 UTC
    For over a decade, you could use the string comparison operators uppercased. I don't think it was ever documented. Uppercase was allowed, because it was done so in FORTRAN. (Yes, it's not always "because it's that way in C").

    The 5.6.x series was the last to allow this - they are gone in 5.8.0.

    Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://272258]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2014-12-21 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (100 votes), past polls