http://qs321.pair.com?node_id=1096181


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; }