Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Triangle Numbers Revisited

by Limbic~Region (Chancellor)
on Oct 14, 2004 at 02:34 UTC ( #399080=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ cat gen_targets.pl
    #!/usr/bin/perl
    ...
    my $file = $ARGV[0] || 'targets.txt';
    open (OUTPUT, '>', $file) or die "Unable to open $file for writing : $
    +!";
    print OUTPUT int rand 5_000_000, "\n" for 1 .. 5_000;
    
  2. or download this
    my $file = $ARGV[0] || 'targets.txt';
    open (INPUT, '<', $file) or die "Unable to open $file for reading : $!
    +";
    ...
        chomp;
        get_three( $_ );  # used your sub/calling convention
    }
    
  3. or download this
    $ time ./lr.pl
    
    ...
    real    1m0.791s
    user    1m0.326s
    sys     0m0.220s
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://399080]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-28 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls