- or download this
#!perl
...
my $output = $stylesheet->output_string($transformed);
print $output;
- 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
;
- 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?";
- or download this
#!/usr/bin/perl -W
...
return @fileList;
}
- 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.
- 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
- or download this
if ($a || # Some reason
$b # Some other reason
- or download this
BEGIN {
my $success = eval {
...
};
isnt($success, 1, "eval of use_ok failed (as expected)");
}
- or download this
BEGIN {
if ($foo) { die "this case should not succeed"; }
}
- or download this
use strict;
use warnings;
...
}
close ($ifh);
- 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";
}
- 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';
- or download this
use strict;
use warnings;
...
<tr><td>Neither</td><td>Will</td><td>This</td></tr>
- or download this
use Win32::OLE::Variant;
...
$property->{Value} =
Win32::OLE::Variant->new(VT_BOOL, 0xFFFFFFFF);
- or download this
$blah->Disconnect;
$blah = Vendor::Lib->Connect(...);
- or download this
$blah->Disconnect;
$blah = undef;
$blah = Vendor::Lib->Connect(...);
- or download this
(cd d1 && find .) | sort > out.1
(cd d2 && find .) | sort > out.2
diff out.1 out.2
- or download this
#!/bin/ksh
...
break
fi
done
- or download this
#!/bin/ksh
...
exec ./what_you_want_to_do *.pl
fi
done
- or download this
#!perl
...
print "\n\n", "End", "\n\n";
print join("\n", keys %checkthese), "\n";