in reply to Simulating UNIX's "tail" in core Perl
That will emulate "tail"
To print out a range:
sed -n -e '1034:1047p' filename
or, you could print out a couple of ranges:
sed -n -e '1034:1047p' -e '2034:2047p' filename
Oh, you wanted PERL...! :-) OK,
perl -e 'print `sed -n -e '1034,1047p' filename`'
Of course, if you really need a "perl only" solution, one of the other replies here would be better
:-) But perl's often not the only tool in the box!
|
|---|