in reply to Configurable comparisons
It's not complicated, but don't look at the extra backslashes and '$' and think you can ignore them...the key is to understand them.
my $status = "false"; do_eval( "status", "eq", "false" ); do_eval( "status", "eq", "true" ); sub do_eval { my ($var, $op, $val) = @_; print "\$$var $op \"$val\": "; eval "if(\$$var $op \"$val\") {print 'Equal';} else{print 'Not';}"; print "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Configurable comparisons
by dash2 (Hermit) on Feb 27, 2002 at 13:18 UTC |