Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    sub test_b { my $arg = shift; ref($arg) ? test_a$$arg[0] : $arg }
    print test_b[42]; # prints '42'
    print test_a[42]; # prints '42'
    
  2. or download this
    test_a($$arg[0])
    
  3. or download this
    ${ $arg }->test_a([0])