Re: Perl qx// broken with OpenVMS 8.x



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.


Craig A. Berry wrote:
In article <1159386322.704139.135830@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
yyyc186@xxxxxxxxxx wrote:

Encountered a script which quit working some time after the OS upgrade.

OpenVMS V8.2
This is perl, v5.8.6 built for VMS_AXP

The qx// function is broken pretty bad.

Interesting assertion, but you provide no evidence to support it. I
happen to know that the qx operator has run successfully many thousands
of times on OpenVMS Alpha v8.2, so you'll forgive me if I'm skeptical.

my @lines = ();
while (!$interrupted && (!$count_max || $count < $count_max)) {
if ($count) {
sleep $interval;
print "\033[999D\033[K" . "\033[1A\033[K" x scalar(@lines);
}
VmsUtil->set_logical('SYS$OUTPUT', 'nla0:');
VmsUtil->set_logical('SYS$ERROR', 'nla0:');
@lines = qx/@ARGV/;
VmsUtil->delete_logical('SYS$OUTPUT');
VmsUtil->delete_logical('SYS$ERROR');
print @lines;
++$count;
}

The above little snippet (with more stuff above it) was basically used
to loop through commands like DIR and TAIL, etc. Please, I'm not
looking for new and improved methods of accomplishing this same task.
I'm looking for information about the qx// bug being logged and a time
frame for the fix. For whatever reason, the creator of this chose to
use Perl, so it must remain as is.

To log a bug, one would typically use a bug logging facility, such as
the perlbug script included (along with its documentation) in every
release of Perl (or see http://rt.perl.org/perlbug/), or, if you are
using the HP-supported version of Perl and have an OS support contract,
using whatever mechanism you normally use to obtain support.

Having said that, I'm willing to take a crack at assessing bugs in Perl
on VMS that I happen to stumble over in the newsgroup. But only if
there is a reproducer or at least a description with enough information
to see whether there is, in fact, a bug.

The qx operator is a special quoting operator that spawns a command to
execute whatever is within quotes. You can see how it works with
something very simple like so:

$ perl -e "$x = qx/show time/; print $x;"
27-SEP-2006 22:30:26

If that works, then the qx operator is definitely not broken; there is
probably something wrong with the command you are passing to it, but
since you do not report the contents of @ARGV at the time you quote it
with qx, it is impossible to diagnose further without more information.

If my one-line example doesn't work, then you should check that the
process you are running from has the ability to spawn commands
(appropriate quotas, etc.). You should also report any error messages
you see, and exactly how you know it's not working, i.e., outputs that
you expect compared with outputs that you actually get. Since your
script suppresses error messages and does not do any error checking,
you're pretty much asking for trouble.

I don't doubt that you are having a problem, and it's certainly
possible that there is something in the combination of the command you
are trying to run, your Perl version, your VMS version, and your system
and account set-up that aren't getting along with each other. But
without seeing something much more specific than "broken pretty bad"
it's impossible to help you.

--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • Re: Perl qx// broken with OpenVMS 8.x
    ... This is perl, v5.8.6 built for VMS_AXP ... of times on OpenVMS Alpha v8.2, so you'll forgive me if I'm skeptical. ... I'm looking for information about the qx// bug being logged and a time ... The qx operator is a special quoting operator that spawns a command to ...
    (comp.os.vms)
  • Re: Perl qx// broken with OpenVMS 8.x
    ... @test would normally mean 'substitute array test here'. ... An ancient perl actuall reports: ... I'm looking for information about the qx// bug being logged and a time ... The qx operator is a special quoting operator that spawns a command to ...
    (comp.os.vms)
  • Re: why the following HereDoc print dont work?
    ... > it is bug of perl 5.8.4. ... #11907 Looking for a compiler bug is the strategy of LAST resort. ... > Command line is: ...
    (comp.lang.perl.misc)
  • Re: Attempt to free unrefferenced scalar:
    ... Also sprach Joe Smith: ... From the command line, use ... It might not be a bug in perl. ...
    (comp.lang.perl.misc)
  • Re: vdmfec and Perl?
    ... I am trying to use the program vdmfec from within perl. ... > Every time I use it, i get error messages. ... bug the vdmfec related newsgroups ...
    (comp.lang.perl.misc)