Hello all
I wish to code some Perl scripts which can gracefully handle modules not being present.
If I just do "use xyz::abc" the script fails compilation. I need to be able to test if a subroutine exists (use defined, I suppose) and if not, just have a guess.
This sort of thing.
TIA
I wish to code some Perl scripts which can gracefully handle modules not being present.
If I just do "use xyz::abc" the script fails compilation. I need to be able to test if a subroutine exists (use defined, I suppose) and if not, just have a guess.
Code:
use File::Spec::Function qw(splitpath);
if ( not defined &splitpath ) {
$path = "/tmp"
}
else {
($path) = splitpath( $ddd$ )
}
This sort of thing.
TIA