On Jul 15, 2004, at 9:40 AM, Brian Volk wrote:

Hi All,

If I have a file, /usr/bin/my_urls.txt which contain... urls... :-) one on
each line. Can I read these into a foreach statement instead of listing
them individually? I think I need to use a filehandle to open the file and
then send that to the @ ... right?

Exactly, right. I'll give the steps:

1. open() your file.  Remember to check if it succeeds!

2. Read line by line, chomp()ing line endings and adding them to an array.

3.  close() fiie and use array in foreach loop.

Just shout if you need more help...

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to