Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: How to use a scalar variable to call a subroutine?

by kilinrax (Deacon)
on Feb 05, 2001 at 22:45 UTC ( [id://56468]=note: print w/replies, xml ) Need Help??


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';

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://56468]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-25 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found