in reply to indirectly accessing variable
You want symbolic references.
$writer->characters($$tag);
But these are a really bad idea for very many reasons. In fact when you "use strict" (and I hope you use strict) symbolic references will trigger a fatal error.
You're better off using a hash.
--$writer->characters($vars{$tag});
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: indirectly accessing variable
by santellij (Novice) on Jul 11, 2003 at 16:12 UTC |