#!/usr/bin/perl -w use strict; #Just # our data #Another #Perl #Hacker seek(DATA,0,0); # seek the begining of the file *a=*.; # glob assignment warn # same effect as print but includes the line num map{ $a-=chomp # chomp return num chars chomped (1) thus $a -= 1 , # comma op could be ; without changing result s # substitute <.> # first char on line ;q<''>; # with an expression that evals to null eieio # the /ee makes second part eval to null # the /i (ignore case) does not matter. # and the /o compiles once # put them together and you have: # Old Macdonald Had A JAPH E I E I O ; # yeah well if you need this explained.... $.<8&&$.>2?"$_ ":''# this is ($. < 8 and $. > 2) ? "$_ " : "", # we actually only need lines 5-8 (see above) } # close map ; # map data array (whole file) __END__