in reply to Re^2: Using a sting with a variable name
in thread Using a sting with a variable name
#!/usr/local/bin/perl -w use strict; my $var2 = 1; # may just be $var my $one = '$var'; my $two = '$var2'; if(eval("$one")){ print "I don't want to see this\n" } if(eval("$two")){ print "I want to see this\n" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Using a sting with a variable name
by ikegami (Patriarch) on May 11, 2009 at 15:05 UTC | |
by wol (Hermit) on May 11, 2009 at 17:28 UTC | |
by bingohighway (Acolyte) on May 12, 2009 at 08:37 UTC |