in reply to making a list and saving results
Hope this helps.#!/usr/bin/perl print "enter the START number: \n"; $number1 = <STDIN>; print "enter END number: \n"; $number2 = <STDIN>; @list=($number1..$number2); print "@list\n"; # if the file already exists. open OUTFILE, ">>/path/to/outfile" or die "Cannot open $!\n"; # if you want to create new file each time the program is executed. # open OUTFILE, ">/path/to/outfile" or die "Cannot open $!\n"; map { print OUTFILE $_, "\n"; } @list; close (OUTFILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: making a list and saving results
by surfbass (Initiate) on May 29, 2005 at 21:00 UTC | |
by newest_newbie (Acolyte) on May 29, 2005 at 21:23 UTC |