P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Well... not only applies the reply above. Also your way of accessing a variable by it's name from a string is not correct. According to your code, you think you can do this with:
$prods[[$i]]."Dev" I would say this is the way: ${"${prods[[$i]]}Dev"} Although I don't know if that would work here, because of the [[$i]]. It's a pity I don't have a Perl installation here (@school). update: note: the first example would give you the value of $prods[[$i]] and "Dev". So to say, if $prods[[$i]] eq "Web" (just another Perl example!), then your code would result in "WebDev", which actually is nice thing to do, but it's not what you want. /update In reply to Re: Runtime Hash Variable access
by muba
|
|