in reply to I need a different continue

In general, you can't when using a foreach() loop. In specific instances, you can use join() (when joining a string), shift elements off the array and check its length, or or use an iterator object to abstract it all away:
while (my $value = $it->next()) { # stuff if ($it->has_next()) { # for all but the last value } }
update: equivalent with shift

while (@array) { my $value = shift @array; # stuff if (@array) { # for all but the last value } }
update2: fixed logic error: s/unless/if/; - sorry about that.