is this expected behavior? perl "" test.pl

is this expected behavior? perl "" test.pl

am 22.11.2007 08:55:39 von wilburlo

Hi,

I attempting to debug an odd open3 call that was passed something
like this:

open3( ...,...,..., @args);

The @args is where things get interesting the invocation is:

perl '' test.pl

Where the '' is 2 single quotes representing an empty entity, and
test.pl can be any script.

When perl 5.8.8 & perl 5.9.5 see the "empty" argument they read source
code from STDIN and then execute the code from STDIN. It halts,
waiting for code from the keyboard.

This ?bug? originally came about when someone tried to do this:
@args = ( 'perl',$extralibs,'etc...');

problem was $extralibs was empty. :)

On one side of the coin, I don't see any documentation regarding this
situation in "perldoc perl". On the other side of the coin, empty
arguments should probably be annoyed. And on yet the another side of
the coin, I should check $extralibs for being empty before stuffing it
into an array! :)

I didn't think a perlbug report was proper, so following the INSTALL
instructions ... here it is.


-daniel

Re: is this expected behavior? perl "" test.pl

am 22.11.2007 09:31:48 von nobull67

On Nov 22, 7:55 am, wilbu...@gmail.com wrote:

> When perl 5.8.8 & perl 5.9.5 see the "empty" argument they read source
> code from STDIN and then execute the code from STDIN. It halts,
> waiting for code from the keyboard.
>
> This ?bug? originally came about when someone tried to do this:
> @args = ( 'perl',$extralibs,'etc...');
>
> problem was $extralibs was empty. :)
>
> On one side of the coin, I don't see any documentation regarding this
> situation in "perldoc perl". On the other side of the coin, empty
> arguments should probably be annoyed.

Annoyed?

I think that either "perlrun" should be amended to say "" is treated
the same as "-" or perl should throw an error.

> And on yet the another side of
> the coin, I should check $extralibs for being empty before stuffing it
> into an array! :)

Actually, IMHO, extralibs should probably have been an array.

> I didn't think a perlbug report was proper, so following the INSTALL
> instructions ... here it is.

I don't think a perlbug report would be inappropriate.

Re: is this expected behavior? perl "" test.pl

am 23.11.2007 02:26:04 von wilburlo

> > arguments should probably be annoyed.
>
> Annoyed?
>

hehe, opps.

> > I didn't think a perlbug report was proper, so following the INSTALL
> > instructions ... here it is.
>
> I don't think a perlbug report would be inappropriate.

Ok :)

-daniel