Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Reading entire file.

by cLive ;-) (Prior)
on May 04, 2001 at 13:43 UTC ( #77911=note: print w/replies, xml ) Need Help??


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 ;-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2021-11-28 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?