Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Leading empty array elements after splitting

by TomDLux (Vicar)
on Aug 23, 2016 at 16:01 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1170233]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2026-04-17 03:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.