Maybe something along these lines:<br><br>my @list=("1", "2", "3");<br>my $target = "2";<br>my $found=false;<br>my $cleanedList;<br>foreach $item(@list){<br> if($target eq $item){ <br>
$found = true;<br> }else{<br> push (@cleanedList,$item );<br> }<br>}<br>@list = @cleanedList;<br><br>print @list;<br><br><div class="gmail_quote">2009/5/13 Fulko Hew <span dir="ltr"><<a href="mailto:fulko.hew@gmail.com">fulko.hew@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>I know this is probably simple, but I'm having a mental block,<br>and I can't find the 'easy' solution in any book right now...<br>
<br>If I'm foreach'ing over a 'pick list', I need to get a positive indication<br>
that a match was found and then remove it from the 'pick list'.<br><br>something like:<br><br>if requestedvalue is on the picklist {<br> remove it from the list<br> return found<br>} else {<br> return notfound<br>
}<br><br>Being Perl, I'm sure there is an elegant way... If only I knew.<br><br>
<br>_______________________________________________<br>
toronto-pm mailing list<br>
<a href="mailto:toronto-pm@pm.org">toronto-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/toronto-pm" target="_blank">http://mail.pm.org/mailman/listinfo/toronto-pm</a><br>
<br></blockquote></div><br>