[ create a new paste ] login | about

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

skeletonkey - Perl, pasted on Oct 12:
1
2
3
4
5
6
7
8
9
10
11
12
my @items = (1, 2, 3, 'four', 5, 'six');
my $found_match = 0;
foreach my $item (@items) {
    if ($item eq 5) {
        print "Found $item\n";
        $found_match = 1;
        last;
    }
}
if (!$found_match) {
    print "Didn't find what I was looking for\n";
}


Output:
1
Found 5


Create a new paste based on this one


Comments: