Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Adding command line arguments.

by ariels (Curate)
on Jun 06, 2002 at 14:41 UTC ( #172222=note: print w/replies, xml ) Need Help??


in reply to Adding command line arguments.

Easy. Dunno why it matters how many command-line arguments there are. But hey! -- We all have to make some effort...
#!/usr/local/bin/perl use strict; use warnings; use integer; my $even = -1<<31; do { print "$even\n"; $even += 2; } while ($even != -1<<31);

NOTES

  1. Untested code.
  2. You might run out of paper if you print the output.
  3. Only works for 32-bit 2's complement machines.
  4. Even there, it doesn't really print all the even numbers.
  5. 1's complement machines (does Perl run on any?) will print odd numbers too
  6. Doesn't test the generated numbers for evenness.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://172222]
help
Chatterbox?
[marto]: which part don't you know how to do?
[marto]: oh
[Corion]: arunks: Maybe How do I make password prompts not echo back the user?? Or simply read it from STDIN.
[Corion]: arunks: Please do not ask us to write your program. You have to write your program yourself.

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2017-01-20 14:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.