Re: [MacPerl-AnyPerl] symbolic references <-> no strict refs

[email protected] (Keary Suska) Sun, 17 Mar 2002 12:56:07 -0700
Newsgroups perl.macperl.anyperl
Message-ID <B8BA42E7.C092%[email protected]>
on 3/17/02 6:35 AM, [email protected] purportedly said:

> that works, but since i want to build those symbolic
> references dynamically (the reason for the symbolic refs are
> because the camel book suggests those in favour of eval on a
> string) how can i then pre-declare my variables (since i
> don't know their names before the script runs)? is that
> possible (under use strict)?
> 
> 
> my $append = "_name"; # this string could be anything
> my $test = "variable$append";
> $$test = "a string";
> print $variable_name;

IMHO, symbolic refs are syntactic sugar that make code difficult to read,
follow, and debug. I recommend using hashes or objects instead. They are
easier to read, follow, and debug, and are more extensible.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"