in reply to Detect undefined subroutines
The definition of a sub can be made at runtime so it is hard to check at compile time that it has been defined. I am not saying that there isn't a way to say "ok - well except for that", but if there is a way I am sure someone else will reply. It is likely a scary hack involving do'ing the file, parsing for things that look like sub calls, and then using Universal can to see if main->can( 'sub' ).#!/usr/bin/perl use strict; use warnings; my $sub = 'foo'; { no strict 'refs'; *{ $sub } = sub { return 'bar' }; } print foo();
Cheers - L~R
|
|---|