in reply to strings with multiple parameters

I went with a different way and use STDIN instead
my $line0 = <STDIN>; my $line1 = <STDIN>; my $line2 = <STDIN>; chomp $line0; chomp $line1; chomp $line2; @strings = ($line0, $line1, $line2);
Now I am trying to write a loop for it and stuck....
print "How many line" my $num = <STDIN>; for ($count = $num; $count>=1; $count--) { my $line; chomp ($line = <STDIN>); }
I am stuck after chomp with STDIN...

Replies are listed 'Best First'.
Re^2: strings with multiple parameters
by toolic (Bishop) on Nov 07, 2011 at 17:51 UTC
    push
    use warnings; use strict; my @strings; print "How many line"; my $num = <STDIN>; for my $count (1 .. $num) { my $line; chomp( $line = <STDIN> ); push @strings, $line; }
      Thank you so much! works perfectly now, I dont know why I didn't think of push...