Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: CGI and Storable : explain me this, please.

by davidrw (Prior)
on Apr 27, 2006 at 04:31 UTC ( [id://545945]=note: print w/replies, xml ) Need Help??


in reply to Re: CGI and Storable : explain me this, please.
in thread CGI and Storable : explain me this, please.

i'd guess that scalar $var instead of "$var" would work, too .. dunno (don't think i personally have a preference, though maybe some people would) which is "better" (assuming the former works)

Update: see below

Replies are listed 'Best First'.
Re^3: CGI and Storable : explain me this, please.
by chromatic (Archbishop) on Apr 27, 2006 at 06:20 UTC

    Why would being in scalar context stringify a value? A glob in scalar context is still a glob.

      Hmm .. i guess it doesn't. (I tried OP's code w/$db{"1"}{"pic1"} = scalar $var; and it gave the same error ...)

      Well, my line of thought was that $var = join "", split(// , $var); worked because the split's 2nd arg gets treated in scalar context .. So instead, does that mean that split just happens to stringify it's 2nd argument and that's why it worked as OP wanted?

        I wouldn't say "just happens", but yes, that is the point of split. From the documentation:

        split /PATTERN/,EXPR,LIMIT split /PATTERN/,EXPR split /PATTERN/ split Splits the string EXPR into a list of strings...

        Automatic data type conversions do happen in Perl, but there aren't a lot of accidental, harmful ones.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://545945]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 18:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found