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

Re^6: replace &

by Corion (Patriarch)
on Jun 04, 2009 at 08:08 UTC ( #768339=note: print w/replies, xml ) Need Help??


in reply to Re^5: replace &
in thread replace &

I don't understand what your reply has to do with the original question of finding out whether a string is an HTML entity and my reply on how to detect whether a string is an HTML entity.

Replies are listed 'Best First'.
Re^7: replace &
by sandy1028 (Sexton) on Jun 04, 2009 at 08:14 UTC
    For example : If the string contain $a= &foo foo When I encode it using the function encode_entities($a); The   should not be encoded. So the final output after encoding should be &foo foo Now the output is &foo foo. So I wanted to check it the string is HTML entity?

      I don't get your problem. Maybe if you posted real code instead of a mishmash of unencoded and encoded entities outside of <code> tags, it would be clearer. The following code works as I expect it and seems to do what you want:

      > perl -MHTML::Entities -le "print $HTML::Entities::VERSION; print enc +ode_entities('&foo foo')" 1.35 &amp;foo foo

      Which would indicate to me that &foo foo does not look like any valid HTML entity.

      A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2023-12-02 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (15 votes). Check out past polls.

    Notices?