Getting first line of file as argument of script in Perl -


so, need out first line of file, , use information purpose later. also, need remaining lines same file , use information first line something. tried textbook this:

while (defined ($lines = <>))     {       #do     } 

how extract first line in perl?.. new in programming, advice help.

just read first line before loop starts:

my $first_line = <>; while (my $line = <>) {     # whatever $first_line , $line } 

if want remaining lines in array, no loop needed @ all:

my ($first_line, @lines) = <>; 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -