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

Re^2: Counting characters without a space

by Cristoforo (Curate)
on Jul 22, 2018 at 22:34 UTC ( [id://1219063]=note: print w/replies, xml ) Need Help??


in reply to Re: Counting characters without a space
in thread Counting characters without a space

Just to illustrate how this might be done using Text::Wrap.
#!/usr/bin/perl use strict; use warnings; use Text::Wrap; my $s = '1234,4325,545678910,6544,4345,5443,3455,4321'; $Text::Wrap::columns = 15; $Text::Wrap::break = ','; # use this line if you need trailing commas at the end of each line #$Text::Wrap::separator = ",\n"; print wrap('', '', $s); __END__ C:\Old_Data\perlp>perl text_wrap2.pl 1234,4325 545678910,6544 4345,5443,3455 4321

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

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

    No recent polls found