Re: Perl qx// broken with OpenVMS 8.x
- From: "Craig A. Berry" <craigberry@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Sep 2006 08:53:07 -0500
In article <1159446885.659982.286700@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
yyyc186@xxxxxxxxxx wrote:
perl -e "$x = qx/@test/; print $x;"
Dead
type test.com
$ write sys$output "This is a test"
perl -e "$x = qx/type test.com/; print $x;"
$ write sys$output "This is a test"
@test
This is a test
Prior to the upgrade, this used to work.
I doubt it. You are interpolating an array named @test and then
sending its contents to lib$spawn as a command string. Since the array
has never been initialized, of course there is no command to be
executed. If you enable warnings with the -w switch, the tool actually
lets you know what mistake you are making:
$ perl -we "$x = qx/@test/; print $x;"
Possible unintended interpolation of @test in string at -e line 1.
Name "main::test" used only once: possible typo at -e line 1.
If you don't want interpolation to take place so that DCL sees the '@',
there are a couple of easy ways to do that. One is to escape the '@':
$ perl -we "$x = qx/\@test/; print $x;"
This is a test
The other is to use single quotes for your quote delimiter, which get
special handling by the qx operator so no interpolation takes place:
$ perl -we "$x = qx'@test'; print $x;"
This is a test
In your original example, you were interpolating @ARGV, i.e., the
program's command-line arguments, in the qx operator, which I assumed
was your intention. In that case, interpolation is most likely what you
do want, but might be a clue. If you ran the program without passing
any
arguments, then the subprocess would not have anything to do, much like
when @test is interpolated above. That's one guess about what might be
causing your problem.
It's remotely possible that something in your recent upgrade triggered
a problem with your Perl script, but I still see no evidence that there
is something generally wrong with the qx operator.
--
Posted via a free Usenet account from http://www.teranews.com
.
- References:
- Perl qx// broken with OpenVMS 8.x
- From: yyyc186
- Re: Perl qx// broken with OpenVMS 8.x
- From: Craig A. Berry
- Re: Perl qx// broken with OpenVMS 8.x
- From: yyyc186
- Perl qx// broken with OpenVMS 8.x
- Prev by Date: Re: HP announces new Integrity servers
- Next by Date: Re: Graphic options for DS10L
- Previous by thread: Re: Perl qx// broken with OpenVMS 8.x
- Next by thread: Re: Perl qx// broken with OpenVMS 8.x
- Index(es):
Relevant Pages
|