Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Had it been written, for example, with a foreach loop, and terminated after each successful full pass through the elements of @strings, a user would then be obligated to re-run the script (and, hence, re-read the text file) to attempt another pattern.

Yes, this is almost a tautology: if it terminates after processing @strings once, then it will terminate and you would have to run the whole script once again. The point is that it caches file info into @strings and processes the latter each time for each supplied pattern.

Regarding the "Llama book", it is actually "Learning Perl" by Randal L. Schwartz, et al, and published by O'Reilly Media, Inc. I have been trying to learn Perl, using this book for just 2 months, now, and I don't profess to know all of the information, therein. Do you, by chance, have a different text you would recommend for the purpose of learning Perl basics? If so, I would be willing to try it also.

I know what the "Llama book" is, but I mean: I don't have it handy and I only had it a few times in my all life in my hands. I don't have any good recommendation because basically most of what I know stems from a week's reading of the first few chapters of a very old Llama (Perl 4 times I suspect) and then from clpmisc.


In reply to Re^5: Don't re-read file for each new pattern... by blazar
in thread Don't re-read file for each new pattern... by cgmd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-24 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found