Re: while (<>) and wildcards on DOS/Windows

2009-08-10 Thread Peter Daum
John W. Krahn wrote: Peter Daum wrote: Unfortunately, this leads right to the next problem: I also need "binmode" to turn off cr/lf conversion on DOS; with "while (<>)" I don't know where to do this anymore, because AFAIK, this has to be done after open, but before the 1st I/O; now before the "

Re: while (<>) and wildcards on DOS/Windows

2009-08-03 Thread Jenda Krynicky
From: Peter Daum > I occasionally have to write Perl scripts that should behave the same on > Unix- and DOS-like Systems. One little problem I encounter there is: > > For quick hacks, the "while(<>)" mechanism is very handy, because it > saves a lot of typing. On Unix, I can call a script as a fi

Re: while (<>) and wildcards on DOS/Windows

2009-08-03 Thread John W. Krahn
Peter Daum wrote: Shawn H. Corey wrote: I've always used: beg...@argv=glob(@ARGV)} ... I still need at least: BEGIN{ @ARGV=map { glob($_) } @ARGV } but that's already much shorter - thanks :-) Unfortunately, this leads right to the next problem: I also need "binmode" to turn off cr/lf con

Re: while (<>) and wildcards on DOS/Windows

2009-08-03 Thread Peter Daum
Shawn H. Corey wrote: Peter Daum wrote: Unfortunately, this leads right to the next problem: I also need "binmode" to turn off cr/lf conversion on DOS; with "while (<>)" I don't know where to do this anymore, because AFAIK, this has to be done after open, but before the 1st I/O; now before th

RE: while (<>) and wildcards on DOS/Windows

2009-08-03 Thread Bob McConnell
From: Peter Daum > > I occasionally have to write Perl scripts that should behave the same on > Unix- and DOS-like Systems. One little problem I encounter there is: I am using Camelbox Perl on WinXP. This is my command line for unit tests: perl -MTest::Harness -e "@ARGV= map glob, @ARGV if $^O =

Re: while (<>) and wildcards on DOS/Windows

2009-08-03 Thread Shawn H. Corey
Peter Daum wrote: Shawn H. Corey wrote: I've always used: beg...@argv=glob(@ARGV)} ... I still need at least: BEGIN{ @ARGV=map { glob($_) } @ARGV } but that's already much shorter - thanks :-) Unfortunately, this leads right to the next problem: I also need "binmode" to turn off cr/lf con

Re: while (<>) and wildcards on DOS/Windows

2009-08-03 Thread Peter Daum
Ed Avis wrote: Peter Daum yahoo.de> writes: With more recent Perl versions, when a script is called with '*.xyz' it will just try to open '*.xyz' and fail. What version of Perl do you have? (perl -V) ... when I 1st encountered this problem, it was with ActivePerl 5.8 generally, I try t

Re: while (<>) and wildcards on DOS/Windows

2009-08-03 Thread Peter Daum
Shawn H. Corey wrote: I've always used: beg...@argv=glob(@ARGV)} ... I still need at least: BEGIN{ @ARGV=map { glob($_) } @ARGV } but that's already much shorter - thanks :-) Unfortunately, this leads right to the next problem: I also need "binmode" to turn off cr/lf conversion on DOS; wit

Re: while (<>) and wildcards on DOS/Windows

2009-08-03 Thread Ed Avis
Peter Daum yahoo.de> writes: >With more recent Perl versions, when >a script is called with '*.xyz' it will just try to open '*.xyz' and >fail. What version of Perl do you have? (perl -V) -- Ed Avis -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail:

Re: while (<>) and wildcards on DOS/Windows

2009-08-03 Thread Shawn H. Corey
Peter Daum wrote: Is all this really necessary, or is there a better / more elegant way? I've always used: beg...@argv=glob(@ARGV)} -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. My favourite four-lett

while (<>) and wildcards on DOS/Windows

2009-08-03 Thread Peter Daum
Hi, I occasionally have to write Perl scripts that should behave the same on Unix- and DOS-like Systems. One little problem I encounter there is: For quick hacks, the "while(<>)" mechanism is very handy, because it saves a lot of typing. On Unix, I can call a script as a filter, with filenames o