Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
OK That's really neat, I wasn't thinking at it like that. I kind of thought that's what you wanted me to do but wasn't sure, I see now though. However, one final problem, OK, I don't know what any of the lines will be so how do I tell the script that if it matches one of the numbers to print out the correct value from the hash.

You're telling it to print out Miami for $cells{1} but I don't know what the cell site line is going to be it might be 503E so I'd have to tell it somehow to print out the name when you find the number in the record block and in the hash so it knows what key/value to print. So my dilemma is really the printing and matching.

I can do both for a single match no problem. However I have to do 387 of them because there are 387 different Cell site names. So how can I tell the if statement this.

Well your regex will match any cell site line I know that, and if it's under the "if (lastHeading = "MSTerminating)" then it will only evaluate in an "MSTerminating" record block so that one is good and now the final problem which I haven't been able to solve. How do I tell the script to print out the line without knowing what number will be matched. In my current script I don't know why "$_" won't print, but that's the only way I can guess to print out something when you don't know what the answer will be but you know what you want to do with the answer.

The Brassmon_k

In reply to Re: Re: Re: Re: Can I match a range from an array? by brassmon_k
in thread Can I match a range from an array? by brassmon_k

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (4)
    As of 2017-11-19 07:39 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      In order to be able to say "I know Perl", you must have:













      Results (278 votes). Check out past polls.

      Notices?