Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: $nextline not working

by McA (Priest)
on Mar 22, 2013 at 03:54 UTC ( [id://1024863]=note: print w/replies, xml ) Need Help??


in reply to $nextline not working

Hi,

a solution based on many assumptions:

#!/usr/bin/perl use warnings; use strict; use Data::Dumper; use lib './lib/lib/perl5'; use Mojo::DOM; my $html = q( <html> <head><title>Some list</title> </head> <body> <div> <table> <tr> <td>Borrower:</td> <td>Someone</td> <td>active date:</td> <td>2013-03-22</td> <td>Amount:</td> <td>100.00</td> </tr> <tr> <td>Borrower:</td> <td>SomeoneElse</td> <td>active date:</td> <td>2013-03-20</td> <td>Amount:</td> <td>10.50</td> </tr> </table> </div> </body> </html> ); my $dom = Mojo::DOM->new($html); my $table = $dom->at('table'); for my $record ($table->children('tr')->each) { my %record = map { $_->text } $record->children('td')->each; print Dumper(\%record), "\n"; }

McA

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-20 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found