in reply to Determine first element in foreach
Yet another option:
my @my_list = (...); treat_all(@my_list); sub treat_all { my ( $first, @others ) = @_; treat_1($first); treat_others($_) for @others; }
In Section
Seekers of Perl Wisdom