#!/usr/bin/perl # walkies.pl use warnings; use strict; print "What's the weather like outside? "; chomp(my $weather = ); if ($weather eq "snowing") { print "OK, let's go!\n"; exit; } elsif ($weather eq "raining") { print "No way, sorry, I'm staying in.\n"; exit; } print "How hot is it, in degrees Celsius? "; my $temperature = ; if ($temperature < 18) { print "Too cold for me!\n"; exit; } print "And how many emails left to reply to? "; my $work = ; if ($work > 30) { print "Sorry - just too busy.\n"; } else { print "Well, why not?\n"; } #### #!/usr/bin/perl # walkies.pl use warnings; use strict; print "What's the weather like outside? "; chomp(my $weather = ); if ($weather eq "snowing") { print "OK, let's go!\n"; } elsif ($weather eq "raining") { print "No way, sorry, I'm staying in.\n"; } else { print "How hot is it, in degrees Celsius? "; my $temperature = ; if ($temperature < 18) { print "Too cold for me!\n"; } else { print "And how many emails left to reply to? "; my $work = ; if ($work > 30) { print "Sorry - just too busy.\n"; } else { print "Well, why not?\n"; } } }