On Thursday, April 25, 2002, at 05:24 PM, Jeff 'japhy' Pinyan wrote: > On Apr 25, Bryan R Harris said: > >> I'd like to remove all elements in an array that meet a certain criteria >> without changing their order. I'm sure this gets done all the time, but >> I'm not sure how to do it... > > You want splice() instead. > > perldoc -f splice > > or use grep?: @myarray = grep {$_ !=3 and $_ !=5} @myarray; > -- > Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/ > RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ > ** Look for "Regular Expressions in Perl" published by Manning, in 2002 * > * > <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. > [ I'm looking for programming work. If you like my work, let me know. > ] > > > -- > To unsubscribe, e-mail: beginners-unsubscribe@perl.org > For additional commands, e-mail: beginners-help@perl.org >Thread Previous