Who called subroutine.

Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default Who called subroutine.

    Hi, a basic question how do I know who called my subroutine ?
    It could be main, it could be another subroutine.
    Is setting a return value on a subroutine and checking for it the only way
    ? Surely not.

    Thanks

    John.


    John Hennessy Guest

  2. Similar Questions and Discussions

    1. subroutine problem
      Hi all, I have recently started to learn perl. After reading Randal Schwartz’s Learning perl, I decided to give my first program a whirl. Upon...
    2. #39868 [NEW]: Destructor is called allthought constructor is never called
      From: jb at ez dot no Operating system: Kubuntu 6.10 PHP version: 5.2.0 PHP Bug Type: *General Issues Bug description: ...
    3. #39678 [Opn->Bgs]: __set and __get not called where a class attribute is called statically
      ID: 39678 Updated by: tony2001@php.net Reported By: denis at edistar dot com -Status: Open +Status: ...
    4. #39678 [NEW]: __set and __get not called where a class attribute is called statically
      From: denis at edistar dot com Operating system: Linux PHP version: 5.2.0 PHP Bug Type: Scripting Engine problem Bug...
    5. Called as method or subroutine?
      Hi is there a way to make a sub/method compatible with the two following calling methods? 1. MyClass::mySub(); 2. MyClass->mySub(); Using...
  3. #2

    Default Re: Who called subroutine.

    On 12/11/2003 5:18 AM, John Hennessy wrote:
    > Hi, a basic question how do I know who called my subroutine ?
    > It could be main, it could be another subroutine.
    > Is setting a return value on a subroutine and checking for it the only way
    > ? Surely not.
    >
    > Thanks
    >
    > John.
    >
    >
    >
    perldoc -f caller

    Randy W. Sims Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139