in reply to test for subroutine existence
Abigail#!/usr/bin/perl use warnings 'all'; use strict; sub my_sub {1} print "my_sub ", defined &my_sub ? "exists\n" : "doesn't exist\n"; print "no_sub ", defined &no_sub ? "exists\n" : "doesn't exist\n"; __END__ my_sub exists no_sub doesn't exist
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: test for subroutine existence
by twerq (Deacon) on Aug 12, 2002 at 14:20 UTC | |
by Abigail-II (Bishop) on Aug 12, 2002 at 14:32 UTC | |
by twerq (Deacon) on Aug 12, 2002 at 14:27 UTC |