in reply to loop array excluding some elements

"...one liner?..."

Probably you want something like this?

perl -MData::Dump -Mstrict  -e 'dd map { my $i = $_; ...;} grep { $_ != 0 } ( 1, 2, 3, 5, 0, 7, 8, 9, 10 );'

The stuff you want to do with $i goes here: ...; See also Common Causes for "Modification of a read-only value attempted".

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help