in reply to Resolving scalars in a scalar
There is a slick touch of confusion happening that's worthy of an obfu.
$delta and $alpha are substituted all right, but the and operator gets evaluated, too. 'D' is true, so 'A' is evaluated and becomes the value of the expression.$ perl -e'($alpha, $delta) = qw{A D};$test = q($delta and $alpha); pri +nt eval $test' A$
I don't know of a way to get double interpolation that will survive this problem.
Update: Well, there is a way of course, but it's really crude, $test =~ s/\$(\w+}\b/$$1/g;
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Resolving scalars in a scalar
by SavannahLion (Pilgrim) on Oct 30, 2003 at 05:44 UTC | |
by Roger (Parson) on Oct 30, 2003 at 06:16 UTC | |
by SavannahLion (Pilgrim) on Oct 30, 2003 at 08:29 UTC | |
by Roger (Parson) on Oct 31, 2003 at 03:56 UTC | |
|
Re: Re: Resolving scalars in a scalar
by hardburn (Abbot) on Oct 30, 2003 at 14:42 UTC |