in reply to Re: Binary conditionals
in thread Binary conditionals

Yes, the post was incomplete. Subsequent posts using
open my IN, "<infile.dat";
or similar were correct.

Replies are listed 'Best First'.
Re^3: Binary conditionals
by toolic (Bishop) on Sep 30, 2008 at 15:37 UTC
    Not quite. This gives an error message:
    No such class IN at ./714572.pl line 10, near "open my IN" syntax error at ./714572.pl line 10, near "my IN," Execution of ./714572.pl aborted due to compilation errors.

    moritz's code has it right because he uses a lexical filehandle. He also uses the recommended 3-argument form of open and checks its status:

    open my $in, '<:raw', 'infile.dat' or die $!;
      Look out for the open parameters.
      You should distinguish between IN in file handle context and my $IN as scalar.
      my IN probably won't work while my $IN would.

      Regards,
      s++ą  ł˝ ął. Ş ş şą Żľ ľą˛ş ą ŻĽąş.}++y~-~?-{~/s**$_*ee