Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: scope of variable

by Anonymous Monk
on May 27, 2013 at 09:15 UTC ( [id://1035379]=note: print w/replies, xml ) Need Help??


in reply to scope of variable

Please help me to identify the issue. I assumed scope of $d is limited to given call.

A few issues

* In the code you posted $d never has a value -- it might as well not exist

* If you used strict it would complain about $d requiring an explicit package name -- cause what is $d ? where does it come from? who sets its value?

* your sub is called getValue but all it does is print stuff

* You're using XML::Parser but you should be using XML::Twig :) use XML::Twig :) it comes with many examples/tutorials, XML::Twig, XML::LibXML, Mojo::DOM ... see Re: The best module for handling xml for examples, walkthroughs, follow my links and the links they link, like these Re: How to grab a portion of file with regex (don't)(parsing html/xml with xpath/twig/dom, because html::parser is low level), Re: How to grab a portion of file with regex (parsing html/xml with xpath/twig/dom, because xml::parser is low level), Re^4: How to grab a portion of file with regex (parsing html/xml with xpath/twig/dom, because ::parser is low level)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2026-02-15 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.