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
Post a Comment