Help for this page

Select Code to Download


  1. or download this
    mysub(@a);
    
  2. or download this
    mysub($a[0], $a[1], $a[2], ...);
    
  3. or download this
    sub sortArray {
       return sort @_;
    ...
    # Same thing.
    my @sorted = sortArray('e', 'd', 'c', 'b', 'a');
    print("@sorted\n");  # a b c d e
    
  4. or download this
    sub sortArray {
       my ($ar) = @_;
    ...
    my @a = qw( e d c b a );
    sortArray(\@a);
    print("@a\n");  # a b c d e