symbolic reference
From: slurper (slurper1234_at_skynet.be)
Date: 01/29/04
- Next message: Laurey: "Array information into 2 cells instead of 1?"
- Previous message: Joe Smith: "Re: system() not having command exit status"
- Next in thread: nobull_at_mail.com: "Re: symbolic reference"
- Reply: nobull_at_mail.com: "Re: symbolic reference"
- Reply: Anthony: "Re: symbolic reference"
- Reply: Joe Smith: "Re: symbolic reference"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 29 Jan 2004 22:13:01 +0000
i don't understand following snippet from "programming perl".
$name = "bam";
$$name = 1; # Sets $bam
${$name} = 2; # Sets $bam
${$name x 2} = 3; # Sets $bambam
$name->[0] = 4; # Sets $bam[0]
i don't understand above. $name is a string and it gets dereferenced.
impossible no?
can anyone shed some light on this
tx very much
@$name = (); # Clears @bam
&$name(); # Calls &bam() (as in prior versions of Perl)
$pkg = "THAT"; # (Don't use "package" or "pack"!)
${"${$pkg}::$name"} = 5; # Sets $THAT::bam without eval
- Next message: Laurey: "Array information into 2 cells instead of 1?"
- Previous message: Joe Smith: "Re: system() not having command exit status"
- Next in thread: nobull_at_mail.com: "Re: symbolic reference"
- Reply: nobull_at_mail.com: "Re: symbolic reference"
- Reply: Anthony: "Re: symbolic reference"
- Reply: Joe Smith: "Re: symbolic reference"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]