Tom,

Thanks. I chomped $today, and that fixed the problem.
Chomping the variable $today made the match succeed,
since now the string did not have to match against the
newline that was at the end of $today.

Also, thanks for the tip about finding the size of the
array.

Jocelyn

On 2/17/07, Jocelyn Kirshenbaum <[EMAIL PROTECTED]>
wrote:

> $today=`date +%m/%d/%y`;
> print $today;

You didn't chomp $today, so it has a newline at the
end. That's why
you didn't need to add a newline when you printed it
out, too. Do you
see now why $today failed in the pattern match?

> $size = $#arr;
> print "size of array is $size \n";

That's not the size of the array; it's one smaller.
The customary way
to get the size of an array is to use the array's
"name" in scalar
context:

    my $size = @arr;

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training


 
____________________________________________________________________________________
Don't get soaked.  Take a quick peak at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to