Here is the code:
while (@arrangement) {
chomp;
if ($_ eq $epost) { my $test = 1; }
shift(@arrangement);
}

if ($test) {
## Some more Code. The if statement always fails :(

Here is what @arrangement looks like:
@arrangement = qw([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED],
[EMAIL PROTECTED]);

My problem is that even though $epost = "[EMAIL PROTECTED]";
$test is still undef. Is this because $_ only works for while(<fh>)?
I couldn't find any mention of $_ in chapter 4 of Learning Perl: Control
Structures. But, I'm pretty sure I'm way of track here.
I tried looking in perldoc perlop, but couldn't find anything there either.

Anyone know what could be wrong?

Just for fun, I added this line right before the while loop:
die ("This is \$arrangement[0]: $arrangement[0]");

The error message from apache:
This is $arrangement[0]: [EMAIL PROTECTED] at
/Library/WebServer/CGI-Executables/nuugsql.cgi line 93.

So, I feel like I'm again missing some basic thing(Both @arrangement and
$epost contains exactly what they are supposed to).. But I can't figure out
what :(

I also get this from apache:
Use of uninitialized value in scalar chomp at
/Library/WebServer/CGI-Executables/nuugsql.cgi line 95.
Use of uninitialized value in string eq at
/Library/WebServer/CGI-Executables/nuugsql.cgi line 96.

Could it be that @arrangement isn't scoped correctly?
I can access it's values before the while loop, so I wouldn't think this to
be the problem.

PS: I use $epost in another part of the sub, so I know $epost also holds the
right variable.

This will be the last one, I promise.

Any help is greatly appreciated. :)

Tor


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to