Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Can't / won't print pipe delimiter?

by Old_Gray_Bear (Bishop)
on May 18, 2009 at 16:42 UTC ( [id://764674]=note: print w/replies, xml ) Need Help??


in reply to Can't / won't print pipe delimiter?

Try
print join('|',@my_list);

----
I Go Back to Sleep, Now.

OGB

Replies are listed 'Best First'.
Re^2: Can't / won't print pipe delimiter?
by Marshall (Canon) on May 18, 2009 at 21:39 UTC
    Almost perfect!
    just need one final | to get output requested.
    #!/usr/bin/perl -w use strict; my @list = (3, 5, 2, 9); print join('|',@list),'|'; #prints: 3|5|2|9|
Re^2: Can't / won't print pipe delimiter?
by Anonymous Monk on May 18, 2009 at 16:51 UTC
    print join "\x7c", @my_list; # :D print join chr 124, @my_list; # :D

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-25 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found