Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: parsing from text - to output doc

by joealba (Hermit)
on Jan 15, 2002 at 19:31 UTC ( #138920=note: print w/ replies, xml ) Need Help??


in reply to parsing from text - to output doc

1. Print the time.
print scalar localtime(time) , "\n";

2. Run the program from your Perl script. Get the output of that program into a variable.
my $output = qx(wget http://URL);

3. Munge the data to get what you want.

my ($time, $kb_s) = $output =~ /^(\d+:\d+:\d+)\s+\(([\d.]+)\s+/m; print "TIME: $time\nKB/S: $kb_s\n\n";
4. Repeat step 1.

Step 0. RTFM. Thanks for this great link, cacharbe! (I stole it from 138902.)


Comment on Re: parsing from text - to output doc
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://138920]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2015-07-07 11:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls