in reply to Re: Idle search for a file-read idiom
in thread Idle search for a file-read idiom

Oh, you say you want a longer script. Like from a file.

#!/usr/bin/perl -wn BEGIN{$num=0}; print ++$num,' ',$_; END{print "\nDo some processing outside of the loop.\n"}

Prints the file on the command line with linenumbers added and prints a summary.

s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}