Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Programmatic creation of iterated string

by athomason (Curate)
on Aug 18, 2000 at 20:43 UTC ( [id://28529]=note: print w/replies, xml ) Need Help??


in reply to Programmatic creation of iterated string

Here's a more general answer, though if you can wait for Perl 6, the weave (zip, or whatever) operator will be builtin or at least in a module instead of a hacked sub:
my $n = 30; print weave([map{$_%3?' ':"\n"}0..$n-1],[1..$n]); sub weave { my @t; { @$_ ? push @t, shift @$_ : return @t for @_; redo; } }

Log In?
Username:
Password:

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

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

    No recent polls found