Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!mips!apple!snorkelwacker!bloom-beacon!bu.edu!nntp-read!jbw From: jbw@bucsf.bu.edu (Joe Wells) Newsgroups: comp.lang.perl Subject: subroutine inspecting its calling environment Message-ID: Date: 5 Mar 90 23:59:07 GMT Sender: news@bu.edu.bu.edu Organization: Boston University Computer Science Department Lines: 19 Some questions for the great perl gods: 1. Can a subroutine tell whether it was invoked without arguments? example: &subroutine_name; 2. Can a subroutine tell whether it was invoked in an array or scalar context? A boolean scalar context? 3. Can a subroutine tell whether its invocation was part of an expression or was the entire expression? example: &sub($x); $x = (&sub ($x) + &sub2 ($y)); -- Joe Wells jbw%bucsf.bu.edu@cs.bu.edu ...!harvard!bu-cs!bucsf!jbw