Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Leading empty array elements after splitting

by TomDLux (Vicar)
on Aug 23, 2016 at 16:01 UTC ( #1170233=note: print w/replies, xml ) Need Help??


in reply to Leading empty array elements after splitting

Extracting just the numbers works well, but since you describe a problem with getting blank stuff you don't want, you might as well know about grep ...

22 11:56:12 tomdlux [ ~ ] $ p522 -E 'say for split /\D+/, "MD:Z:4C3C7C0T2^T9C44"' + 4 3 7 0 2 9 44 23 11:56:19 tomdlux [ ~ ] $ p522 -E 'say for grep {length $_} split /\D+/, "MD:Z:4C3C7C0T2^T9C44 +"' 4 3 7 0 2 9 44

As Occam said: Entia non sunt multiplicanda praeter necessitatem.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2021-04-15 02:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?