is this expected behavior? perl '' test.pl

W

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
 
B

Brian McCauley

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,206
Messages
2,571,069
Members
47,677
Latest member
MoisesKoeh

Latest Threads

Top