Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 90249 invoked from network); 2 Dec 2003 15:11:00 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 2 Dec 2003 15:11:00 -0000 Received: (qmail 34235 invoked by uid 500); 2 Dec 2003 15:10:55 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 34016 invoked by uid 500); 2 Dec 2003 15:10:54 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list embperl@perl.apache.org Received: (qmail 33995 invoked from network); 2 Dec 2003 15:10:53 -0000 Received: from unknown (HELO etpi-gw.emc.com.ph) (203.167.103.134) by daedalus.apache.org with SMTP; 2 Dec 2003 15:10:53 -0000 Received: from calypso.emc.com.ph (calypso.emc.com.ph [203.167.64.20]) by etpi-gw.emc.com.ph (Postfix) with ESMTP id 0FB9E6EF8C for ; Tue, 2 Dec 2003 23:10:37 +0800 (PHT) Received: from phobos.emc.com.ph (phobos.emc.com.ph [203.167.64.10]) by calypso.emc.com.ph (Postfix) with ESMTP id D44B07A34 for ; Tue, 2 Dec 2003 23:10:52 +0800 (PHT) Received: from localhost (localhost.localdomain [127.0.0.1]) by phobos.emc.com.ph (Postfix) with ESMTP id 84E3A4F255 for ; Tue, 2 Dec 2003 23:16:41 +0800 (PHT) Received: from phobos.emc.com.ph ([127.0.0.1]) by localhost (phobos.emc.com.ph [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29189-06 for ; Tue, 2 Dec 2003 23:16:39 +0800 (PHT) Received: from jennifer.emc.com.ph (jennifer.emc.com.ph [203.167.64.3]) by phobos.emc.com.ph (Postfix) with ESMTP id 3C01C4F205 for ; Tue, 2 Dec 2003 23:16:38 +0800 (PHT) Received: from saturn.emc.com.ph (saturn.emc.com.ph [203.167.64.225]) by jennifer.emc.com.ph (Postfix) with ESMTP id 53644226 for ; Tue, 2 Dec 2003 23:09:19 +0800 (PHT) Received: by saturn.emc.com.ph (Postfix, from userid 501) id 3F3501A75; Tue, 2 Dec 2003 15:10:47 +0000 (UTC) Date: Tue, 2 Dec 2003 23:10:47 +0800 From: Sherwin Daganato To: embperl@perl.apache.org Subject: Re: called from embperl? $0 available? Message-ID: <20031202151047.GA7271@saturn.emc.com.ph> Mail-Followup-To: embperl@perl.apache.org References: <20031202141633.GD462@obda.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031202141633.GD462@obda.de> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at emc.com.ph X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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