http://qs321.pair.com?node_id=272258

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?

Replies are listed 'Best First'.
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 (Monsignor) 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