Re: the perl script (SOLVED: sha-2 sum of files?)

2013-06-14 Thread lee
Jim Gibson writes: > Some comments on your code: > > 1. Rather than doing this: > > while ( <$curridx>) { chomp $_; my $current_file = $_; > > you should do this: > > while ( my $current_file = <$curridx> ) { chomp($current_file); Ah cool :) I really didn't like the way I did that, this is

Re: the perl script (SOLVED: sha-2 sum of files?)

2013-06-14 Thread Jim Gibson
On Jun 13, 2013, at 10:57 PM, lee wrote: > Hi, > > so I've done this script now --- my fourth perl script ever --- and > since I'm getting so much help here, I thought I'd post it here. I'm > sure it could be done much better, it's just plain and simple. > > It has one problem: The list of clo

the perl script (SOLVED: sha-2 sum of files?)

2013-06-13 Thread lee
Hi, so I've done this script now --- my fourth perl script ever --- and since I'm getting so much help here, I thought I'd post it here. I'm sure it could be done much better, it's just plain and simple. It has one problem: The list of closed files can grow indefinitely, and since the script che

Re: SOLVED: sha-2 sum of files?

2013-06-13 Thread lee
Jim Gibson writes: > On Jun 13, 2013, at 11:33 AM, lee wrote: > >> Shlomi Fish writes: >> >> >> 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 ca

Re: SOLVED: sha-2 sum of files?

2013-06-13 Thread Jim Gibson
On Jun 13, 2013, at 11:33 AM, lee wrote: > Shlomi Fish writes: > > > 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 op

Re: SOLVED: sha-2 sum of files?

2013-06-13 Thread lee
Shlomi Fish 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/

Re: SOLVED: sha-2 sum of files?

2013-06-12 Thread Shlomi Fish
Hi Lee, thanks for replying to the list and for not top posting. See below for my comments. On Wed, 12 Jun 2013 17:50:57 +0200 lee wrote: > Shlomi Fish writes: > > > Hi Lee, > > > > some comments on your code: > > > > On Wed, 12 Jun 2013 11:28:34 +0200 > > lee wrote: > > > >> David Christen

SOLVED: sha-2 sum of files?

2013-06-12 Thread lee
Shlomi Fish writes: > Hi Lee, > > some comments on your code: > > On Wed, 12 Jun 2013 11:28:34 +0200 > lee wrote: > >> David Christensen writes: >> >> > On 06/11/13 21:44, lee wrote: >> >> ... what I don't understand is what >> >> the most efficient way would be to create a sha-2 sum for a fil