Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: WebFetch::PerlMonks

by mirod (Canon)
on Jun 02, 2001 at 09:36 UTC ( #85164=note: print w/replies, xml ) Need Help??


in reply to WebFetch::PerlMonks

I am afraid you have the usual XML::Parser problem: the Char handler does not garantee that it will return the entire content of an element at once: it can be called several times for a single string, depending on entities being present and on the overall length of the document.

So if one of the title includes an entity, as in "I Love B &D Perl", the char handler will be called 3 times: once with 'I Love B', once with '&' and once with 'D Perl', and you will only get the last part in $post->{title}.

The solution in this case is simply to replace $post->{'title'} = $title; by $post->{'title'} .= $title;, but look for a more generic solution in the review.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://85164]
help
Chatterbox?
[choroba]: And regarding SQL, I'm usually generating SQL directly from queries supplied by the user, so I don't see how DBIx::Class can help me.
[1nickt]: Yes, in my (very) limited experience with it, it seems better suited to API building

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2017-11-24 14:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (349 votes). Check out past polls.

    Notices?