[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

macperl-porters-digest v01.n004



From: owner-macperl-porters-digest@macperl.org (macperl-porters-digest)
To: macperl-porters-digest@macperl.org
Subject: macperl-porters-digest V1 #4
Reply-To: macperl-porters@macperl.org
Sender: owner-macperl-porters-digest@macperl.org
Errors-To: owner-macperl-porters-digest@macperl.org
Precedence: bulk


macperl-porters-digest     Saturday, March 6 1999     Volume 01 : Number 004




----------------------------------------------------------------------

Date: Fri, 5 Mar 1999 10:11:16 -0400 (AST)
From: Arved Sandstrom <Arved_37@chebucto.ns.ca>
Subject: Re: [MacPerl-Porters] possible bug on #! line, PERL5OPTS

On Tue, 2 Mar 1999, Chris Nandor wrote:

> I cannot put anything after an -MSome::Module on the #! line or in
> $ENV{PERL5OPTS}.
> 
> Works:
> 
>   #!perl -w -MData::Dumper
>   print Dumper {%ENV}
> 
> Doesn't:
> 
>   #!perl -MData::Dumper -w
>   print Dumper {%ENV}
> 
> This should work, and does work under Unix.  The greatest problem is when I
> want to put multiple -M flags in PERL5OPTS.

Hi, Chris

I started digging into the source files to figure this one out, just so
you know. For your example above, on my machine, it looks like MacPerl
treats -w as the first line of code.

Could be some pretty subtle script bugs come out of this if the switch
that you stuck in on the shebang line, after -M, was also a filetest
operator. :-) Especially if the first line after the shebang was a ;#
comment (you remember when some people were proselytizing ;# comment lines
as opposed to just # comment lines? Goes a ways back.) Just some twisted
musings on my part... :-)

Arved





==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-porters-request@macperl.org

------------------------------

Date: Fri, 5 Mar 1999 09:23:30 -0500
From: Chris Nandor <pudge@pobox.com>
Subject: Re: [MacPerl-Porters] possible bug on #! line, PERL5OPTS

At 09.11 -0500 1999.03.05, Arved Sandstrom wrote:
>I started digging into the source files to figure this one out, just so
>you know. For your example above, on my machine, it looks like MacPerl
>treats -w as the first line of code.

Just for clarification and to those who say "well, don't do that" about
putting -M flags on the #! line, I primarily want to use this in
$ENV{PERL5OPTS}.  It seems both have the same problem, and it is more
easily tested with #!.

>Could be some pretty subtle script bugs come out of this if the switch
>that you stuck in on the shebang line, after -M, was also a filetest
>operator. :-) Especially if the first line after the shebang was a ;#
>comment (you remember when some people were proselytizing ;# comment lines
>as opposed to just # comment lines? Goes a ways back.) Just some twisted
>musings on my part... :-)

Hmmmmm.

#!perl -MData::Dumper print -e 'Shuck Manual'
;# my program
print 'foo';
__END__

1foo

- --
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-porters-request@macperl.org

------------------------------

Date: Fri, 5 Mar 1999 12:01:26 -0400 (AST)
From: Arved Sandstrom <Arved_37@chebucto.ns.ca>
Subject: Re: [MacPerl-Porters] possible bug on #! line, PERL5OPTS

On Fri, 5 Mar 1999, Chris Nandor wrote:

> Hmmmmm.
> 
> #!perl -MData::Dumper print -e 'Shuck Manual'
> ;# my program
> print 'foo';
> __END__
> 
> 1foo
> 
Hmmmmm, indeed. So this compiled - I'm assuming '1foo' is the STDOUT?

Certainly looks like it's going into code mode right after the first -[mM]
switch.

Arved



==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-porters-request@macperl.org

------------------------------

Date: Fri, 5 Mar 1999 11:49:38 -0500
From: Chris Nandor <pudge@pobox.com>
Subject: Re: [MacPerl-Porters] possible bug on #! line, PERL5OPTS

At 11.01 -0500 1999.03.05, Arved Sandstrom wrote:
>On Fri, 5 Mar 1999, Chris Nandor wrote:
>
>> Hmmmmm.
>>
>> #!perl -MData::Dumper print -e 'Shuck Manual'
>> ;# my program
>> print 'foo';
>> __END__
>>
>> 1foo
>>
>Hmmmmm, indeed. So this compiled - I'm assuming '1foo' is the STDOUT?
>
>Certainly looks like it's going into code mode right after the first -[mM]
>switch.

Yep, yep.

- --
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-porters-request@macperl.org

------------------------------

End of macperl-porters-digest V1 #4
***********************************


==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-porters-request@macperl.org