Help for this page

Select Code to Download


  1. or download this
    >perl -c -we"print $a"
    Name "main::a" used only once: possible typo at -e line 1.
    
  2. or download this
    $Foo::Baar=1;
    print "Foo::Bar is enabled" if $Foo::Bar;
    
  3. or download this
    my $foo = 42;
    eval q[$foo++];
    
  4. or download this
    my($unused, $foo) = func();
    
  5. or download this
    { open my $fh, ">$file" or die $! }  # touch
    
  6. or download this
    {
       my $lock = lock_something();  # lock released on scope exit
       do_stuff_that_needs_the_lock();
    }
    
  7. or download this
    {
       my $tree = ...;
       my $sentry = Object::Destroyer->new( $tree, 'delete' );
       ...
    }
    
  8. or download this
    my $object = bless \do {my $var} => $class;