sunorccws04 ~$ cat tpl ; ./tpl #!/usr/bin/perl sub showme; foreach $y ( 1..10) { $foo = $y; print showme(), "is the x value\n"; } sub showme { my $x; $x = $y if ($foo %2); # might as well mix up some T/F } 1 is the x value 0 is the x value 3 is the x value 0 is the x value 5 is the x value 0 is the x value 7 is the x value 0 is the x value 9 is the x value 0 is the x value