Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Deleting intermediate whitespaces, but leaving one behind each word

by Laurent_R (Canon)
on Dec 05, 2017 at 09:07 UTC ( [id://1204938]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    my @CPU_SPLIT = split /\s+/, $CPU;     # split the string on one or mo
    +re spaces
    # ~ s\ //g;                            # this line does not make any s
    +ense to me, commented out.
    my $result = join ' ', @CPU_SPLIT;     # join can operate directly on 
    +an array, no need to list the indices
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-24 00:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found