On Fri, Jan 09, 2009 at 05:52:45PM -0500, Chas. Owens wrote:
<snip>
> You seem to be under the impression that the argument to
> Digest::MD5::md5_hex is a file name.  The argument is a scalar holding
> the data to perform md5 on.  So Digest::MD5::md5_hex("foo") will give
> you the MD5 of the data "foo".  When you say
> Digest::MD5->md5_hex("foo") you are really saying
> Digest::MD5::md5_hex("Digest::MD5", "foo") so you will get the MD5 of
> the string "Digest::MD5" concatenated with the string "foo".  

When you said, "Module::method('Module', $arg)" I saw the second 'Module' 
as file not string. 
I guess I've still got a lot to learn.

I see that 
    Digest::MD5->md5_hex()
    "Digest::MD5"->md5_hex()
    Digest::MD5::md5_hex("Digest::MD5")     all return the same result.
    "Mud"->md5_hex()                        is an error.

But after I read all the references in the index of 'Programming Perl'
about '->' the arrow operator I'm no where nearer to understanding
what's going on. At least thanks to your help I know what's going on
even if I don't yet understand it. It's been long enough since I picked
up a new language to have forgotten this particular frustration.
Cest la vie.

<snip>

> seek DATA, 0, 0;
> my $data = join '', <DATA>;

This is interesting. 
The 'join' causes the whole file to be slurped in by forcing list context?

Thanks for your help,
Mike

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to