tejnil has asked for the wisdom of the Perl Monks concerning the following question:
In string, @potato now must be written as \@potato at - line 5, near "@potato" Any ideas why this doesn't work? Once the typeglob assignement is made, all entities that were called "spud" should also be referred to as "potato"-the names should be freely interchangeable. This example (below) is taken right out of the leopard book (O'Reilly, Advanced Perl Programming, p.42)$spud = "Wow"; @spud = ("idaho", "russet"); *potato = *spud; # Alias potato to spud using typeglob assignment print "$potato\n"; # prints "Wow!" print "@potato\n"; # doesn't work!!!!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: typeglob assignment question
by japhy (Canon) on Apr 16, 2002 at 19:45 UTC | |
|
Re: typeglob assignment question
by VSarkiss (Monsignor) on Apr 16, 2002 at 19:24 UTC | |
|
Re: typeglob assignment question
by trs80 (Priest) on Apr 16, 2002 at 19:25 UTC | |
by tejnil (Novice) on Apr 16, 2002 at 20:03 UTC |