in reply to Re: Re: Reading entire file.
in thread Reading entire file.

Hmmm, maybe this will make sense? (adding the braces you missed (typo :)
my $tool_number = 1; # (say - perhaps you're looping through them, hen +ce... $tool_number = sprintf(%02d,$tool_number); # add leading zero, if need +ed while (<PD_FILE>){ if (/^Tool$tool_number/) { $continue = 1; } if (/^Tool/ && !(/^Tool$tool_number/)) { $continue = 0; } if ($continue){ print $_; } }

FYI - ^ matches the beginning of a string (line in this case).

cLive ;-)