sub foo { if ( has_args ) { foreach ( @_ ) { # ... } } else { # ..., but with $_ } }