in reply to Best way to remove elem of for loop

You method does not remove the total number of elements in the array which can potentially cause problems in the future:

... #assume @ar is filled with this stuff __END__ /tmp /var /etc /nonexistent /home /nonexistent
DB<5> p Dumper \@ar $VAR1 = [ '/tmp', '/var', '/etc', '', '/home', '' ];

Celebrate Intellectual Diversity