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

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Flip-flop, maybe?
perl -le '@full = ( 0..100 ); for ( @full ) { print STDOUT "$_: LIGHTS ON" if /20/ .. /30/; print STDOUT "$_: LIGHTS OFF" if /60/ .. /70/; } ' __output__ 20: LIGHTS ON 21: LIGHTS ON 22: LIGHTS ON 23: LIGHTS ON 24: LIGHTS ON 25: LIGHTS ON 26: LIGHTS ON 27: LIGHTS ON 28: LIGHTS ON 29: LIGHTS ON 30: LIGHTS ON 60: LIGHTS OFF 61: LIGHTS OFF 62: LIGHTS OFF 63: LIGHTS OFF 64: LIGHTS OFF 65: LIGHTS OFF 66: LIGHTS OFF 67: LIGHTS OFF 68: LIGHTS OFF 69: LIGHTS OFF 70: LIGHTS OFF
Though I do not know the proper syntax with variable assignment, so cannot turn the durn lights off! So, it half works....
perl -le '@full = ( 0..20 ); for $ea ( @full ) { print STDOUT "$ea: LIGHTS ON" if $ea =~ /6/ .. /10/; print STDOUT "$ea: LIGHTS OFF" if $ea =~ /15/ .. /20/; } ' __output__ 6: LIGHTS ON 7: LIGHTS ON 8: LIGHTS ON 9: LIGHTS ON 10: LIGHTS ON 11: LIGHTS ON 12: LIGHTS ON 13: LIGHTS ON 14: LIGHTS ON 15: LIGHTS ON 15: LIGHTS OFF 16: LIGHTS ON 16: LIGHTS OFF 17: LIGHTS ON 17: LIGHTS OFF 18: LIGHTS ON 18: LIGHTS OFF 19: LIGHTS ON 19: LIGHTS OFF 20: LIGHTS ON 20: LIGHTS OFF
Hope it helps!

In reply to Re: Match Numeric Range by dbuckhal
in thread Match Numeric Range by PilotinControl

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 or How to display code and escape characters are good places to start.
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2022-05-18 07:22 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (68 votes). Check out past polls.