From: "Mr. Shawn H. Corey" <[EMAIL PROTECTED]>
> Dr.Ruud wrote:
> >> Why do people who write these books have exercises of little
> >> practical value?
> >
> > An exercise needs to be educational.
>
> I have worked in programming for 25 years and during that time I have
> never use a closure an
}
> },
> sub { return @found_items }
> )
> }
If you do it this way there is no point in returning the subroutine
references in the first place. You are using global variables here
(even though you declare them with my).
You can'
On Sun, 26 Aug 2007 13:04:48 -0400, Mr. Shawn H. Corey wrote:
> I have worked in programming for 25 years and during that time I have
> never use a closure and have never seen one used.
Boggle. I don't think any program I write these days doesn't have one.
They're the most convenient way of re
On 8/26/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
> Dr.Ruud wrote:
> >> Why do people who write these books have exercises of little
> >> practical value?
> >
> > An exercise needs to be educational.
>
> I have worked in programming for 25 years and during that time I have never
> use a
>
In article <[EMAIL PROTECTED]>, Mr. Shawn H. Corey
<[EMAIL PROTECTED]> wrote:
> Chris wrote:
> > I'm working on yet another exercise from Intermediate Perl. I've been
> > given a script that searches for files that fall between a two
> > timestamps.
> Why do people who write these books have e
Mr. Shawn H. Corey wrote:
Dr.Ruud wrote:
Why do people who write these books have exercises of little
practical value?
An exercise needs to be educational.
I have worked in programming for 25 years and during that time I have
never use a closure and have never seen one used. I may be har
> "Shawn" == "Mr Shawn H Corey" <[EMAIL PROTECTED]> writes:
Shawn> Oh, I get it. When I said 25 years, you thought that I meant 25 years
Shawn> with Perl.
No.
Shawn> Sorry, about the confusion.
No confusion.
Shawn> I have programmed in many different languages and have never seen a
Randal L. Schwartz wrote:
"Shawn" == Shawn H Corey <[EMAIL PROTECTED]> writes:
Shawn> Why do you include an insult with every thing you post?
I don't think I do. I was only making fun of your claim, since you made the
claim. Why did you include "25 years"? It just sets you up for a fall. :)
> "Shawn" == Shawn H Corey <[EMAIL PROTECTED]> writes:
Shawn> Why do you include an insult with every thing you post?
I don't think I do. I was only making fun of your claim, since you made the
claim. Why did you include "25 years"? It just sets you up for a fall. :)
Shawn> BTW, what lege
Randal L. Schwartz wrote:
Think of closures as "variables that hold behavior". Sure, maybe you've never
needed that in your legendary 25 years in the industry, but I've used it
*frequently* in my 30 years. :)
Why do you include an insult with every thing you post?
BTW, what legends do you ha
> ""Mr" == "Mr Shawn H Corey" <[EMAIL PROTECTED]> writes:
Mr> Objects can do the same things as closures, which is store and hide data,
Mr> but don't have this problem of having to keep in mind two phases of the
Mr> same code.
But objects have fixed code with variable data. Closures can have
Dr.Ruud wrote:
Why do people who write these books have exercises of little
practical value?
An exercise needs to be educational.
I have worked in programming for 25 years and during that time I have never use
a closure and have never seen one used. I may be harsh in my definitions but
t
Chris schreef:
> #!/usr/bin/perl -w
Toss the -w, and insert a "use warnings;".
> my ($start, $stop) = @_;
> my @starting_directories = @_;
This doesn't do what I think that you think it does.
> my($sec, $min, $hour, $day, $mon, $yr, $dow) = localtime;
Is the start/top related to today?
What
Ok, if anyone is interested, here is my answer:
#!/usr/bin/perl -w
# Testing code for Exercise 6-1. Your task is to write the sub
# gather_mtime_between.
use strict;
use File::Find;
use Time::Local;
my ($start, $stop) = @_;
my @starting_directories = @_;
my @found_items;
sub gather_mtime_betw
Shawn schreef:
> Chris:
>> I'm working on yet another exercise from Intermediate Perl. I've
>> been given a script that searches for files that fall between a two
>> timestamps. For the exercise, I am supposed to write the
>> gather_mtime_between subroutine that will return two references to
>>
Mr. Shawn H. Corey wrote:
Chris wrote:
I'm working on yet another exercise from Intermediate Perl. I've been
given a script that searches for files that fall between a two
timestamps. For the exercise, I am supposed to write the
gather_mtime_between subroutine that will return two references t
Chris wrote:
I'm working on yet another exercise from Intermediate Perl. I've been
given a script that searches for files that fall between a two
timestamps. For the exercise, I am supposed to write the
gather_mtime_between subroutine that will return two references to two
subroutines. One wil
On 8/25/07, Chris <[EMAIL PROTECTED]> wrote:
> if (my $start <= $timestamp <= my $stop){
Until Perl 6, you have to break down chain comparisons like this into
separate comparisons, usually joined with 'and':
if ($start <= $timestamp and $timestamp <= $stop) { ... }
But the real problem
I'm working on yet another exercise from Intermediate Perl. I've been
given a script that searches for files that fall between a two
timestamps. For the exercise, I am supposed to write the
gather_mtime_between subroutine that will return two references to two
subroutines. One will use File::Fin
19 matches
Mail list logo