in reply to Parse text file for number

Can you provide a (small) example of the text file you need to read in? Assuming it's one-value-per-line, it should just be a case of doing something like ...
my $number; open FILE, "<", "/path/to/your/file" or die; while ($number = <FILE>) { # read in a line of the file chomp $number; # remove the newline # do something with each number } close FILE;
If it's more complicated than that (multiple numbers per line), then you can use a split on each line you read from the file to extract numbers one at a time.

Hope that helps ..
-- Foxcub
#include www.liquidfusion.org.uk

Replies are listed 'Best First'.
Re: (2) Parse text file for number
by woofoz (Initiate) on May 20, 2003 at 10:43 UTC
    Thanks. Thats exactly what I was after. Thanks to all the replies.