On 4/29/05, Ronald J Kimball <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 29, 2005 at 03:37:06PM +0200, demerphq wrote:
> > On 4/29/05, Ronald J Kimball <[EMAIL PROTECTED]> wrote:
> > > On Fri, Apr 29, 2005 at 10:44:34AM +0200, H.Merijn Brand wrote:
> > >
> > > > Then let me reword. I'd like it to be possible.
> > > >
> > > > lt09:/home/merijn 104 > perl -l -e 'my $x = 42' -e 'print $x'
> > > > syntax error at -e line 2, near "print"
> > > > Execution of -e aborted due to compilation errors.
> > > > Exit 255
> > > > lt09:/home/merijn 105 >
> > > >
> > > > That's just because I left out the semicolon in  the first -e
> > > > Could we then at least agree on something that each -e is guaranteed
> > > > to be closed? a lone semicolon is a no-op, so there won't be any 
> > > > backward
> > > > compatibility issues
> > >
> > > There won't be any backwards compatibility issues with adding a
> > > semicolon at the end of every line of a script??
> >
> > Not if the new behaviour only occurs in presence of the hypothetical
> > -X modifier.
> 
> The -X modifier would do more than just add a semicolon to the end of every
> line, right?  Anyone wanting to use the -X modifier for its other benefits
> would have to write their command lines differently than they would without
> the -X modifier.

I think the -X modifier would change other aspects of the behaviour of
-e anyway. If something like the following becomes

-Xe "#init" -p "#preprocess"  -e "#postprocess"

#init
while (<>) {
   #preprocess
} continue {
   print ...
} 
#postprocess

then obviously the rules for the endings of -e have to change anyway.
So automatically adding a semicolon and newline seems to me to make
sense. The whole idea for me is to better huffman encode command line
usage so making the semicolon optional fits in nicely. And I dont
think its that different in terms of expectation, I dont think the
style you showed is that common even if it is legal.

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

Reply via email to