in reply to Re: Re: test for subroutine existence
in thread test for subroutine existence
Abigail#!/usr/bin/perl use warnings 'all'; use strict; sub my_sub {1} foreach my $sub (qw /my_sub no_sub/) { print "$sub ", defined &$sub ? "exists\n" : "doesn't exist\n"; } __END__ my_sub exists no_sub doesn't exist
|
|---|