> Help me Mister Wizard!
>
> I'm testing for membership in an array, using:
>
> sub listed
> {
> my $value = shift;
> my @ary = @_;
>
>my $rtn = 0;
>
>print $NEW_INIFILE "Testing value >$value<\n";
>
>for my $x (0 .. $#ary) {
>
> print $NEW_INIFILE "... against >$ary[$x][1]<
[EMAIL PROTECTED] schreef:
> I did NOT know that
> anything matched nothing. Well, at least now I know what I'm
> running into.
But why do you want to use a regex there? Try 'eq'.
--
Affijn, Ruud
"Gewoon is een tijger."
___
ActivePerl mailing list
Dr.Ruud:
>>for my $x (0 .. $#ary) {
>
> This loops 1 time too much
Oops, not true, sorry. As Wayne wrote, your array has an extra (empty)
value.
--
Affijn, Ruud
"Gewoon is een tijger."
___
ActivePerl mailing list
ActivePerl@listserv.ActiveState
u've got nothing there, everything matches it. there isn't even an undefined value in order to throw a warning or exception error.at least that is what it looks like. try replacing $#ary with ($#ary-1) so that >for my $x (0 .. $#ary) {becomes>for my $x (0 .. ($#ary - 1)) {or like thatforeach m
alue to match //
since you've got nothing there, everything matches it. there isn't even an
undefined value in order to throw a warning or exception error.
at least that is what it looks like. try replacing $#ary with ($#ary-1) so
that
>for my $x (0 .. $#ary) {
becomes
>
>>Otherwise it looks like that last value is empty, and of
>>course *anything* =~ //
Whoa! Guess the hairball's twixt mine ears!! I did NOT know that anything matched nothing. Well, at least now I know what I'm running into.
Is it possible that shifting the array left @ary[$#ary] as a not
Deane.Rothenmaier:
Please send plain-text messages, not MIME-encoded.
>>for my $x (0 .. $#ary) {
This loops 1 time too much, so change to:
for my $x (0 .. $#ary-1) {
or better, to
for my $a (@ary) {
and change every '$ary[$x]' to '$a'.
>> print $NEW_INIFILE "... ag
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, February 09, 2006 10:13 AM
>As of 15 minutes ago, suddenly the n+1'th member of the array is MATCHING
$value. Here's an >iteration of the debug prints from the above loop...
>... against ><
>found match!
Reposting for the list since it was caught up due to a change at my
company's end.
Just another potential solution that some might like.
[EMAIL PROTECTED] wrote on 02/08/2006 03:05:15
PM:
>3. Importing into Excel (Erich Singer)
>6. Re: Importing into Excel (Todd Beverly)
>
>
>
> --
Help me Mister Wizard!
I'm testing for membership in an array, using:
sub listed
{
my $value = shift;
my @ary = @_;
my $rtn = 0;
print $NEW_INIFILE "Testing value >$value<\n";
for my $x (0 .. $#ary) {
print $NEW_INIFILE "... against >$ary[$x][1]<\n";
if ($value =~ /$ary
10 matches
Mail list logo