Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: XML parsing

by stevieb (Canon)
on Dec 11, 2019 at 17:24 UTC ( [id://11109983]=note: print w/replies, xml ) Need Help??


in reply to XML parsing

"I have been 'asked' not to download the XML module on my workstation"

I'd be asking about the reasoning behind this nonsense.

Regarding your printf warnings, it appears as though the code you provide is not the same code generating the warnings (given one of the warnings states an actual format, where your code does not). printf requires a string format template, followed by a list of items to inject into the string. Here's an example:

printf "Hello %s, your number is %d\n", $name, $num;

See this for the list of valid formats.

In your case, you don't need printf, as your variables interpolate just fine with print. Besides, as choroba says, sending user data into printf without any validation checks can be problematic.

Replies are listed 'Best First'.
Re^2: XML parsing
by hippo (Archbishop) on Dec 11, 2019 at 18:37 UTC

    The printf statement in the OP has one argument which includes interpolated strings from some arbitrary XML. It's quite possible that those contain unescaped % symbols. With certain input I'm sure such warnings could be generated by catfish1116's code.

    However since catfish1116 still hasn't deigned to provide us with the input data, despite numerous requests in the other thread, it's all just guesswork.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2026-01-19 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (122 votes). Check out past polls.

    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.