On 5/3/05, Brad Baxter <[EMAIL PROTECTED]> wrote:
> On Tue, 3 May 2005, Abigail wrote:
> 
> > On Tue, May 03, 2005 at 11:14:51AM -0400, Brad Baxter wrote:
> > >
> > > Of these, none stands out to me as an obvious choice for the kinds of
> > > uses that have been suggested.  Would overloading -e with a single
> > > letter be too dangerous?
> >
> > Yes.  perl -eB already has a meaning. It's equivalent to 'perl -e "B"'.
> > Without further arguments, not very useful. But in combination with
> > arguments, it very well may be.
> >
> > Abigail
> 
> Yes, that was the kind of danger I was alluding to.  I thought perhaps
> that "perl -eB '...'" might be recognizable as different from "perl
> -eB" by virtue of the following '...' If not, I might suggest -E
> (mnemonic: a variant of -e).
> 
> -EB '...'  and/or  -B '...'  ===  -e 'BEGIN{...}'
> -EE '...'  and/or  -E '...'  ===  -e 'END{...}'
> -Eb '...'                    ===  -e '...' but before while loop
> -Ee '...'                    ===  -e '...' but after while loop
> 
> That would invest -E and perhaps -B.  I wonder if the Perl6 folks
> are thinking about anything similar ...

Hmm, so with this scheme would the order be relevent? And how would it
interact with the normal -p,-n,-e?

The reason i keep saying a "modifier" is that I like the way changing
the behaviour of -e,-p,-n resolves the ambiguity of mixing the two
forms. For instance if -E simply changes the behaviour of any
following -e,-p,-n then

-Ee "1;" -n "2;"  -e "3;" -p "4;" -e "5;" 

would produce 

1;
while (<>) {2;}
3;
while (<>) {4;} continue {print;}
5;

If the presence of -E comes after an existing -n or -p it would be an
error. If we special case
-EB and -EE we get the BEGIN{} and END{} too.

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Reply via email to