[31975] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3239 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 16 18:09:20 2010

Date: Thu, 16 Dec 2010 15:09:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 16 Dec 2010     Volume: 11 Number: 3239

Today's topics:
    Re: Entities.pm - How does decode_entities work? <dave@invalid.invalid>
    Re: Entities.pm - How does decode_entities work? <dave@invalid.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 16 Dec 2010 22:45:11 +0000 (UTC)
From: "Dave Saville" <dave@invalid.invalid>
Subject: Re: Entities.pm - How does decode_entities work?
Message-Id: <fV45K0OBJxbE-pn2-NZQ6KZwutg9h@localhost>

On Thu, 16 Dec 2010 17:44:02 UTC, "Uri Guttman" <uri@StemSystems.com> 
wrote:

> >>>>> "DS" == Dave Saville <dave@invalid.invalid> writes:
> 
>   DS> I needed to massage some text to put in a web page. I started out with
>   DS> some s/!/!;/g; type lines and then twigged that perl would most 
>   DS> likely have a module to do it. HTML::Entities.pm. This works fine, but
>   DS> I then wanted to see *how* it did it.
> 
>   DS> Having found the module, Entities.pm, I copied it to a tmp directory 
>   DS> and modified the start of my test script from
> 
>   DS> use HTML::Entities;
> 
>   DS> to
> 
>   DS> use lib '.';
>   DS> use Entities;
> 
> what happened to the HTTP:: part? why did you think you could drop it?
> 

Er, what HTTP part? Did you mean the HTML part? I dropped it because 
my test version was not in an HTML directory. It was in the same 
directory as the test code.


>  
>   DS> I then started sticking in print statements and eventually worked out 
>   DS> how the encode worked. I then tried to do the same with the decode 
>   DS> only to get an error:
> 
>   DS> Undefined subroutine &Entities::decode_entities called at try.pl line 
>   DS> 18.
> 
> you broke its exporting.
> 

How? It can find encode_entities fine. Why didn't that break? The 
EXPORT lines don't mention the higher HTML layer except in the package
header and I removed that portion of it.

-- 
Regards
Dave Saville


------------------------------

Date: Thu, 16 Dec 2010 22:57:29 +0000 (UTC)
From: "Dave Saville" <dave@invalid.invalid>
Subject: Re: Entities.pm - How does decode_entities work?
Message-Id: <fV45K0OBJxbE-pn2-d0ztUQn7IkdC@localhost>

On Thu, 16 Dec 2010 17:45:55 UTC, "Uri Guttman" <uri@StemSystems.com> 
wrote:

> >>>>> "DS" == Dave Saville <dave@invalid.invalid> writes:
> 
>   DS> I then see that the sub line in Entities.pm is sub 
>   DS> decode_entities_old. OK so it's not amazing it could not find it. But 
>   DS> the question is how on earth does it work when the use HTML::Entities 
>   DS> is in effect? Which it does. I ran a search down the entire perl tree 
>   DS> looking for any file with a "sub decode_entities" in it and 
>   DS> Entities.pm is the only file and then it is decode_entities_old. So 
>   DS> how *does* it work?
> 
>   DS> Is there some way to find out where perl is getting a particular 
>   DS> routine from - rather like the *nix command line "which"?
> 
> if you read the source and look for decode_entities there is a comment
> which says where it is located.

Yes I see - a require for HTML::Parser - But Parser does not have a 
decode_entities so I repeat *how* does the routine reference get 
resolved. I do not understand. 

-- 
Regards
Dave Saville


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 3239
***************************************


home help back first fref pref prev next nref lref last post