open (my $FH, "<", $file) or die ... # reads the whole file, assigns first line to $headline my ($headline) = <$FH>; # since the whole file is already read, there's nothing # more to be read, so the while block will never be executed while( my $line = <$FH> ) { #### sub xxx { # error, must be my ($firstParam) = @_; if you don't want # to get the number of parameters but the first param my $firstParam = @_; ... #### my $x = reverse('abcdef'); my ($y) = reverse('abcdef'); print "x=$x\ny=$y\n";