in reply to Re: Re: Un-obfuscate me
in thread Un-obfuscate me

I know that .. is a flip-flop operator in scalar context. However, note that perlop goes on to say:
If either operand of scalar ".." is a constant expression, that operand is implicitly compared to the $. variable, the current line number.
That's why I said that \"aString" .. __ doesn't do anything useful in scalar context. :) I should have clarified that I was referring to that expression specifically, rather than to scalar context .. in general.

Replies are listed 'Best First'.
Re: Re: Re: Re: Un-obfuscate me
by eg (Friar) on Dec 19, 2000 at 02:10 UTC

    Wouldn't \"aString" .. __ essentially be the same as 1 .. 1 in this context? If so, then the string "1E0" would be returned when the first line of data is read ("1" for first line counted, "E0" for last line counted.)

      Hehe... I figured out a use for \"aString"..__ after all. Note that it is not equivalent to 1..1. (Hint: '__' != 1)
      #!/usr/local/bin/perl $t = tell DATA; while (<DATA>) { if ($r = \"aString" .. __) { last if $r =~ /E/; print; $. = -1; } seek DATA, $t, 0; } __END__ Just another Perl hacker,
      If you run this script, you might want to do so in the background. It takes a while to finish...