With a help of a simpliest module "b.pm" I can always write
now
perl -mb -we "do {'something'};"
and have possibility to save priceless characters
on a command line :)
Just put it in @INC as "b.pm" and then use additinal -mb command line argument.
simple example of usage is just: perl -mb -wn0777e "s/\r//g;print" file.txt >file.out which will strip \r from file.txt# the only need of this module file is to ease binmode'ing # for STDIN, STDOUT, so one could write # perl -mb -we "'do-something, and STDxxx are in binmode'" sub BEGIN { binmode STDIN; binmode STDOUT; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: ease binmode STDIN; binmode STDOUT
by merlyn (Sage) on May 16, 2002 at 20:50 UTC | |
by svad (Pilgrim) on May 17, 2002 at 05:15 UTC | |
|
Re: ease binmode STDIN; binmode STDOUT
by Courage (Parson) on May 30, 2002 at 20:32 UTC |