in reply to Re: missing character when reading input file
in thread missing character when reading input file

I agree with your example of using open to handle a CRLFish file on a *nix system. The rest of this post is just to satisfy my curiosity.

$ARGV[0] = \do{$win_file};

I don't understand the purpose of munging  @ARGV in this way. Any scalar can be opened by reference as a RAM file. If the reason for initializing the scalar in a  BEGIN block was to create a lexically private scalar, then assigning a reference to it to an element of the global  @ARGV array defeats this purpose.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^3: [OT]: missing character when reading input file
by BillKSmith (Monsignor) on Sep 12, 2018 at 18:36 UTC
    The array @ARGV was used to preserve as much of the original OP as possible. The 'BEGIN' is unnecessary, but I feel that it serves to separate the file simulation from the relevant code. No excuse for the 'do' block. It is a leftover from an earlier attempt at the file simulation.
    Bill
      The array @ARGV was used to preserve as much of the original OP as possible.

      Ah, ok. I understand better now. It occurred to me after I posted that this might have been part of the motivation.


      Give a man a fish:  <%-{-{-{-<