# assume we have a string if we receive only one argument if ( @_ == 1){ # STRING PART ... } elsif ( $WARNINGS == 1 and @_ == 0 ){ carp "Empty list passed in! We assume all element will be processed."; } # otherwise we received a list else{ # NON EMPTY LIST PART ... }