in reply to Re^2: Why isn't this subroutine working?
in thread Why isn't this subroutine working?

It might have gone by you - JavaFan's question was more rhetorical, as the differences in output of the following code show you:

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"; };

Replies are listed 'Best First'.
Re^4: Why isn't this subroutine working?
by northwestdev (Acolyte) on May 20, 2009 at 13:31 UTC
    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.
      Of course not, elsf isn't perl ;->)