command line args not working correctly 
Author Message
 command line args not working correctly

Running this script with WinNT 4.0, MKS perl AND Solaris perl, when I call my
script like this:
perl loop.pl 4
it works OK, loops 4 times but when I call my script:
perl loop.pl 10
it only does the loop once!

This is the script

 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://www.*-*-*.com/ ,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts



Tue, 07 Oct 2003 06:38:38 GMT  
 command line args not working correctly

Quote:

> Running this script with WinNT 4.0, MKS perl AND Solaris perl, when I call my
> script like this:
> perl loop.pl 4
> it works OK, loops 4 times but when I call my script:
> perl loop.pl 10
> it only does the loop once!
> This is the script

[here was the OP's signature]

I see no script. I'd be very surprised to see that handing
perl a null script does any looping.

Without seeing your script, I would say you might have
just the first character of your command line options
assigned to your loop variable. You want the whole first
argument. Beyond this, my Psi::ESP module isn't giving
me any useful output.

Chris

--
Christopher E. Stith
It's not the U in UBE that pisses people off. It's the B.
  -- Martien Verbruggen in clp.misc



Fri, 10 Oct 2003 02:11:31 GMT  
 command line args not working correctly

Quote:


>> Running this script with WinNT 4.0, MKS perl AND Solaris perl, when I call
my
>> script like this:
>> perl loop.pl 4
>> it works OK, loops 4 times but when I call my script:
>> perl loop.pl 10
>> it only does the loop once!

>> This is the script

>[here was the OP's signature]

>I see no script. I'd be very surprised to see that handing
>perl a null script does any looping.

>Without seeing your script, I would say you might have
>just the first character of your command line options
>assigned to your loop variable. You want the whole first
>argument. Beyond this, my Psi::ESP module isn't giving
>me any useful output.

>Chris

>--
>Christopher E. Stith
>It's not the U in UBE that pisses people off. It's the B.
>  -- Martien Verbruggen in clp.misc

Oops!!  Fat fingered it.

Well I figured it out anyway, I was using a string comparison op to compare
numeric args.  When I changed the comparison operator to the equivalent
numerical operator (<=) the loop worked OK.
Thanks anyway,

Tom

 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts



Fri, 10 Oct 2003 23:02:44 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. -F works on command line but not on #!perl -paF line

2. system call works in command line mode but not from web

3. System call works at command line but not within CGI

4. Blat works from command line but not in CGI script

5. work on command line and not via browser?

6. perl program works on command line, but not when run through www server

7. Hiding command-line args?

8. command-line args style flags from a file

9. Debug .pl Syntax of command line args ?

10. Case-insensitive Command Line Args

11. HELP: How to program command line args

12. perl command line args

 

 
Powered by phpBB® Forum Software