http://qs1969.pair.com?node_id=56468


in reply to How to use a scalar variable to call a subroutine?

In order to use a 'soft' reference such as this, you'll have to turn off strict refs:
#!/usr/bin/perl -w use strict; sub filename($){ print "it worked!\n"; } my $dbh; my $filename = 'filename'; no strict 'refs'; &{$filename}($dbh); use strict 'refs';