----- Original Message ----- 
From: "Jolok" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
Sent: Thursday, August 28, 2003 1:19 PM
Subject: newbie: printing elements of an array


> > Hello
> >
> > This _should_ be very straightforward:
> >
> > print "Enter 5 of your favorite foods: ";
> > $favorites = ( <STDIN> );
> > @foodlist=split(' ', $favorites);
> > print "@foodlist\n";
> > print "$foodlist[0]\n";
> > print "$foodlist[1]\n";
> >   ...
> >
> >
> > But I am getting (as output):
> >
> > food1 food2 food3 food4 food5
> >
> > food1 food2 food3 food4 food5
> >
> >
> >
> >
> >
> > end of output
> > So, I'm guessing that the 'split' command is used incorrectly?
> >
> > The desired output would be:
> >
> > food1 food2 food3 food4 food5
> >
> > food1
> > food2
> > food3
> > food4
> > food5
> >
> >
> > Can someone steer me in the right direction?
> 
> --
> Best Regards,
> 
> Joshua Lokken
> OMIC Portland Branch
> [EMAIL PROTECTED]
> (503) 807-6538
> -------------------------------------------->
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to