in reply to How to open the file exists in web link
You should first download the file, save it somewhere on your system and then read the file from there. Or if the file is not too big, you can keep its contents in a variable (array or scalar) upon downloading.
Checkout LWP or even LWP::Simple to learn how to download a file over HTTP.Or you can use IO::All which provides an object oriented filehandle-like interface.
One more comment: you are using far too many double quotes in your small script. $file = $_; is all you need if you do not have to interpolate the variable.
Update: changed typo + added reference to IO::All
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to open the file exists in web link
by ikegami (Patriarch) on Feb 09, 2010 at 07:09 UTC | |
by CountZero (Bishop) on Feb 09, 2010 at 07:14 UTC | |
by ikegami (Patriarch) on Feb 09, 2010 at 07:47 UTC |