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.
Step 0. RTFM. Thanks for this great link, cacharbe! (I stole it from 138902.)
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.
4. Repeat step 1.my ($time, $kb_s) = $output =~ /^(\d+:\d+:\d+)\s+\(([\d.]+)\s+/m; print "TIME: $time\nKB/S: $kb_s\n\n";
Step 0. RTFM. Thanks for this great link, cacharbe! (I stole it from 138902.)
|
---|
In Section
Seekers of Perl Wisdom