Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^5: how to strip spaces, commas or new lines from an array

by hippo (Chancellor)
on Jun 16, 2021 at 09:07 UTC ( #11133916=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my @clean = map { s/[\s,]//mg; $_ } @array2;
    
    is_deeply \@clean, \@array1;
    
  2. or download this
    use strict;
    use warnings;
    ...
    s/[\s,]//mg for @array2;
    
    is_deeply \@array2, \@array1;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2021-09-28 16:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?