Steve Grazzini wrote:
>
> On Fri, Nov 14, 2003 at 12:25:41PM -0800, david wrote:
> > Douglas Houston wrote:
> >>
> >> I am trying to initialize a dynamically-named array
> >
> > this normally can't be done cleanly and is generally not recommanded given
> > there are other ways to accomplish bascially the same thing. but if you are
> > here to see if it can be done at all, you might want to try something like:
> >
> > #!/usr/bin/perl -w
> > use strict;
> >
> > my $name = shift;
> >
> > eval <<CODE;
> > no strict;
> > @ $name=1..3;
> > print "\$_\\n" for(@ $name);
> > CODE
>
> Sigh...  :-)
>
> The point is not that *symrefs* are inherently bad.  The point is that
> turning data into variable names can cause huge, nightmarish maintenance
> problems.  Even though your code doesn't have any symbolic references,
> it can still cause all the same maintenance problems... and it's so much
> uglier than just using symrefs in the first place!

Thanks Steve. I agree

There's nothing wrong with 'pass by name' code parameters
as such. Algol 60 used to do it as a matter of course, but guess why
it was dropped? For the same reason that "use strict 'refs'"
prohibits it.

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to