Help for this page

Select Code to Download


  1. or download this
    sub foo {
        my @x = ("a", @_, "b"); # interpolation
    ...
    # also: comma operator in scalar context via "return"
    my $x = foo("u", "v");
    # $x is "y" !!
    
  2. or download this
    sub mysplit1        { ... }
    sub mysplit2 ($$;$) { ... }
    ...
     mysplit1(":", @x);  # arguments to mysplit1 are flattened
     mysplit2(":", @x);  # parsed like mysplit2(":", scalar(@x)) !!!
    &mysplit2(":", @x);  # prototype is ignored, arguments are flattened!