SPUG: Aliasing Data::Dumper::Dump; how ?

Tim Maher/CONSULTIX tim at consultix-inc.com
Wed Jan 26 12:19:38 CST 2000


Thanks for the quick responses to my first question in my previous
post; but I had another buried at the end, which is:

> 
> Also, I'm trying to make an alias for Data::Dumper::Dump (unexported!),
> using variations including:
> 	*::Dump = \&Data::Dumper::Dump;
> and
> 	*Dump = *Data::Dumper::Dump;
> 
> but when I hit the line below
> (which works fine with the Data::Dumper:: prefix on it), I get;
>	Can't coerce array into hash at
> 	/usr/lib/Perl5/5.00502/i586-linux/Data/Dumper.pm line 161. 

What hash?

> 
> print Dump([$size, \%pals, $hosts, \@::words],
>   ["size", "*${prefix}pals", "${prefix}hosts", "*${prefix}words"]);  
> 
>   (I set $prefix to :: to reload variables as globals, with "strict"
>   in effect)
> 
> What's wrong here? And why doesn't Data::Dumper export Dump()
> in the first place? 8-}
 
This is my first attempt at aliasing through typeglobs, and seems like
a good place to do it, so I'd appreciate some help with this.  Thanks!

*========================================================================*
| Tim Maher, PhD  Consultix &              (206) 781-UNIX/8649           |
|  Pacific Software Gurus, Inc             Email: tim at consultix-inc.com  |
|  UNIX/Linux & Perl Training              http://www.consultix-inc.com  |
| 2/22: UNIX  2/28: Perl Modules  2/29: Int. Perl  3/3: Pattern Matching |
*========================================================================*

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
        Email to majordomo at pm.org: ACTION spug-list your_address





More information about the spug-list mailing list