#!/usr/bin/perl
use strict;
my $rv = 42 for (1);
print "$rv\n";


#
# This probably won't do what you expect...
# unless you understand the back corners
# of perl syntax better than most.
#
# The point is that the "for ()" syntax
# is a loop, which means that there's an
# implied block around the "my $rv",
# which means that the lexical "my $rv"
# is gone before we get to the next line.
#
# In other words, its the same as
#   for (1){
#     my $rv = 42;
#   }
# and the "my $rv" is contained within the block.
#
# The $rv in the print statement is thus the
# package global "our $rv", which is undefined.
# In fact, "use warnings" gives 
# Use of uninitialized value in concatenation (.) or string 
# at ./pop_quiz.pl line 5.

