#! /usr/bin/perl use strict; use vars qw($indent); $indent = ''; print "Here is how things go without an &\n"; demo_no_amp(1..5); ; print "Here is how they go with an &\n"; demo_with_amp(1..5); ; print "And with explicit argument passing\n"; demo_explicit_args(1..5); ; print "Done\n"; sub demo_no_amp { local $indent = $indent . " "; while (@_) { my $arg = shift; print $indent, "Without &, '$arg'\n"; demo_no_amp(); } } sub demo_with_amp { local $indent = $indent . " "; while (@_) { my $arg = shift; print $indent, "With &, '$arg'\n"; &demo_with_amp; } } sub demo_explicit_args { local $indent = $indent . " "; while (@_) { my $arg = shift; print $indent, "With explicit args, '$arg'\n"; demo_explicit_args(@_); } }