in reply to Declareing something with a *
what is *varAliasA type glob.
Why when I made a little test of this could, I could get it to compile and run but no value was assigned to $reftype.Do you have references in your package? It works for me:
Note that looping over the entries in a stash will not find any lexical variables.#!/usr/bin/perl use warnings; $main::foo = []; while ((my $varname, my $globvalue) = each %main::){ local *varAlias = $globvalue; my $reftype = ref $varAlias; print "$varname = $reftype\n" if $reftype; } __END__ Name "main::foo" used only once: possible typo at /tmp/try line 5. foo = ARRAY
Would not compile with strict in use.That's because you never introduced $varAlias. Either use:
orour $varAlias = $globvalue;
use vars qw /*varAlias/;
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Declareing something with a *
by Scarborough (Hermit) on May 18, 2004 at 09:25 UTC |