Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w $seller_state = "CA"; $token = "##ticket_price##"; $rule = "if(##seller_state## eq 'CA'){ ##ticket_price## = 2; }"; token_clean($rule); eval $rule; warn $@ if $@; $test_var = token_clean($token); print "$test_var\n"; #doesnt work print "$ticket_price\n"; #work sub token_clean(){ $_[0] =~ s/##(.+?)##/\$$1/g; return($_[0]); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Token Replacement
by Aristotle (Chancellor) on Jun 18, 2002 at 04:51 UTC | |
|
Re: Token Replacement
by Anonymous Monk on Jun 18, 2002 at 00:22 UTC | |
by jeffa (Bishop) on Jun 18, 2002 at 00:33 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |