Help for this page

Select Code to Download


  1. or download this
    sub join_list {
       return "none" if !@_;  # ???
    ...
       return $last if !@_;
       return join( ", ", @_ ) . " and " . $last;
    }
    
  2. or download this
    perl -e "my $test = join ', ', ('A', 'B', 'C');$test =~ s/,([^,]+?)$/ 
    +and$1/; print $test;"