#!/usr/bin/perl use strict; #this works fine my $methodWithoutParam = \&myMethod; &$methodWithoutParam; # however, the next line actually executes the method. Not desired my $methodWithParam = \&myMethod('My Param'); # and the attempt to call the method generates an error. # Not a CODE reference at ... &$methodWithParam; sub myMethod { my ($param) = @_; if ($param) { print "Woohoo, you have successfully passed in a parameter ($param).\n"; } else { print "You have not attempted to pass in a parameter.\n"; } }