in reply to binmode for @ARGV

Try binmode ARGV; - ARGV is the magical filehandle associated with @ARGV. This association is also the reason Juerd's snippet won't work reliably as is.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: binmode for @ARGV
by BrowserUk (Patriarch) on Jan 26, 2003 at 01:16 UTC

    Unfortunately, applying binmode to ARGV before the file is opened, doesn't persist once perl uses @ARGV to open the file:(. Presumably reset during the open.

    I guess that renders Juerd's idiom unusable for binary files unless their is some way of interjecting between the open and the read done by <>;


    Examine what is said, not who speaks.

    The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.

      I guess that renders Juerd's idiom unusable for binary files. . .

      Only on already unusable platforms.

      sauoq ducks.

      -sauoq
      "My two cents aren't worth a dime.";