Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

choroba's scratchpad

by choroba (Cardinal)
on Apr 02, 2010 at 15:13 UTC ( [id://832496]=scratchpad: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    my $i;
    my $t = 'My'->new(sub { $values[$i++ % @values] });
    say t => $t->rand(6) for 1 .. 7;
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    use warnings;
    ...
    tie my $s, 'MyScalar', 5;
    say $s, $s = 4;
    say "" . $s, $s = 3;
    
  3. or download this
    #! /usr/bin/perl
    use warnings;
    use strict;
    ...
    done_testing();
    
    cmpthese(-5, $tab);
    
  4. or download this
    #!/usr/bin/perl
    use warnings;
    use strict;
    ...
    }
    
    print decode('abc');
    
  5. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    my $o = 'My'->new;
    $o->attr = 12;
    say $o->attr;
    
  6. or download this
    #!/usr/bin/perl
    use warnings;
    ...
        push @options, -t => "$release-backports";
    }
    system 'sudo', 'apt-get', @options, 'install', @ARGV;
    
  7. or download this
    #! /usr/bin/perl
    use warnings                                     ;
    ...
                  'mode3' => 'do_something_else'
          )                                          ;
                                                     }
    
  8. or download this
    #! /usr/bin/perl
    use warnings;
    ...
          1 Scope Making Demo 2016-08-06 10:00 2016-08-06 16:00 Tent north
    + of Pavilion Ray Morits ATM Demo Hours 
          1 Scope Making Demo 2016-08-06 10:00:01 2016-08-06 10:30 Tent no
    +rth of Pavilion Ray Morits Intro & Rough Grinding Intro & Rou
    +gh Grinding
          1 Registration Gate  2016-08-06 07:00 2016-08-06 19:00 Entry Gat
    +e  Hours
    
  9. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    1.31 5.025007
    Sun Sep 25 12:00:00 2016 - +0000 - +0200 - 0
    Mon Oct 31 12:00:00 2016 - +0000 - +0100 - 0
    
  10. or download this
    #! /usr/bin/perl
    use warnings;
    ...
    say '1..3';
    say 'ok ', $_ for 1 .. 2;
    say 'not ok 3';
    
  11. or download this
    #!/usr/bin/perl
    use warnings;
    ...
                          \2
                      )
                      $/xi;
    
  12. or download this
    say for 'abA' =~ /^
                      (?<whole>
    ...
                      )*
                      (\g{right})
                      $/xi;
    
  13. or download this
    #!/usr/bin/perl
    use warnings;
    use strict;
    ...
    tie my @array, 'Array::Stretch';
    @array = qw(a b c);
    $array[-1] = 'A';
    
  14. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    }
    
    main();
    
  15. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    say 'utf8'  if $o_utf8 =~ /$valid/;
    
    say 'yup' if "\x82" =~ /$valid/; # chr 130
    
  16. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    say $o->get_name;
    eval {$o->new; 1} or warn $@;
    eval {'Named'->get_name; 1} or warn $@;
    
  17. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    
    tie my $p, 'Previous';
    $p = $_ for 'a' .. 'z';
    
  18. or download this
    #! /usr/bin/perl
    use warnings;
    use strict;
    ...
        print $t->ymd, "\n" if is_magical(join q(), $t->mon, $t->mday, $t-
    +>year);
        $t = $t + ONE_DAY;
    }
    
  19. or download this
    (1)$ perl -MO=Deparse -e 'do("foo")->{bar};'
    do $foo{'bar'};
    -e syntax OK
    ...
    use strict 'refs';
    do('foo')->{'bar'};
    -e syntax OK
    
  20. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    my %uniq;
    undef @uniq{@separators};
    say 1 == keys %uniq ? 'Same' : 'Different';
    
  21. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    }
    
    print Dumper \@result;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-28 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found