Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: perl script to print data like this in pdf.

by veerubiji (Sexton)
on Oct 21, 2011 at 08:17 UTC ( #932836=note: print w/ replies, xml ) Need Help??


in reply to Re: perl script to print data like this in pdf.
in thread perl script to print data like this in pdf.

Hi I modified but i am getting syntax errores at near ")[" and also at end "}".

my %nums; while ($reader->nextElement( 'Number' )) { my $number = $reader->copyCurrentNode(1)->textContent; $reader->nextElement( 'address' ); my $node = $reader->copyCurrentNode(1); my $infohash = { house => $node->getElementsByTagName( 'housenumber' )[0]->tex +tContent, street => $node->getElementsByTagName( 'streetname' )[0]->tex +tContent, }; $nums{$number} = $infohash; }


Comment on Re^2: perl script to print data like this in pdf.
Download Code
Re^3: perl script to print data like this in pdf.
by roboticus (Chancellor) on Oct 21, 2011 at 10:15 UTC

    veerubiji:

    The syntax is nearly there. Try it this way:

    my %nums; while ($reader->nextElement('Number')) { my $number = $reader->copyCurrentNode(1)->textContent; $reader->nextElement('address'); my $node = $reader->copyCurrentNode(1); my $infohash = { house => $node->getElementsByTagName( 'housenumber' )->[0]->t +extContent, street => $node->getElementsByTagName( 'streetname' )->[0]->t +extContent, }; $nums{$number} = $infohash; }

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2015-07-03 21:34 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 (56 votes), past polls