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

Re: unpack format string for ignoring chars

by BrowserUk (Patriarch)
on Feb 13, 2004 at 21:32 UTC ( [id://328884]=note: print w/replies, xml ) Need Help??


in reply to unpack format string for ignoring chars

Like this?

print join '|', unpack '( a4 x10 )2 a4', 'this not that this not that +this'; this|this|this

Or was it like that:)


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Timing (and a little luck) are everything!

Replies are listed 'Best First'.
Re: Re: unpack format string for ignoring chars
by LanceDeeply (Chaplain) on Feb 13, 2004 at 21:51 UTC
    thanks!

    i just didnt know how to use x properly, got a little confused reading the doc.
    i added x1 to the format string wherever i wanted to ignore a character
    my $count = 0; foreach my $len (@lens) { if ( $count ++ ) { $format .= "x1"; } $format .= "A$len"; }
    does the deed nicely

Log In?
Username:
Password:

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

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

    No recent polls found