Re: Can't open perl script -spi.bak

2002-03-24 Thread Issac Goldstand

Garth Winter Webb wrote:

On Fri, 2002-03-22 at 12:57, Robert Landrum wrote:

That's is very weird, because this code doesn't seem to work:

perl -e 'system(perl,  -e1) == 0 or die oops'

Actually, that's not all that weird.  Most shells take care of 
stripping out garbage before setting the argument list.  Since 
system(LIST) doesn't use the shell, it's passing perl the literal  
-e1 which perl won't recognize as a command line option (and 
correctly so in my opinion).


Actually this isn't standard behavior.  I can't think of a situation
where I would want to use system to concatanate a string for me rather
than interpreting the string as an argument and act accordingly.  If you
check 'perldoc -f system', this is exactly what system is supposed to do
when given a program name and a list of arguments, so it looks like
'systetm' may be buggy in the win32 version of perl

G

I think so too.  I,m no Perl guru, but I know from my personal 
experiance that it works fine under unix and cygwin, but I _always_ have 
had to manually do this under normal Win32 (I know, I know, I never 
submitted a patch...  I guess the reason was because I never [finally] 
compiled mod_perl for Win32 and had enough strength left to diff the 
Makefiles... :-(  )

  Issac





Can't open perl script -spi.bak

2002-03-22 Thread Pete Kelly

I am attempting to build mod_perl on NT.  I
successfully built Apache.  I have ActiveState 5.6
(Perl v5.6.1) installed.  I also have MS Visual Studio
6.0 installed.

I downloaded mod_perl-1.26.tar.gz from
http://perl.apache.org/dist

After unzipping the files I get the get the following
error:

C:\mod_perl-1.26perl Makefile.PL
Can't open perl script  -spi.bak : No such file or
directory
C:\Perl\bin\perl.exe  -spi.bak   -e  s/sub
mod_perl::hooks.*/sub mod_perl::hook
s { qw() }/ lib/mod_perl_hooks.pm failed

Any suggestions?

Thanks,

Pete

__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/



Re: Can't open perl script -spi.bak

2002-03-22 Thread Randy Kobes

On Fri, 22 Mar 2002, Pete Kelly wrote:

 I am attempting to build mod_perl on NT.  I
 successfully built Apache.  I have ActiveState 5.6
 (Perl v5.6.1) installed.  I also have MS Visual Studio
 6.0 installed.

 I downloaded mod_perl-1.26.tar.gz from
 http://perl.apache.org/dist

 After unzipping the files I get the get the following
 error:

 C:\mod_perl-1.26perl Makefile.PL
 Can't open perl script  -spi.bak : No such file or
 directory
 C:\Perl\bin\perl.exe  -spi.bak   -e  s/sub
 mod_perl::hooks.*/sub mod_perl::hook
 s { qw() }/ lib/mod_perl_hooks.pm failed

 Any suggestions?

After running 'perl Makefile.PL', and it dying at this point, is
there a file lib/mod_perl_hooks.pm? If not, try copying
lib/mod_perl_hooks.pm.PL to lib/mod_perl_hooks.pm and rerunning
'perl Makefile.PL'.

best regards,
randy kobes




Re: Can't open perl script -spi.bak

2002-03-22 Thread Stas Bekman

On Fri, 22 Mar 2002, Pete Kelly wrote:

 I am attempting to build mod_perl on NT.  I
 successfully built Apache.  I have ActiveState 5.6
 (Perl v5.6.1) installed.  I also have MS Visual Studio
 6.0 installed.
 
 I downloaded mod_perl-1.26.tar.gz from
 http://perl.apache.org/dist
 
 After unzipping the files I get the get the following
 error:
 
 C:\mod_perl-1.26perl Makefile.PL
 Can't open perl script  -spi.bak : No such file or
 directory
 C:\Perl\bin\perl.exe  -spi.bak   -e  s/sub
 mod_perl::hooks.*/sub mod_perl::hook
 s { qw() }/ lib/mod_perl_hooks.pm failed
 
 Any suggestions?

That's is very weird, because this code doesn't seem to work:

perl -e 'system(perl,  -e1) == 0 or die oops'

while this does:

perl -e 'system(perl, -e1) == 0 or die oops'

notice the leading space before  -e1

This patch should solve the problem.

Index: Makefile.PL
===
RCS file: /home/cvs/modperl/Makefile.PL,v
retrieving revision 1.196
diff -u -r1.196 Makefile.PL
--- Makefile.PL 9 Sep 2001 21:56:46 -   1.196
+++ Makefile.PL 22 Mar 2002 18:59:34 -
@@ -1101,7 +1101,7 @@
 cp lib/mod_perl_hooks.pm.PL, lib/mod_perl_hooks.pm; 
 
 if ($Is_Win32) {
-  my @args = ($^X, ' -spi.bak ', ' -e ', \s/sub mod_perl::hooks.*/sub 
mod_perl::hooks { qw($hooks) }/\, 'lib/mod_perl_hooks.pm');
+  my @args = ($^X, '-spi.bak ', ' -e ', \s/sub mod_perl::hooks.*/sub 
+mod_perl::hooks { qw($hooks) }/\, 'lib/mod_perl_hooks.pm');
   system(@args) == 0 or die @args failed\n;
 }
 iedit lib/mod_perl_hooks.pm, 

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org 
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com  
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: Can't open perl script -spi.bak

2002-03-22 Thread Robert Landrum

At 3:00 AM +0800 3/23/02, Stas Bekman wrote:
On Fri, 22 Mar 2002, Pete Kelly wrote:

 I am attempting to build mod_perl on NT.  I
 successfully built Apache.  I have ActiveState 5.6
 (Perl v5.6.1) installed.  I also have MS Visual Studio
 6.0 installed.

 I downloaded mod_perl-1.26.tar.gz from
 http://perl.apache.org/dist

 After unzipping the files I get the get the following
 error:

 C:\mod_perl-1.26perl Makefile.PL
 Can't open perl script  -spi.bak : No such file or
 directory
 C:\Perl\bin\perl.exe  -spi.bak   -e  s/sub
 mod_perl::hooks.*/sub mod_perl::hook
 s { qw() }/ lib/mod_perl_hooks.pm failed

 Any suggestions?

That's is very weird, because this code doesn't seem to work:

perl -e 'system(perl,  -e1) == 0 or die oops'

Actually, that's not all that weird.  Most shells take care of 
stripping out garbage before setting the argument list.  Since 
system(LIST) doesn't use the shell, it's passing perl the literal  
-e1 which perl won't recognize as a command line option (and 
correctly so in my opinion).

