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

Re: how to print two array with new line at end of each second array element, using a single print statement?

by trizen (Hermit)
on Apr 21, 2012 at 13:28 UTC ( #966356=note: print w/ replies, xml ) Need Help??


in reply to how to print two array with new line at end of each second array element, using a single print statement?

is there any way to get a one line print statement?

Yes:
my $str = q{}; { my $i = 0; $str .= join(q{ }, $nums[$i] // last, $dat[$i++] // last) . "\n" w +hile 1; } print $str;


Comment on Re: how to print two array with new line at end of each second array element, using a single print statement?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2015-07-06 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls