Suresh Govindachar wrote:
>
> The following worked -- didn't need to turn off warnings.
Not sure why, I get a warning on using ARGVOUT only once.
> #!/usr/bin/perl
> BEGIN {(*STDERR = *STDOUT) || die;}
Not sure why you want the above.
> use diagnostics;
> use warnings;
> use strict;
> $| = 1;
That could slow you down a bit by doing more writes.
> $^I = '~';
> while (<>)
> {
> binmode ARGVOUT if $. == 1;
> s/\r\n$/\n/;
You don't need the above substitute. Try it without it
as I posted it and let me know if it works.
> print;
> }
>
> And the one-liner becomes:
>
> perl -i~ -pe "binmode ARGVOUT if $.==1; s/\r\n$/\n/;" <dossy files>
Same here - no s/// needed:
perl -i~ -pe "binmode ARGVOUT if $.==1;" <dos-files>
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs