in reply to Is it possible to create a sub exclusive to a sub?
Update: changed "print STDERR" to "die"use strict; &foo; &badfoo; sub foo { &bar; } sub badfoo { &bar; } sub bar { if ((caller(1))[3] ne 'main::foo') { die((caller(0))[3], ": can not be called from ", (caller(1))[3], " due to restrictions"); } print "called sub ",(caller(0))[3], "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is it possible to create a sub exclusive to a sub?
by ihb (Deacon) on Sep 19, 2004 at 10:42 UTC |