Berkeley CSUA MOTD:Entry 22802
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/24 [General] UID:1000 Activity:popular
5/24    

2001/10/23-24 [Computer/SW/Languages/Perl] UID:22802 Activity:kinda low
10/22   I'm importing a bareword from a perl package (e.g. Math::avogadro) and
        can do things like print avogadro and print Math::avogadro just fine.
        But if I try to use avogadro in a hash, I get the string, not the
        value.
        \_ $hash{&avogadro}    It's because it's not _really_ a constant.
           "variables" without $'s before them in perl are really
           subroutines.  (Sometimes with some more efficient magic)
           \_ Thanks! BTW, where could I have found this information?
              (If I were smarter, I might have been able to intuit it)
              \_ Hmm.  perlsyn(1), maybe?  I mean, it's just kinda general
                 knowledge that anything without anything on the front in
                 perl is a subroutine.