Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Stop at each elsif? Only if you've set breakpoints at each one, I think... but

I suspect your first or (at Ln 7) is NOT doing what you expect. You have two alternatives at Ln 8 & 9 (where you start another or clause. Suggest you group your alternatives.

UPDATE: Miscounted paren pairs. My bad.

Warning: these observations arise from a top of head scan of your submission... but can't be taken too seriously, since we have no sample of input ... and can't (from what you've shown) be sure we know what $ThisLine may contain.

Lastly, point of personal preference (only? perhaps?): rather than constucting regexen with fixed dots (for any byte), it may make the code clearer to use quantifiers... and precompiled regexen:

my $re_start = qr/../; #match string begining with two of anything (0 +or more times each!) # but still a potential problem: would match a +null string) # so, perhaps, qr/.{1).(1)/ which will not allow + a string # (preceding the comma in your initial set of rege +xen) # with anything other than two instances of somethin +g # or another

untested, but HTH.

UPDATE: demonstrates the need to test before posting...and the consequences of failing to do so. My bad again


Spirit of the Monastery but ++$anecdote ne $data


In reply to Re: If statement seems to ignore elsif and skips to else by ww
in thread If statement seems to ignore elsif and skips to else by edgreenberg

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 imbibing at the Monastery: (3)
As of 2024-03-29 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found