Loading ...
Sorry, an error occurred while loading the content.

14632RE: [PBML] Referencing a sub routine

Expand Messages
  • Charles K. Clarkson
    May 2, 2003
      Daniel,

      It sounds like you need the 'caller' function. It's
      in 'perlfunc'. Here's a sub that returns the name of the
      calling subroutine:

      sub get_current_sub_name {
      my $name = ( caller(1) )[3];
      return unless $name && $name =~ /::([^:]+)$/;
      return $1;
      }

      HTH,

      Charles K. Clarkson
      --
      Head Bottle Washer,
      Clarkson Energy Homes, Inc.
      Mobile Home Specialists
      254 968-8328
    • Show all 3 messages in this topic