Help for this page

Select Code to Download


  1. or download this
      use autobox;
      my @nums    = 1->to(10);
      my @reverse = 10->to(1);
    
  2. or download this
      package SCALAR;
                                                                          
    +                                                                     
    +                 
      sub to {
    ...
          : ($from .. $to);
      }
      1;
    
  3. or download this
      my @data = (
          'test12-05-2003this',
          'test11-05-2003this',
    ...
          my ($month,$day,$year) = shift =~ /(\d+)-(\d+)-(\d+)/;
          return "$year$month$day";
      }
    
  4. or download this
      package ARRAY;
                                                                          
    +                                                                     
    +                 
      sub grep    { [eval "grep  {$_[1]}  \@{\$_[0]}"] }
    ...
      # reverse is not used in this example
      sub reverse { [reverse @{$_[0]} ] }
      1;