Skip Menu |

This queue is for tickets about the IPC-Cmd CPAN distribution.

Report information
The Basics
Id: 11178
Status: resolved
Priority: 0/
Queue: IPC-Cmd

People
Owner: Nobody in particular
Requestors: abeltje [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.24
Fixed in: (no value)



Subject: [PATCH] help can_run() on VMS
Hi, This patch helps IPC::Cmd::can_run() on VMS: --- Cmd.pm.orig Fri Jan 21 21:55:01 2005 +++ Cmd.pm Fri Jan 21 22:14:39 2005 @@ -21,8 +21,8 @@ $VERSION = '0.24'; $VERBOSE = 0; - $USE_IPC_RUN = 1; - $USE_IPC_OPEN3 = 1; + $USE_IPC_RUN = $^O ne 'VMS'; + $USE_IPC_OPEN3 = $^O ne 'VMS'; @ISA = qw[Exporter]; @EXPORT_OK = qw[can_run run]; @@ -32,11 +32,19 @@ sub can_run { my $command = shift; + # a lot of VMS executables have a symbol defined + # check those first + if ( $^O eq 'VMS' ) { + require VMS::DCLsym; + my $syms = VMS::DCLsym->new; + return $command if scalar $syms->getsym( uc $command ); + } + if( File::Spec->file_name_is_absolute($command) ) { return MM->maybe_command($command); } else { - for my $dir (split /$Config{path_sep}/, $ENV{PATH}) { + for my $dir (split /\Q$Config{path_sep}\E/, $ENV{PATH}) { my $abs = File::Spec->catfile($dir, $command); return $abs if $abs = MM->maybe_command($abs); }
--- Cmd.pm.orig Fri Jan 21 21:55:01 2005 +++ Cmd.pm Fri Jan 21 22:14:39 2005 @@ -21,8 +21,8 @@ $VERSION = '0.24'; $VERBOSE = 0; - $USE_IPC_RUN = 1; - $USE_IPC_OPEN3 = 1; + $USE_IPC_RUN = $^O ne 'VMS'; + $USE_IPC_OPEN3 = $^O ne 'VMS'; @ISA = qw[Exporter]; @EXPORT_OK = qw[can_run run]; @@ -32,11 +32,19 @@ sub can_run { my $command = shift; + # a lot of VMS executables have a symbol defined + # check those first + if ( $^O eq 'VMS' ) { + require VMS::DCLsym; + my $syms = VMS::DCLsym->new; + return $command if scalar $syms->getsym( uc $command ); + } + if( File::Spec->file_name_is_absolute($command) ) { return MM->maybe_command($command); } else { - for my $dir (split /$Config{path_sep}/, $ENV{PATH}) { + for my $dir (split /\Q$Config{path_sep}\E/, $ENV{PATH}) { my $abs = File::Spec->catfile($dir, $command); return $abs if $abs = MM->maybe_command($abs); }
[ABELTJE - Fri Jan 21 16:25:23 2005]: Show quoted text
> Hi, > > This patch helps IPC::Cmd::can_run() on VMS:
Thanks, applied