I just noticed this same problem this morning after upgrading from 629 to 630. I use
the system for certain DOS commands and found
that the DOS Copy command was failing. After over an hour of experimentation, I too
narrowed it down to the system call. Originally,
I used it as:
system('copy','file1 file2');
but had to change it to:
system('copy','file1','file2');
I actually use a module to autoload it. I had to change the argument from a scalar to
a list:
#! C:/perl/bin/perl -w
# Dos.pm 12/04/2001.
# This package will execute Dos shell commands transparently within perl.
package Dos;
# Declare pragmas.
use diagnostics;
use warnings;
BEGIN
{
my (undef, $Filename, $Line) = caller;
print(STDERR "Dos.pm has been loaded from $Filename line $Line\n");
}
sub import()
{
my $Self = shift;
my $Caller = caller();
my @EXPORT = ();
if (@_) {@EXPORT = @_;}
else {@EXPORT = 'AUTOLOAD';}
# Create a reference in the calling package's namespace to the
# AUTOLOAD subroutine in this package.
foreach (@EXPORT) {*{"${Caller}::$_"} = \&{"Dos::$_"};}
}
sub AUTOLOAD()
{
local $_ = $AUTOLOAD;
# Remove the package name from the command.
s/.*:://;
# Get the command arguments.
my @Args = @_;
if (@Args)
{
for my $I (0..$#Args)
{
# Change all "!" to "/" (used for switches).
$Args[$I] =~ s/!/\//g;
# Change all "/" to "\".
$Args[$I] =~ s/\//\\/g;
}
print(STDERR "$_ @Args\n");
system($_,@Args);
}
else {print(STDERR "$_\n"); system($_);}
}
# Package return value.
return(1);
Dirk Bremer - Systems Programmer II - AMS Department - NISC
636-922-9158 ext. 652 fax 636-447-4471
<mailto:[EMAIL PROTECTED]>
----- Original Message -----
From: "William Hertzing" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 04, 2001 4:15 AM
Subject: system() function behaves different in build 630 from 629 behaviour
> I have a script that uses the system() function. The script was working
> fine with build 629. I used the script on NT 4.0 SP6, Win 2000, win 2000
> SP1 and SP2 machines.
>
> When build 630 came out, my script broke. I tracked it down to the
> system() function. In build 629, I had to put an apostrophe (") before
> and and after the command string being sent to the shell. In build 630,
> adding the apostrophe breaks the system() call. I have tested this with
> both win 2000 and NT OS, using builds 629 and 630, and adding the
> apostrophes around the command string and not adding the apostrophes.
>
> The release notes for build 630 don't mention this change. Can anyone
> shed any light on what happened?
>
> If I could determine the specific build number, I could add a test and
> code around the problem. I looked at the built-in variables, and at the
> Config module (using Config::myconfig). I could not find a variable that
> reported the build number of the Perl interpreter (I found version
> numbers, but no way to tell the difference between build 629 and build
> 630). Can anyone tell me how to tell the difference between the builds?
>
> Thanks in advance for your help!
> ˽Y㮊XXz zry+������皧 zry+ص Y ~rzؗ
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl