Shlomi Fish <shlo...@shlomifish.org> writes:

> Hi Lee,
>
> thanks for replying to the list and for not top posting.

Yvw :)  I hate top posting --- only in rare cases, I find it
useful/reasonable.  And posting the solution here might help others.

>> >> #!/bin/perl
>> >
>> > Is your Perl at /bin? Shouldn't it be in /usr/bin?
>> 
>> It's in /bin:
>> 
>> ,----
>> | [~/src/perl/test] which perl
>> | /bin/perl
>> | [~/src/perl/test]
>> `----
>> 
>
> Ah, is this part of the /usrmove ?
> http://fedoraproject.org/wiki/Features/UsrMove

They're saying: "Provide a simple way of mounting almost the entire
installed operating system read-only, atomically snapshot it, or share
it between multiple hosts to save maintenance and space."

I don't know, the installer of Fedora 17 forced me to put /usr onto the
root partition, so I probably can't mount it ro.  Fedora has its quirks
...

>> >> our $fh;
>> >
>> > Why the our?
>> 
>> I've been reading that you need to declare variables before using them
>> when you use strict. A "my $fh;" would probably suffice.
>
> You can do the declaration during the open.

Yes --- but I like it when the variables are declared in a "consistent"
way like you do in C, rather than declaring them all over the place
and/or even within other statements.  I haven't figured out yet how I'll
do this in perl.

>> >> $ctx->addfile( $fh);
>> >
>> > You can also add a filename using "->addfile ()"
>> 
>> The description on [1] says it needs a file handle?
>
> Well, https://metacpan.org/module/MSHELOR/Digest-SHA-5.84/lib/Digest/SHA.pm is
> OK with giving a file.

Hm indeed --- and it's working.  That shows that using google to find
info about perl can be very misleading.

>> > Perhaps learn Perl properly using some of the resources here:
>> 
>> Yes, I should start at the beginning and/or take a class.  I got so far
>> that I can do what is needed, with the exception of creating the hashs.
>> So maybe I'll have to use an external program like shasum until I figure
>> out how to use the Digest ...
>
> There are some reasons for why not to use external programs:
>
> http://perl-begin.org/tutorials/bad-elements/#calling-the-shell-too-much

It's probably very inefficient, that's why I don't want to do it ...
I'll have to read this page :)


-- 
"Object-oriented programming languages aren't completely convinced that
you should be allowed to do anything with functions."
http://www.joelonsoftware.com/items/2006/08/01.html

-- 
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