![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| diffrence between method call and function call in perl | Zaxon | Shell Programming and Scripting | 4 | 03-30-2009 03:28 PM |
| Ramdisk already defined | ChicagoBlues | Shell Programming and Scripting | 1 | 12-15-2008 09:39 AM |
| Best Method for installing Perl Modules | metallica1973 | High Level Programming | 2 | 03-05-2008 03:54 PM |
| pre defined variables | sumsin | High Level Programming | 7 | 11-30-2005 12:13 PM |
| Perl, FilePropStore Method | killerserv | Shell Programming and Scripting | 1 | 02-18-2002 06:42 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Is a Perl method defined?
In my code, I know I can write... Code:
if ( defined &test_sub ) {
test_sub();
} else {
print "Subroutine doesn't exist";
}
This tests the existence of the test_sub subroutine without actually calling it. If, though, I replace test_sub with a package method... Code:
if ( defined &$TEST->test_sub ) {
TEST->test_sub;
} else {
print "Method doesn't exist";
}
I get Code:
Not a CODE reference at (eval 22)[/opt/perl/5.8.0/lib/perl5db.pl:17] line 2, <STDIN> line 3. Any suggestions what I'm doing wrong? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|