Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

MidLifeXis's scratchpad

by MidLifeXis (Prior)
on Jun 01, 2004 at 18:01 UTC ( #358325=scratchpad: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $load_task =
        ref($task) eq 'ARRAY' && $load eq 'bed clothes'    ? $task->[1] :
        ref($task) eq 'ARRAY' && $load ne 'bed clothes'    ? $task->[0] :
                                                             $task
    ;
    
  2. or download this
    my $load_task =
        ref($task) ne 'ARRAY'         ? $task      :
        $load      eq 'bed clothes'   ? $task->[1] :
        $load      ne 'bed clothes'   ? $task->[0] :
    die "huh?";
    
  3. or download this
    #!/usr/bin/perl -W 
    
    ...
    
      return @fileList;
    } 
    
  4. or download this
    $ perl -MTest::More -e 'plan "no_plan"; print use_ok("Does::Not::Exist
    +"), "\n"; print pass("This is ok"), "\n"'
    not ok 1 - use Does::Not::Exist;
    ...
    1
    1..2
    # Looks like you failed 1 test of 2.
    
  5. or download this
    $ perl -MTest::More -e 'plan "no_plan"; BEGIN {print use_ok("Does::Not
    +::Exist"), "\n"} print pass("This is ok"), "\n"'
    ok 1 - This is ok
    1
    1..1
    
  6. or download this
    if ($a ||    # Some reason
        $b       # Some other reason
    
  7. or download this
    BEGIN {
      my $success = eval {
    ...
      };
      isnt($success, 1, "eval of use_ok failed (as expected)");
    }
    
  8. or download this
    BEGIN {
        if ($foo) { die "this case should not succeed"; }
    }
    
  9. or download this
    use strict;
    use warnings;
    ...
    }
    close ($ifh);
    
  10. or download this
    my $nics = qx |/sbin/ifconfig| or die("Can't get info from ifconfig: $
    +!\n");
    my @nics = split /(?<=\n)(?=\w)/, $nics;
    ...
        # this statement needs work.
        #  print "Device: $a\n\tIPv4: $b\n\tBcast: $c\n\tMask: $d\n\tIPv6:
    + $e\n";
    }
    
  11. or download this
    use strict;
    use warnings;
    ...
    # This should really be explicit about the \r\n
    print "Content-Type: text/plain\n\n";
    print 'Hello World';
    
  12. or download this
    use strict;
    use warnings;
    ...
    
    <tr><td>Neither</td><td>Will</td><td>This</td></tr>
    
  13. or download this
    use Win32::OLE::Variant;
    ...
    $property->{Value} =
        Win32::OLE::Variant->new(VT_BOOL, 0xFFFFFFFF);
    
  14. or download this
      $blah->Disconnect;
      $blah = Vendor::Lib->Connect(...);
    
  15. or download this
      $blah->Disconnect;
      $blah = undef;
      $blah = Vendor::Lib->Connect(...);
    
  16. or download this
    (cd d1 && find .) | sort > out.1
    (cd d2 && find .) | sort > out.2
    diff out.1 out.2
    
  17. or download this
    #!/bin/ksh
    
    ...
          break
        fi
    done
    
  18. or download this
    #!/bin/ksh
    
    ...
          exec ./what_you_want_to_do *.pl
        fi
    done
    
  19. or download this
    #!perl
    
    ...
    
    print "\n\n", "End", "\n\n";
    print join("\n", keys %checkthese), "\n";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2014-08-23 19:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (178 votes), past polls