Rob

--
When I used a Mac, they laughed because I had no command prompt. When 
I used Linux, they laughed because I had no GUI.  



Re: Can't open perl script -spi.bak

2002-03-22 Thread Garth Winter Webb

On Fri, 2002-03-22 at 12:57, Robert Landrum wrote:

 That's is very weird, because this code doesn't seem to work:
 
 perl -e 'system(perl,  -e1) == 0 or die oops'
 
 Actually, that's not all that weird.  Most shells take care of 
 stripping out garbage before setting the argument list.  Since 
 system(LIST) doesn't use the shell, it's passing perl the literal  
 -e1 which perl won't recognize as a command line option (and 
 correctly so in my opinion).

Actually this isn't standard behavior.  I can't think of a situation
where I would want to use system to concatanate a string for me rather
than interpreting the string as an argument and act accordingly.  If you
check 'perldoc -f system', this is exactly what system is supposed to do
when given a program name and a list of arguments, so it looks like
'systetm' may be buggy in the win32 version of perl

G




Re: Can't open perl script -spi.bak

2002-03-22 Thread Randy Kobes

On 22 Mar 2002, Garth Winter Webb wrote:

 On Fri, 2002-03-22 at 12:57, Robert Landrum wrote:

  That's is very weird, because this code doesn't seem to work:
  
  perl -e 'system(perl,  -e1) == 0 or die oops'
 
  Actually, that's not all that weird.  Most shells take care of
  stripping out garbage before setting the argument list.  Since
  system(LIST) doesn't use the shell, it's passing perl the literal 
  -e1 which perl won't recognize as a command line option (and
  correctly so in my opinion).

 Actually this isn't standard behavior.  I can't think of a situation
 where I would want to use system to concatanate a string for me rather
 than interpreting the string as an argument and act accordingly.  If you
 check 'perldoc -f system', this is exactly what system is supposed to do
 when given a program name and a list of arguments, so it looks like
 'systetm' may be buggy in the win32 version of perl

This behaviour seems to be dependent on the Perl version and on
the Win32 shell used - the leading whitespace in front of the
1st argument after the program name in the system() call didn't
cause a problem on Windows 98 with ActivePerl 626 (which I used
to develop that part of the Makefile.PL), but it does cause a
problem on other Win32s with different ActivePerl versions.

best regards,
randy kobes




Re: Can't open perl script -spi.bak

2002-03-22 Thread Ryan Parr

On FreeBSD using Perl 5.6.1:

perl -e 'system(ls,-d,/);'-- This works, showing just /
perl -e 'system(ls, -d,/);'   -- This fails, showing ls:  -d: No
such file or directory

On FreeBSD using tcsh:

perldoc -f system-- This works
perldoc  -f system   -- The shell sees that it doesn't start with a -
and interperets it as a module to look up documentation for.

On Win2K using cmd:

dir C:\-- This works
dir  C:\   -- Again, same issue, The filename,
directory name, or volume label syntax is incorrect

I think that this is pretty standard behaviour, and will be seen in various
examples on multiple system. I also think that this is indeed desirable.

-- Ryan

- Original Message -
From: Randy Kobes [EMAIL PROTECTED]
To: Garth Winter Webb [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, March 22, 2002 5:43 PM
Subject: Re: Can't open perl script  -spi.bak


 On 22 Mar 2002, Garth Winter Webb wrote:

  On Fri, 2002-03-22 at 12:57, Robert Landrum wrote:
 
   That's is very weird, because this code doesn't seem to work:
   
   perl -e 'system(perl,  -e1) == 0 or die oops'
  
   Actually, that's not all that weird.  Most shells take care of
   stripping out garbage before setting the argument list.  Since
   system(LIST) doesn't use the shell, it's passing perl the literal 
   -e1 which perl won't recognize as a command line option (and
   correctly so in my opinion).
 
  Actually this isn't standard behavior.  I can't think of a situation
  where I would want to use system to concatanate a string for me rather
  than interpreting the string as an argument and act accordingly.  If you
  check 'perldoc -f system', this is exactly what system is supposed to do
  when given a program name and a list of arguments, so it looks like
  'systetm' may be buggy in the win32 version of perl

 This behaviour seems to be dependent on the Perl version and on
 the Win32 shell used - the leading whitespace in front of the
 1st argument after the program name in the system() call didn't
 cause a problem on Windows 98 with ActivePerl 626 (which I used
 to develop that part of the Makefile.PL), but it does cause a
 problem on other Win32s with different ActivePerl versions.

 best regards,
 randy kobes





[OT] Re: Can't open perl script -spi.bak

2002-03-22 Thread Ryan Parr

I also think that there me some mis-interpretation here of the system docs:

snip src=cmd:perldoc -f system
If there is more than one argument in LIST,
or if LIST is an array with more than one value, starts the program
given by the first element of the list with arguments given by the
rest of the list.  If there is only one scalar argument, the argument
is checked for shell metacharacters, and if there are any, the
entire argument is passed to the system's command shell for parsing
(this is C/bin/sh -c on Unix platforms, but varies on other
platforms).  If there are no shell metacharacters in the argument,
it is split into words and passed directly to Cexecvp, which is
more efficient.
/snip

Basically this says that :
system('ls','-d','/'); skips the shell
system('ls -d /'); is broken into words and skips the shell and
system('ls -d /*'); is passed to the shell as one big string.
system('ls  -d /*'); of course is the same

After reading this I wasn't sure how it would handle:
system('ls','-d','/*'); since it's more than one argument but with shell
metacharacters... I assumed it would go to the shell...

But I was wrong. It doesn't go to the shell for metacharacter interpretation
and it reports: ls: /*: No such file or directory

Therefore it's safe to say that no string concatenation is done, and it
makes sense that ' -el' is not a valid argument.

-- Ryan



- Original Message -
From: Ryan Parr [EMAIL PROTECTED]
To: Randy Kobes [EMAIL PROTECTED]; Garth Winter Webb
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, March 22, 2002 9:55 PM
Subject: Re: Can't open perl script  -spi.bak


 On FreeBSD using Perl 5.6.1:

 perl -e 'system(ls,-d,/);'-- This works, showing just /
 perl -e 'system(ls, -d,/);'   -- This fails, showing ls:  -d: No
 such file or directory

 On FreeBSD using tcsh:

 perldoc -f system-- This works
 perldoc  -f system   -- The shell sees that it doesn't start with
a -
 and interperets it as a module to look up documentation for.

 On Win2K using cmd:

 dir C:\-- This works
 dir  C:\   -- Again, same issue, The filename,
 directory name, or volume label syntax is incorrect

 I think that this is pretty standard behaviour, and will be seen in
various
 examples on multiple system. I also think that this is indeed desirable.

 -- Ryan

 - Original Message -
 From: Randy Kobes [EMAIL PROTECTED]
 To: Garth Winter Webb [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Friday, March 22, 2002 5:43 PM
 Subject: Re: Can't open perl script  -spi.bak


  On 22 Mar 2002, Garth Winter Webb wrote:
 
   On Fri, 2002-03-22 at 12:57, Robert Landrum wrote:
  
That's is very weird, because this code doesn't seem to work:

perl -e 'system(perl,  -e1) == 0 or die oops'
   
Actually, that's not all that weird.  Most shells take care of
stripping out garbage before setting the argument list.  Since
system(LIST) doesn't use the shell, it's passing perl the literal 
-e1 which perl won't recognize as a command line option (and
correctly so in my opinion).
  
   Actually this isn't standard behavior.  I can't think of a situation
   where I would want to use system to concatanate a string for me rather
   than interpreting the string as an argument and act accordingly.  If
you
   check 'perldoc -f system', this is exactly what system is supposed to
do
   when given a program name and a list of arguments, so it looks like
   'systetm' may be buggy in the win32 version of perl
 
  This behaviour seems to be dependent on the Perl version and on
  the Win32 shell used - the leading whitespace in front of the
  1st argument after the program name in the system() call didn't
  cause a problem on Windows 98 with ActivePerl 626 (which I used
  to develop that part of the Makefile.PL), but it does cause a
  problem on other Win32s with different ActivePerl versions.
 
  best regards,
  randy kobes