in reply to write exact lines of file

You can make use of the $. special variable:
$ perl -ne 'print if ($. == 4)' test.txt Line 4 $ perl -ne 'print if ( 4 < $. and $. < 11)' test.txt Line 5 ... Line 10
The $. stores the current line number of the last filehandle accessed: see here.

CU
Robartes-