BrianG
asked on
Parsing a remote file
I am trying to open a file on a website. Step through the lines and parse out the information. What I am having trouble with is opening the remote file. Specifically how do I read a line. I know that there is a way to do this. I have been pointed in the direction of the LWP module, but I am still having problems.
Thanks.
Brian
Thanks.
Brian
What problems are you having with the LWP module?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why would you want to print it to a file?
use LWP::Simple;
$page = get('http://www.experts-exchange.com');
@lines = split('\n',$page);
foreach $line (@lines) {
print "$line\n";
}
use LWP::Simple;
$page = get('http://www.experts-exchange.com');
@lines = split('\n',$page);
foreach $line (@lines) {
print "$line\n";
}
ASKER
Both answers are good. A don't really need to print the lines to a file though, but that might actually be useful for later. Thanks for your answers and comments.