in reply to Re: mimicing wc and split
in thread mimicing wc and split
syntax error at 576460.pl line 11, near ") {" syntax error at 576460.pl line 14, near "}" Execution of 576460.pl aborted due to compilation errors.
missig ; after the do{} block in wc. Didn't test? ;-)
#!/usr/bin/perl -w use strict; my ($i,$c) = @ARGV > 1 ? 8 : 0; (-z $ARGV[0] and printf ("%${i}d %s\n", 0, shift) and @ARGV or exit) +if @ARGV; while(<ARGV> || eof ARGV) { $c++; if (eof(ARGV)) { printf "%${i}d %s\n", $., $ARGV; $. = 0; $ARGV[0] and -z $ARGV[0] and printf "%${i}d %s\n", 0, shift; @ARGV || last; } } printf "%${i}d total\n",$c if $i;
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|