Help for this page

Select Code to Download


  1. or download this
    use List::Util qw/reduce/;
    # my ($a,$b)=(0,0);
    print reduce { $b+=$a } 1..10;
    
  2. or download this
    use warnings;
    use strict;
    ...
    
    use Data::Dump;
    dd \@x;
    
  3. or download this
    my ($a,$b)=(0,0);
    print sort { $b cmp $a } 1..10;
    
  4. or download this
    Can't use "my $b" in sort comparison at ... line 2.
    
  5. or download this
    use warnings;
    use strict;
    ...
    package Tst;
    
    print sort { $b cmp $a } 1..10;
    
  6. or download this
    Use of uninitialized value $b in string comparison (cmp) at /home/lanx
    +/B/PL/PM/ScopeListUtils.pl line 9.
    Use of uninitialized value $a in string comparison (cmp) at /home/lanx
    +/B/PL/PM/ScopeListUtils.pl line 9.
    Use of uninitialized value $b in string comparison (cmp) at /home/lanx
    +/B/PL/PM/ScopeListUtils.pl line 9.
    Use of uninitialized value $a in string comparison (cmp) at /home/lanx
    +/B/PL/PM/ScopeListUtils.pl line 9.
    ...