my @test = qw(no_proc line_to_proc1 line_to_proc2); foreach (@test) { # this is actually just one line, indented to # make the if/else more clear. The trailing ";" # isn't even necessary. # this looks like a simple "we do either a or b, # but we will do one of them for sure situation, # ie if/else. The single statement below probably # equates to exactly the same machine code as a # more lengthy if/else statement. There is no # "next", there is no "and". /no_proc/ ? print "$_\n" : print "$_ : in proc\n" ; } __END__ prints: no_proc line_to_proc1 : in proc line_to_proc2 : in proc