D
Dave Saville
I needed to massage some text to put in a web page. I started out with
some s/!/!;/g; type lines and then twigged that perl would most
likely have a module to do it. HTML::Entities.pm. This works fine, but
I then wanted to see *how* it did it.
Having found the module, Entities.pm, I copied it to a tmp directory
and modified the start of my test script from
use HTML::Entities;
to
use lib '.';
use Entities;
I then started sticking in print statements and eventually worked out
how the encode worked. I then tried to do the same with the decode
only to get an error:
Undefined subroutine &Entities::decode_entities called at try.pl line
18.
I then see that the sub line in Entities.pm is sub
decode_entities_old. OK so it's not amazing it could not find it. But
the question is how on earth does it work when the use HTML::Entities
is in effect? Which it does. I ran a search down the entire perl tree
looking for any file with a "sub decode_entities" in it and
Entities.pm is the only file and then it is decode_entities_old. So
how *does* it work?
Is there some way to find out where perl is getting a particular
routine from - rather like the *nix command line "which"?
TIA
some s/!/!;/g; type lines and then twigged that perl would most
likely have a module to do it. HTML::Entities.pm. This works fine, but
I then wanted to see *how* it did it.
Having found the module, Entities.pm, I copied it to a tmp directory
and modified the start of my test script from
use HTML::Entities;
to
use lib '.';
use Entities;
I then started sticking in print statements and eventually worked out
how the encode worked. I then tried to do the same with the decode
only to get an error:
Undefined subroutine &Entities::decode_entities called at try.pl line
18.
I then see that the sub line in Entities.pm is sub
decode_entities_old. OK so it's not amazing it could not find it. But
the question is how on earth does it work when the use HTML::Entities
is in effect? Which it does. I ran a search down the entire perl tree
looking for any file with a "sub decode_entities" in it and
Entities.pm is the only file and then it is decode_entities_old. So
how *does* it work?
Is there some way to find out where perl is getting a particular
routine from - rather like the *nix command line "which"?
TIA