Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: One liner: split fixed-width field into equal length chunks...

by OM_Zen (Scribe)
on Mar 21, 2003 at 18:09 UTC ( #244960=note: print w/ replies, xml ) Need Help??


in reply to One liner: split fixed-width field into equal length chunks...

Hi ,

This shall also do the things you require

my $a = "HereIsTheStringAsString"; my $n = 5; while($a =~/.{1,$n}/){print "$&\n"; $a = $'}; __END__ HereI STheS tring AsStr ing


Comment on Re: One liner: split fixed-width field into equal length chunks...
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2016-02-11 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (361 votes), past polls