in reply to Test if a string is a sub name
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; sub My::Filters::known {} sub My::Filters::forward; for my $string (qw(My::Filters::known My::Filters::unknown My::Filters::forward) ) { say join "\t", $string, defined &$string, exists &$string; }
Output:
My::Filters::known 1 1 My::Filters::unknown My::Filters::forward 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Test if a string is a sub name
by BillKSmith (Monsignor) on Oct 06, 2022 at 15:15 UTC | |
by choroba (Cardinal) on Oct 06, 2022 at 15:22 UTC | |
|
Re^2: Test if a string is a sub name
by clscott (Friar) on Oct 05, 2022 at 22:42 UTC |