Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    #outputs
    2
    a_1_b_2
    
  2. or download this
    sub f {a => 1, b=>2}
    my @all_key = keys f();
    
  3. or download this
    sub f {a => 1, b=>2}
    my %h = (c => 3);
    say keys %h, f();
    #output:
    c
    
  4. or download this
    sub f {a => 1, b=>2}
    my %h = (c => 3);
    ...
    Experimental keys on scalar is now forbidden at perl.pl line 11.
    Type of arg 1 to keys must be hash or array (not subroutine entry) at 
    +perl.pl line 11, near "),"
    Execution of perl.pl aborted due to compilation errors.
    
  5. or download this
    use strict;
    use warnings;
    ...
    Experimental keys on scalar is now forbidden at call_art.pl line 8.
    Type of arg 1 to keys must be hash or array (not subroutine entry) at 
    +call_art.pl line 8, near "),"
    Execution of call_art.pl aborted due to compilation errors.