Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How to split_and_pad string to n-th chars pieces with one regular expression?

by mwah (Hermit)
on Nov 30, 2007 at 14:40 UTC ( #654124=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
     ...
     $txt =~ s/(.{1,3}|^$)/sprintf"'%3s'\n",$1/ge;
     print $txt;
     ...
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2023-12-02 03:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (13 votes). Check out past polls.

    Notices?