in reply to Re: Re: (crazyinsomniac)Re: Any way to binmode
in thread Any way to binmode <>
use Data::Dumper; $Data::Dumper::Useqq = 1; FF: binmode ARGV; while(<>) { print Dumper($_) } continue { if(eof) { close ARGV; goto FF; } } __END__ this is ctrl-Z:^Z # note: real ctrl-Z there this is past ctrl-z
produces this output when run on itself under NT (line endings are \r\n):
/ned $ perl binmode.pl binmode.pl $VAR1 = "use Data::Dumper;\n"; $VAR1 = "\$Data::Dumper::Useqq = 1;\n"; $VAR1 = "\n"; $VAR1 = "FF: binmode ARGV;\n"; $VAR1 = "while(<>)\n"; $VAR1 = "{ print Dumper(\$_) }\n"; $VAR1 = "continue\n"; $VAR1 = "{ if(eof)\n"; $VAR1 = " { close ARGV; goto FF; }\n"; $VAR1 = "}\n"; $VAR1 = "__END__\n"; $VAR1 = "this is ctrl-Z:";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: (crazyinsomniac)Re: Any way to binmode
by crazyinsomniac (Prior) on Aug 02, 2001 at 20:05 UTC | |
by bikeNomad (Priest) on Aug 02, 2001 at 20:13 UTC |