more with operators

This commit is contained in:
Dan Buch 2011-01-04 22:06:45 -05:00
parent 80271d9649
commit 5ec66997df

View File

@ -102,3 +102,33 @@ if (($a == 5 && $b == 2) or $c == 3) {
if ($a == 4 && $b < 3) { if ($a == 4 && $b < 3) {
printcookies(); printcookies();
} }
sub foo {
return ($c eq 0);
}
foo() or print "foo() failed\n";
print 'Hello' . ' world';
print "\n";
my $str = "hi";
my $repeated_str = $str x 5;
println("$repeated_str");
println($repeated_str eq 'hihihihihi');
println($str ne 'hi');
$str =~ s/i/m/g;
println($str);
print 'A' .. 'Z', "\n";
print 'a' .. 'z', "\n";
print 'A' .. 'z', "\n";
print 1 .. 20, "\n";
print '&' .. '!', "\n";
print 10 .. -10, "\n";
print "$_\n" foreach 1 .. 10, "\n";