# Some package; package C; sub flag { return 1; } # Some script #!/usr/bin/perl -w if(m{C->flag}x) { print "Ok\n" } else { print "Not good\n" }