Hi
See perldoc -f delete.
4 example (Untested)
foreach $index (0 .. $#ARRAY) {
delete $ARRAY[$index] if (criteria);
}
YAron Kahanovitch
----- Original Message -----
From: "Yossi Itzkovich" <[EMAIL PROTECTED]>
To: "Perl in Israel" <[email protected]>
Sent: 20:36:29 (GMT+0200) Africa/Harare יום חמישי 24 מאי 2007
Subject: [Israel.pm] How to remove elements according to a filter from an array
Hi,
Assuming I have a big array, and I want to remove elemnts according to a
criteria, how do I do it ?
Please note, I am not asking about getting a new list of elements that
passed the filter (like grep does), but removing the items from the
original list. For a big array (and assuming that arrays are
implemented with linked list (is it ?)), then removing items from the
original list might be much faster.
Yossi
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl