"...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
In reply to Re: loop array excluding some elements
by karlgoethebier
in thread loop array excluding some elements
by IB2017
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |