On 05/16/00, ""Kuhnibert" <[EMAIL PROTECTED]>" wrote:
> both suggestions work (phillip, there's just a semicolon missing after
> DIR)[0] ) now i'm in the dilemma which one to paste to my code, the one
> from phillip which looks really 'stylish' or the snippet from simon whose
> way of working i can reproduce as a beginner.
Go with the simple solution, but learn to understand the other
one. There's really no need to sort the list (from an efficiency
standpoint) and the other list functions (map, grep) when all you want
is the maximum value.
You could change part of the other answer to this, though:
$index = $1 if /^$base\.(\d+)$/o and $1 > $index;
You can decide for yourself if the '/o' is appropriate in
the larger scope of the rest of your script (like not if its
a daemon that runs continuously day after day, or if it'll be
running from one day into the next day). See 'perldoc
perlop' to see what the '/o' is for if you don't know.
HTH,
Douglas Wilson
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]