Link to home
Start Free TrialLog in
Avatar of BrianG
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
Avatar of ozo
ozo
Flag of United States of America image

What problems are you having with the LWP module?
ASKER CERTIFIED SOLUTION
Avatar of khacharn
khacharn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of clockwatcher
clockwatcher

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";
}




Avatar of BrianG

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.