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