Yes, I'm sure. I tried it with, and without the quotes. As for elsf and elsif, I know I've been up most of the night, but I am not hallucinating, eclipse tells me I have a syntax error when I use elsif. Could it be one of the modules I'm using? (I'm using strict, HTTP::Date, XML::DOM, CGI).
PS: I am using eclipse on Windows Vista, but the programs run on a Linux server. I have not figured out, yet, how to run and debug perl on the Eclipse IDE on Vista | [reply] |
use strict;
my $rowRef = {
foo => 'foo value',
bar => 'bar value',
};
my $rowName = 'bar';
for my $rn ($rowName, '$rowName') {
my $rowValue;
if (exists $rowRef->{$rn}) {
$rowValue = $rowRef->{$rn}
} else {
$rowValue = '<does not exist>';
};
print "rowRef for '$rn' is '$rowValue'\n";
};
| [reply] [d/l] |
OK, pick on the newbie :-) I was using it without quotes, but then I decided to try it with quotes (I use those for Perl-embedded MySQL code), and that's what I copied and pasted.
In any case, even without the quotes, it still does not work.
| [reply] |
>perl -e"while ($x) { if ($y) { } } elsif ($z) { } }"
syntax error at -e line 1, near "} elsif"
Execution of -e aborted due to compilation errors.
>perl -e"while ($x) { if ($y) { } elsif ($z) { } }"
>
Replacing elsif with random words is not a suitable bug fix. | [reply] [d/l] [select] |