new tasks

This commit is contained in:
Ingy döt Net 2013-04-09 00:46:50 -07:00
parent 2a4d27cea0
commit 80737d5a6a
1194 changed files with 15353 additions and 1 deletions

View file

@ -0,0 +1,2 @@
use autodie;
open my $fh, '<', 'file'; # automatically throws an exception on failure

View file

@ -0,0 +1,9 @@
my $a = 5;
#...input or change $a here
$a == 42 or die "Error message\n";
# or, alternatively:
die "Error message\n" unless $a == 42;
# or:
die "Error message\n" if not $a == 42;
# or just:
die "Error message\n" if $a != 42;

View file

@ -0,0 +1,2 @@
use Carp::Assert;
assert($a == 42);

View file

@ -0,0 +1,4 @@
is $a, 42;
ok $a == 42;
cmp_ok $a, '==', 42, 'The answer should be 42';
# etc.

View file

@ -0,0 +1 @@
open my $fh, '<', 'file' or die "Cannot open file: $!\n"; # $! contains the error message from the last error