in reply to Resolving scalars in a scalar
And the output -use strict; my $alpha = "A"; my $delta = "D"; my $theta = "T"; my @hash = qw/ Hello world /; my $test = '@hash $delta and $alpha or $theta are good'; # evaluate perl variables except bare words my $result = qq{@{[ map { m/^[\$@%]./ ? eval $_ : $_ } split/\s/,$test ]}}; print "$result\n";
Hello world D and A or T are good
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Resolving scalars in a scalar
by SavannahLion (Pilgrim) on Oct 30, 2003 at 08:35 UTC | |
by Roger (Parson) on Oct 31, 2003 at 04:03 UTC |