[ create a new paste ] login | about

Link: http://codepad.org/DVchWkTl    [ raw code | output | fork ]

Perl, pasted on Nov 24:
1
2
3
4
5
6
7
8
9
printf "Perl version is v%vd\n\n", $^V; # Codepad's Perl version is old (2002)

my @list = (11, 22, 33);

my $x = 22;
print "list contains $x\n" if grep {$_ eq $x} @list;

my $x = 44;
print "list contains $x\n" if grep {$_ eq $x} @list;


Output:
1
2
3
Perl version is v5.8.0

list contains 22


Create a new paste based on this one


Comments: