Help for this page

Select Code to Download


  1. or download this
    Abstract_noun
    Abstract_noun::Adjective
    Abstract_noun::Adjective1::Adjective2
    
  2. or download this
    package Disk;
    package Disk::Audio;
    package Disk::DVD;
    package Disk::DVD::Rewritable
    
  3. or download this
    use Test::More;
    eval "use Test::Pod::Coverage 0.08";
    plan skip_all => "Test::Pod::Coverage 0.08 required for testing POD co
    +verage" if $@;
    all_pod_coverage_ok();
    
  4. or download this
    sub fred {
        open(FH, "< f.tmp") or die "open error f.tmp";
    ...
    # if (!$ok) { print "died: $@\n" }
    
    # oops, handle FH is still open if exception was thrown.
    
  5. or download this
    sub fred {
        open(my $fh, "< f.tmp") or die "open error f.tmp";
    ...
    eval { fred() };
    if ($@) { print "died: $@\n" }
    # ok, $fh is auto-closed when its ref count goes to zero