#! /usr/local/bin/perl -w # 1 # 2 use strict; # 3 # 4 my $foo = shift || 'ok'; # 5 my $bar; # = undef # 6 # 7 print "foo contains [$foo]\n"; # 8 if( $foo eq 'nok' ) { # 9 print "foo is nok\n"; # 10 } # 11 elsif( $bar eq 'rat' ) { # 12 print "bar is rat\n"; # 13 } # 14 else { # 15 print "nothing\n"; # 16 } # 17