No such thing as a small change | |
PerlMonks |
Re: another elegance contestby l.frankline (Hermit) |
on Nov 16, 2005 at 12:40 UTC ( [id://509008]=note: print w/replies, xml ) | Need Help?? |
Hi, Its my idea.... $i=0;$x="klops"; @a=qw(apfel klops klops börne joghurt klops nüß); @new = (); for ($i=0;$i<=$#a;$i++) { if (grep/$x/,$a[$i]) { push (@new,$a[$i]); delete ($a[$i]); } } print @a; print @new; Thanx
In Section
Seekers of Perl Wisdom
|
|