in reply to Re: Get file make backup
in thread Get file make backup

I like this idiom but I recently learned that it doesn't work in at least a few versions of Perl prior to Perl 5.6.0.

So keep that in mind if you plan to use the above.

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
Re: (tye)Re: Get file make backup
by merlyn (Sage) on May 22, 2001 at 21:30 UTC

      Sorry, I was busy and so unacceptably terse. do { local *ARGV; @ARGV= $filename; <> } returns nothing in Perl 5.004 and keeps reading the "current" file in Perl 5.005. I'd be interested in more testing on this as I've just got the two examples at the moment so I'm not sure if the behavior is consistant across all of 5.004 and 5.005.

              - tye (but my friends call me "Tye")
Re: (tye)Re: Get file make backup
by tachyon (Chancellor) on May 27, 2001 at 15:20 UTC

    So, I've heard. I'm a perl 5.6.0er and a new camel booker so I took the open(FOO, "<", "foo.txt") idoim to heart as it scored a 'righterer' in the veritable tome. open(FOO, "<foo.txt") is more retro!

    cheers

    tachyon