Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Perl >> Snippet

print lines r through s of an array


open (SOURCE, "file.txt" );
@all = < SOURCE > ;                   # put all lines in an array
close (SOURCE)

open (DEST, "file2.txt" );   
print DEST @all [ $r - $s ] ;        # print lines r through s
close (DEST)