One is called the 'big' arrow (=>) and one is called the 'little' arrow (->).
The big arrow is used in place of a ',' (comma). Now, I just read in the latest
Learning Perl that
this is global (i.e..: you can replace ANY comma with it, but I may have
misunderstood, have to
re-read that again), but you will generally see this used in hash element assignments
between key
and value pairs:
my %hash=(
'big city' => 'New York',
'Little City' => 'Mayberry'
);
The little arrow is used for de-referencing:
my %hash=('35'=>'Bob','Chlorine'=>'Blah');
my $ref = \%hash;
foreach(keys %{$ref}) {
print "Key: $_ Value: $ref->{$_}\n";
}
See perldoc's perlreftut and perldata...
Shawn
----- Original Message -----
From: "Connie Chan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 27, 2002 12:29 AM
Subject: What's the different between -> and => ?
Would anybody tell me what's the different between -> and => ?
Thanks a lot =)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]