Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Pushing a delimiter into an array?

by NetWallah (Canon)
on Mar 31, 2014 at 02:56 UTC ( [id://1080347]=note: print w/replies, xml ) Need Help??


in reply to Pushing a delimiter into an array?

You could also use perl's $LIST_SEPARATOR $" (see perldoc perlvar).
perl -E 'my @x=0..5; local $"=qq|\t|; say "@x"' 0 1 2 3 4 5
Slightly more dramatic:
perl -E 'my @x=0..5; local $"=qq|= \t =|; say "=@x="' =0= =1= =2= =3= =4= =5=

        What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
              -Larry Wall, 1992

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2026-02-16 12:02 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.