Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

gargle's scratchpad

by gargle (Chaplain)
on Aug 16, 2005 at 11:37 UTC ( [id://484125]=scratchpad: print w/replies, xml ) Need Help??

sub dump_hours { my @links = $mech->find_all_links( text_regex => qr/\d+:\d+/ ); foreach my $link (@links) { my $total = $link->text(); # total hours worked $mech->get($link); my $text = $mech->content( format => 'text'); if ( $text =~ /(... \d\d\/\d\d\/\d\d\d\d) INOUT(.+)$/ ) { my $date = $1; my $hours = $2; print $date . " (" . $total . ") "; # $hours is a long string of hours, 5 positions wide while ($hours) { my $slice = substr($hours,0,5)."-".substr($hours,5,5); $hours .= "?"x5 if (length($hours) % 10 == 5); $hours = substr($hours,10); print $slice . " " ; } print "\n"; } } }
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found