in reply to basic hash question
This gives you the following output:#!/usr/bin/perl -w my %hash; my $var = "Oh"; $hash{'$var'} = 'Whatever'; $hash{"$var"} = 'Whatīs that'; $hash{$hash{"$var"}} = '? I really donīt have a clue!'; print "$var\n"; print "$var - $hash{$var}\n"; print "$hash{'$var'}\n";
Oh Oh - Whatīs that WhateverQuestion: What output gives you (if appended to the code above):
Ciaoprint $hash{"$var"}.$hash{$hash{"$var"}}."\n";
Update: Of course $hash{"$blah"} is better off when written $hash{$blah} see the interpolating quotation as "educational obfuscation". ;-)
|
|---|