Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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; }

Replies are listed 'Best First'.
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?
[marto]: This won't take till Summer to complete I hope ;)
[Discipulus]: i hope too, vacuum cleaner permitting, 2-3 afternoon to build. Or is the 1:1 serie? ;=)
[Tanktalus]: Sure, no one is active for hours and hours in the cb, so I go to upgrade the db, and then someone is active. Sheesh :)
[Discipulus]: anyway poppins probably died with the last night cold. But is not normal to see them in dec. they must pop in April
NodeReaper eyes the thorns in the side
Discipulus : the party puller!
[Discipulus]: I was trying to solve this but i'm not. my regex-fu is stuck at primary school

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2017-12-18 21:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (498 votes). Check out past polls.

    Notices?