[23548] in Perl-Users-Digest
Perl-Users Digest, Issue: 5756 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 5 18:10:44 2003
Date: Wed, 5 Nov 2003 15:10:15 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 5 Nov 2003 Volume: 10 Number: 5756
Today's topics:
Re: what is @$? <usenet@morrow.me.uk>
Re: what is @$? <tassilo.parseval@rwth-aachen.de>
Re: what is @$? <usenet@morrow.me.uk>
Re: what is @$? <usenet@expires12.2003.tinita.de>
Re: what is @$? <tassilo.parseval@rwth-aachen.de>
Re: what is @$? <usenet@morrow.me.uk>
Re: what is @$? <uri@stemsystems.com>
what language is this? <fJogham@yahoo.com>
Re: what language is this? <syscjm@gwu.edu>
Re: what language is this? <go@away.spam>
Re: wolk a byte code tree <usenet@morrow.me.uk>
Re: wolk a byte code tree <davidroe@email.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 5 Nov 2003 19:34:22 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: what is @$?
Message-Id: <bobjbu$sph$1@wisteria.csv.warwick.ac.uk>
Uri Guttman <uri@stemsystems.com> wrote:
> >>>>> "BL" == Bart Lateur <bart.lateur@pandora.be> writes:
> BL> OTOH I think that having to declare @ISA is nothing but ridiculous:
> BL> despite its normal syntax for its name, it is used by Perl, and is
> BL> special.
>
> use base ;
But use base use()s the module you ask for, and I read hear a while
ago that one ought not to use Exporter as the semantics of that were
not yet defined...?
OTOH, I have no problem with our @ISA = :).
--
. | .
\ / The clueometer is reading zero.
. .
__ <-----@ __ ben@morrow.me.uk
------------------------------
Date: 5 Nov 2003 20:40:25 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: what is @$?
Message-Id: <bobn7p$e14$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Ben Morrow:
> Uri Guttman <uri@stemsystems.com> wrote:
>> >>>>> "BL" == Bart Lateur <bart.lateur@pandora.be> writes:
>> BL> OTOH I think that having to declare @ISA is nothing but ridiculous:
>> BL> despite its normal syntax for its name, it is used by Perl, and is
>> BL> special.
>>
>> use base ;
>
> But use base use()s the module you ask for, and I read hear a while
> ago that one ought not to use Exporter as the semantics of that were
> not yet defined...?
That I'd like to know in more detail. I always 'use base qw(Exporter)'
when my module exports something. I never had any problems with it so
far. I don't find any such warning in Exporter's documentation either.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Wed, 5 Nov 2003 20:58:05 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: what is @$?
Message-Id: <bobo8t$1fb$1@wisteria.csv.warwick.ac.uk>
tassilo.parseval@post.rwth-aachen.de wrote:
> Also sprach Ben Morrow:
> > But use base use()s the module you ask for, and I read hear a while
> > ago that one ought not to use Exporter as the semantics of that were
> > not yet defined...?
>
> That I'd like to know in more detail. I always 'use base qw(Exporter)'
> when my module exports something. I never had any problems with it so
> far. I don't find any such warning in Exporter's documentation either.
I don't know: as I said, I read a warning about it here which I didn't
really understand. Exporter's documentation does say 'require
Exporter;' rather than 'use Exporter;'...
The source of any problems, I suppose, is that 'use Exporter' will
call Exporter->import. As @Exporter::EXPORT et al are not defined,
this shouldn't do anything; but I suppose someone could change that.
Ben
--
I've seen things you people wouldn't believe: attack ships on fire off the
shoulder of Orion; I've watched C-beams glitter in the darkness near the
Tannhauser Gate. All these moments will be lost, in time, like tears in rain.
Time to die. |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-| ben@morrow.me.uk
------------------------------
Date: 5 Nov 2003 22:21:17 GMT
From: Tina Mueller <usenet@expires12.2003.tinita.de>
Subject: Re: what is @$?
Message-Id: <bobt4t$1cvjkt$1@ID-24002.news.uni-berlin.de>
Ben Morrow wrote:
> Uri Guttman <uri@stemsystems.com> wrote:
>> >>>>> "BL" == Bart Lateur <bart.lateur@pandora.be> writes:
>> BL> OTOH I think that having to declare @ISA is nothing but ridiculous:
>> BL> despite its normal syntax for its name, it is used by Perl, and is
>> BL> special.
>>
>> use base ;
> But use base use()s the module you ask for,
does it? i only see a require() in base.pm...
--
http://www.tinita.de/ http://www.perlquotes.de/ http://www.darkdance.net/
Enter the Doors of P e r c e p t i o n
-my address is currently unreachable due to the Swen.A virus-
------------------------------
Date: 5 Nov 2003 22:25:31 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: what is @$?
Message-Id: <bobtcr$l3p$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Ben Morrow:
> tassilo.parseval@post.rwth-aachen.de wrote:
>> Also sprach Ben Morrow:
>> > But use base use()s the module you ask for, and I read hear a while
>> > ago that one ought not to use Exporter as the semantics of that were
>> > not yet defined...?
>>
>> That I'd like to know in more detail. I always 'use base qw(Exporter)'
>> when my module exports something. I never had any problems with it so
>> far. I don't find any such warning in Exporter's documentation either.
>
> I don't know: as I said, I read a warning about it here which I didn't
> really understand. Exporter's documentation does say 'require
> Exporter;' rather than 'use Exporter;'...
>
> The source of any problems, I suppose, is that 'use Exporter' will
> call Exporter->import. As @Exporter::EXPORT et al are not defined,
> this shouldn't do anything; but I suppose someone could change that.
That can't be it. 'use base qw(Module)' will _not_ call Module->import.
It will merely require() the module, hence it is not equivalent to
BEGIN {
require Module;
Module->import;
@ISA = qw(Module);
}
I consider this whole thing a myth. Likewise, I noticed that the
examples in Exporter's perldoc (and in other related perldocs) always
suggest using require() plus manually adjusting @ISA. For me this is
just a red-herring. At some point, it must have become common opinion.
But it doesn't appear to be based on evidence that 'use base qw(Exporter)'
will do any harm.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Wed, 5 Nov 2003 22:33:46 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: what is @$?
Message-Id: <bobtsa$455$1@wisteria.csv.warwick.ac.uk>
tassilo.parseval@post.rwth-aachen.de wrote:
> Also sprach Ben Morrow:
> > The source of any problems, I suppose, is that 'use Exporter' will
> > call Exporter->import. As @Exporter::EXPORT et al are not defined,
> > this shouldn't do anything; but I suppose someone could change that.
>
> That can't be it. 'use base qw(Module)' will _not_ call Module->import.
> It will merely require() the module, hence it is not equivalent to
D'OH!
Apologies. For some reason I was under the impression that use base
use()d rather than simply require()ing the base module. Sorry, I
should have checked (as usual <sigh>).
Ben
--
If I were a butterfly I'd live for a day, / I would be free, just blowing away.
This cruel country has driven me down / Teased me and lied, teased me and lied.
I've only sad stories to tell to this town: / My dreams have withered and died.
ben@morrow.me.uk <=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=> (Kate Rusby)
------------------------------
Date: Wed, 05 Nov 2003 22:59:54 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: what is @$?
Message-Id: <x78ymufml1.fsf@mail.sysarch.com>
>>>>> "BM" == Ben Morrow <usenet@morrow.me.uk> writes:
BM> tassilo.parseval@post.rwth-aachen.de wrote:
>> Also sprach Ben Morrow:
>> > The source of any problems, I suppose, is that 'use Exporter' will
>> > call Exporter->import. As @Exporter::EXPORT et al are not defined,
>> > this shouldn't do anything; but I suppose someone could change that.
>>
>> That can't be it. 'use base qw(Module)' will _not_ call Module->import.
>> It will merely require() the module, hence it is not equivalent to
BM> D'OH!
BM> Apologies. For some reason I was under the impression that use base
BM> use()d rather than simply require()ing the base module. Sorry, I
BM> should have checked (as usual <sigh>).
use base is for inheriting from pure OO modules that will generally not
export stuff. so the base pragma has to use require to dynamically load
the inherited module and not have it export anything (yes, you could do
that with a eval of a use string).
in reality use base saves one or two line of code from the 2 lines of
use Foo and some form of @ISA declaration and assignment. but it also
clears up the semantics of your code which is another win. it hides the
ugly @ISA and adds only a simple praga to handle the common case loading
an inherited module.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 06 Nov 2003 06:50:22 +1100
From: Fred <fJogham@yahoo.com>
Subject: what language is this?
Message-Id: <3FA9547E.1070402@yahoo.com>
hello
I am trying to understand a lettle about a code in a language which is
not perl. would someone know what language it is?
e.g. in perl
my $a = 0b100001;
my $b = 0b010001;
the logic operator for xOr is "^"
in this language it is
|xOr(a,b)|
thanks
------------------------------
Date: Wed, 05 Nov 2003 15:33:00 -0500
From: Chris Mattern <syscjm@gwu.edu>
Subject: Re: what language is this?
Message-Id: <3FA95E7C.804@gwu.edu>
Fred wrote:
> hello
> I am trying to understand a lettle about a code in a language which is
> not perl. would someone know what language it is?
>
> e.g. in perl
> my $a = 0b100001;
> my $b = 0b010001;
> the logic operator for xOr is "^"
>
>
> in this language it is
> |xOr(a,b)|
>
Fred, you've given virtually no data. What you've described could
cover literally hundreds (hell, thousands) of languages, *including*
Perl if the program in question defined an "xOr" subroutine. Try
giving a couple of dozen lines of code as an example; it might be
possible to determine the language from that.
Chris Mattern
------------------------------
Date: Wed, 05 Nov 2003 20:51:07 GMT
From: "LaDainian Tomlinson" <go@away.spam>
Subject: Re: what language is this?
Message-Id: <%odqb.84684$IA2.2715023@twister.southeast.rr.com>
"Fred" wrote:
> hello
> I am trying to understand a lettle about a code in a language which is
> not perl. would someone know what language it is?
>
> e.g. in perl
> my $a = 0b100001;
> my $b = 0b010001;
> the logic operator for xOr is "^"
>
>
> in this language it is
> |xOr(a,b)|
Note that this is not C either, nor Java, Visual Basic, SPARC assembly,
HTML, or bash, so I'm forced to wonder why you chose to post this in a Perl
newsgroup.
A quick google reveals that MATLAB has a built-in function called xor(), but
I don't believe the pipes are valid MATLAB syntax. And there are bound to
be other smaller languages with similar functions. Of course, someone could
have defined an xOr() function of their own in practically any language, and
for that matter could have written the language as well.
This is a fairly verbose way of saying that you haven't given us quite
enough information to diagnose your problem.
Brandan L.
--
bclennox AT eos DOT ncsu DOT edu
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.532 / Virus Database: 326 - Release Date: 10/27/2003
------------------------------
Date: Wed, 5 Nov 2003 20:15:11 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: wolk a byte code tree
Message-Id: <boblof$3e$5@wisteria.csv.warwick.ac.uk>
Pavel Hlavnicka <pavel@gingerall.cz> wrote:
> this is a bit advanced question. I'm developing and application which is
> a finite state automaton, where actions to be take on particular state
> are described in an external configuration files as a Perl expressions.
>
> To keep the code as safe as possible, I want to allow only particular
> function names and variable names might be used in such external
> expressions and run a Perl interpreter in a taint mode.
Have you investigated the Safe module?
Ben
--
Every twenty-four hours about 34k children die from the effects of poverty.
Meanwhile, the latest estimate is that 2800 people died on 9/11, so it's like
that image, that ghastly, grey-billowing, double-barrelled fall, repeated
twelve times every day. Full of children. [Iain Banks] ben@morrow.me.uk
------------------------------
Date: Wed, 05 Nov 2003 21:47:26 GMT
From: Dave Roe <davidroe@email.com>
Subject: Re: wolk a byte code tree
Message-Id: <Odeqb.1963$Z25.1404@newsread4.news.pas.earthlink.net>
as someone else suggested, the Safe module might be what you are after.
otherwise, is it something you could interrogate first with something
like Parse::RecDescent?
/dave
Pavel Hlavnicka wrote:
> Hi all,
>
> this is a bit advanced question. I'm developing and application which is
> a finite state automaton, where actions to be take on particular state
> are described in an external configuration files as a Perl expressions.
>
> To keep the code as safe as possible, I want to allow only particular
> function names and variable names might be used in such external
> expressions and run a Perl interpreter in a taint mode.
>
> What I need is to pre-check the expression to be evaluated. Regular
> expression could become quite complex for this stuff, while walking the
> byte code tree seems to be a simple recursive algorithm.
>
> Problem is, that I have no clue where to start and I'm to lazy :) and
> under such a time pressure that I need your help. {Please give me some
> tips, where to start and how to walk a instruction tree. All I need is
> to quit if non-desired tree item is met. I think 'B' module family is
> the solution.
>
> Thank you VERY much in advance.
>
> Pavel
>
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 5756
***************************************