... $_ = 'the small print'; if( /^\s*(\S+)\s+(\S+)\s+(.+\S)\s*$/ ) { sub1( 'replace into reference_code values (?,?,?)', $1, $2, $3 ) } sub sub1 { my $p0 = shift; # try to comment this line out and get your lesson print "looks like a statement somewhere\n" if $p0 =~ /\w+/; my ($p1, $p2, $p3) = @_; print "statement parameters: $p1, $p2, $p3\n"; } ... #### ... sub1( 'replace into reference_code values (?,?,?)', "$1", "$2", "$3" ) ...