Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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?
[Lady_Aleena]: shmem, I don't think any of my modules could be converted to OO. They are too procedural.
[Lady_Aleena]: Now I will see if my perl-fu is as bad as I think it is.
[shmem]: ah, geany uses its own idea of tags. Ah well...
[Lady_Aleena]: My perl-fu is bad.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2017-04-27 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (506 votes). Check out past polls.