Help for this page

Select Code to Download


  1. or download this
    {
        my ($foo,@foo);
        sub foo () :lvalue {
            wantarray ? @foo : $foo;
        }
    }
    
  2. or download this
    foo = 'Flintstone';
    (foo) = qw/Fred Wilma Pebbles/;
    # Hmmm, odd bug, the lines following demonstrate what works
    # print scalar(foo), ', ', $_, $/ for foo;
    print join ' & ', foo;
    print ' ', scalar(foo),$/;
    
  3. or download this
    {
        my $foo;
        sub foo () :lvalue {
            defined wantarray ? $foo : undef $foo;
        }
    }