Help for this page

Select Code to Download


  1. or download this
    #perl mytest.pl sn 5
    
    ...
    
    # It's going to return '1' because $ARGV[1] was undef, due to
    # the first shift.
    
  2. or download this
    my $based_on = defined( $ARGV[0] ) ? $ARGV[0] : 'tp';
    my $top      = defined( $ARGV[1] ) ? $ARGV[1] : 1;
    
  3. or download this
    my $based_on = defined( $ARGV[0] ) ? shift : 'tp';
    my $top      = defined( $ARGV[1] ) ? shift : 1;