#!/usr/bin/perl -w use strict; sub test { my $arg = shift; my $x = foo ( do { # In theory, this will pass 7 to foo() if $arg is 3 # In reality, it will return from test() return 7 if $arg == 3; } ); $x = 5; return $x; } print test( 3 ),$/; print test( 5 ),$/; sub foo {};