[Bangalore-pm] Reference Nazism (was: Re: Job Fair Intiative)
Suraj Kumar
suraj at careergear.in
Sun Sep 1 08:15:59 PDT 2013
Hi Saravanan,
On Wed, Jul 24, 2013 at 11:31 AM, Saravanan T
<talk2saravanan at yahoo.co.in> wrote:
>
>
> my %contact_details = {
> 'Mobile number' => '+91 998 000 6286',
> 'email' => 'perlsaran at gmail.com,talk2saravanan at yahoo.co.in',
> 'linkedin' => 'in.linkedin.com/in/perlsaran'
> 'twitter' => '@perlsaran'
> };
Sorry about this nitpick, that too a late one at that. In the above
code, you've created a hash variable but are assigning it a hash
reference as value. The %contact_details variable will now have the
stringified hash set as key and value being undef. Like this:
> $ perl -MData::Dumper -e 'my %x = { key => q(value) }; print Dumper \%x'
> $VAR1 = {
> 'HASH(0x132e998)' => undef
> };
The correct way of doing it... well, TIMTOWTDI, so:
You could either only talk in terms of references:
my $contact_details = { key => value }
or in terms of hashes
my %contact_details = ( key => value )
Regards,
-Suraj
--
An Onion is an Onion skin with an Onion inside it until the inner most
Onion skin without an Onion inside.
More information about the Bangalore-pm
mailing list