Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] perl hashes




> but surely the apostrophes aren't required?
>
> $qhash_ref->{spam_ch}

Not if the key is easily identifiable by the parser as what perl likes to
call a "bare word" (as it is in this case). If you wanted to have spaces
or punctuation in your key or if you're composing a compound string like
"$dir/$file.$ext", you need the apostrophes (or, in the compound string
example, double quotes). And obviously, a single scalar could be put in
place of the bare word without any quoting, like: $qhash_ref->{$key}.

--
Joe Larabell -- Synopsys VCS Support      US: larabell@example.com
http://wwwin.synopsys.com/~larabell/   Japan: larabell@?jp


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links