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

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?

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

    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.