The code is wrong for sure, because $_ is not the array element, but just a reference to his scalar... but how can I do that?for (@ARGV) { # delete($_) if $_ eq 'hello'; }
In reply to How can I delete an element in a foreach cycle? by saintex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |