Re: @ARGV array is always empty

2003-07-27 Thread Gerry Green



On your laptop with XP Pro:

 From the Folder Options - 
File types dialog:

 Locate and select the entry for 
PL file

 Click the "advanced" button in 
the details for extension .PL pane at the bottom

 Select the "open" action from 
the list, and then click the the "edit" button

 What do you have under 
"Application used to perform this action"?

 My XP Pro has this:

  
"C:\Perl\bin\perl.exe" "%1" %*

 

 

  - Original Message - 
  From: 
  Larry Watson 
  To: [EMAIL PROTECTED] 
  
  Sent: Sunday, July 27, 2003 10:08 
AM
  Subject: @ARGV array is always 
empty
  
  Hi:
  
  On my Windows XP Professional laptop, when 
  running perl programs from the command, no command line arguments are placed 
  into @ARGV. Whereas, no problem on my Windows XP Home Edition 
  desktop. ActiveState support did not know what the problem is. 
  Here are the details:
  
  I downloaded ActivePerl-5.8.0.806-MSWin32-x86.msi 
  and installed on a Thinkpad T23 with XP Professional(SP1). I have the 
  same problem with ActivePerl-5.6.1.635-MSWin32-x86.msi on this machine. 
  Both versions work as expected on my eMachines T2082 desktop.
  
  
  If I run this program, argvProblem.pl - 
  
  
  #!perl
  printf "The number of arguments is 
  %d\n",$#ARGV;exit;
  
  on eMachines XP HE - 
  
  c:\solar\tests\argvProblem.pl 1 2 
  3
  The number of arguments is 2
  
  on T23 XP Pro
  
  
  c:\solar\tests\argvProblem.pl 1 2 
  3
  The number of arguments is -1.
  
  If I run
  
  
  c:\solar\tests\perl argvProblem.pl 1 2 
  3
  The number of arguments is 2.
  
  and it works fine!!
  
  Any ideas? From doing "perl -v", I see they are both 5.8.0, build 806. 
  Compiled C programs can see their arguments on the XP Pro machine. The 
  Folder Options File-Type associations seem the same on both machines. 
  The registries appear to be the same. Perl used to work fine on the T23 
  but I had a disk failure, restored with the recovery CD, installed SP1, and 
  then the problem. It also failed to work before I installed 
  SP1.
  
  Thanks,
  Larry Watson
  
  
  


Re: Perldoc problem was Re: regular expression on military time

2003-07-27 Thread Gerry Green
Just a quick note:

- Original Message - 
From: John [EMAIL PROTECTED]
To: Ted S. [EMAIL PROTECTED]
Cc: Perl-Win32-Users [EMAIL PROTECTED]
Sent: Sunday, July 27, 2003 3:07 AM
Subject: Perldoc problem was Re: regular expression on military time

clip
 If it does work, invoke 'path c:\perl\bin;%path%' at the prompt to
 change the path variable for the current console session then 'cd' to
 another directory and test again. It should work.

If I remember right, this %path% syntax from the command prompt doesn't work
under command.com.   To change the path like that you'll need to repeat the
current value and include the new entry on the end:

path c:\windows;c:\windows\command;c:\perl\bin



 If this is the answer, then you need to put 'c:\perl\bin' in your path,
 you probably should anyway.

 HTH
 John

 -- 
 Regards
John McMahon  (mailto:[EMAIL PROTECTED])

 Tired of Outlook Express/Outlook's messy quoting?
 Check out OE-Quotefix/Outlook-Quotefix via http://flash.to/oblivion



 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Reverse of Chomp

2003-06-13 Thread Gerry Green

- Original Message - 
From: Eric Amick [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 13, 2003 9:15 PM
Subject: Re: Reverse of Chomp


 On Fri, 13 Jun 2003 13:49:45 +, you wrote:

 Is there a way to reverse chop/chomp
 
 I'm reading STDIN into an array, then
chomping off the last character of each of the
array elements.
 
 Now I'd like to write the array back out
   to STDOUT, but I want to put the \n's back between
   each of the lines.

 You've gotten a number of good suggestions.  Let me throw out another
 idea:

 $ = \n;
 print @array\n;

 No doubt someone will tell me how dreadful that is. :-)  I also agree
 with the poster who asked why you chomped in the first place; is there
 really no way to work with the data with the newlines present?

well if that's dreadful then this is at least as bad :-):

$,=\n;
print @array,;

In any case, I've run into lots of situations where I have to chomp the
input data such as file / directory names or hash keys (of course I don't
know how often I print back out the same thing I'm reading?).

I use the -l command line switch to get this behavior in simple one-liners
from the command line but that won't help here...


 -- 
 Eric Amick
 Columbia, MD

 ___
 Perl-Win32-Users mailing list
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs