Help for this page

Select Code to Download


  1. or download this
    sub baz ($this, $that) {
        warn '@_ contains ', scalar(@_), " elements.\n";
    }
    
    baz('hello', 'world') # @_ contains 2 elements.
    
  2. or download this
    sub foo ($this, $that = 'world') {
        warn '@_ contains ', scalar(@_), " elements.\n";
    }
    
    foo('hello'); # @_ contains 1 elements.
    
  3. or download this
    #!/usr/bin/env perl
    
    ...
    
    note "\n\nTesting foo()";
    foo("a");
    
  4. or download this
    1..8
    # 
    ...
    # Looks like you failed 2 tests of 8.
    
    shell returned 2