perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sherwin Daganato <sher...@saturn.emc.com.ph>
Subject Re: called from embperl? $0 available?
Date Tue, 02 Dec 2003 15:10:47 GMT
On Tue, Dec 02, 2003 at 03:16:33PM +0100, Benni Baermann wrote:
> I noticed, that $0 is set to "-e" in my module if it is called from
> embperl. Is this the normal behaviour or just random? 
> 
> Is there another - possible better - way to determine in my modul, if
> the function is called from Embperl or from an ordinary script?
> 

Try this inside your function:

# tested on HTML-Embperl-1.3.4
if ( (caller)[0] =~ /^HTML::Embperl::DOC::_\d+$/ ) {
  # was called from Embperl
} else {
  # was called from elsewhere
}

HTH

Sherwin

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message