Help for this page

Select Code to Download


  1. or download this
    sub test {
        my @rv = $_[0] =~ /^([0-9]+)$/;
        print "<<@rv>>\n";
        return @rv[ 0 .. $#rv ];
    }
    
  2. or download this
    <<>>
    [[]
    ...
    [123]
    <<123>>
    [123]
    
  3. or download this
    sub test {
        my @rv = $_[0] =~ /^([0-9]+)$/;
    ...
        return wantarray? @rv: $rv[-1];
    }
    
  4. or download this
    michael$ perl t.pl
    <<>>
    ...
    [123]
    <<123>>
    [123]