Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Aloha, If I have a file with 7 lines of text, how could I read each one of those lines as an individual variable. Gracias

Replies are listed 'Best First'.
Re: Input variables
by FunkyMonk (Bishop) on Jun 02, 2008 at 19:52 UTC
    open my $IN, "<", "filename" or die "can't open filename: $!"; my $line1 = <$IN>; my $line2 = <$IN>; #etc


    Unless I state otherwise, all my code runs with strict and warnings
Re: Input variables
by wade (Pilgrim) on Jun 02, 2008 at 19:56 UTC

    Do I sense a homework question?

    --
    Wade
Re: Input variables
by Zen (Deacon) on Jun 02, 2008 at 21:46 UTC
    Look up slurping into arrays. Search button up top.