Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: my $var = join('|',@array) not behaving

by ikegami (Patriarch)
on May 09, 2008 at 02:18 UTC ( [id://685585]=note: print w/replies, xml ) Need Help??


in reply to my $var = join('|',@array) not behaving

Always pass a scalar to Dumper. If you had done print Dumper(\@array);, it would have been easier to notice the array contains only one element (a reference to an array containing three elements).

The problem is that
my @array=[1,"word",2];
should be
my @array=(1,"word",2);

The [ ] operator creates an array and returns a reference to that array. Not what you want at all. You just wanted to build a list.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2026-04-13 20:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.