Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I don't get what you mean here. qw/ac qw/ and qw/ca qw/ are treated identically by the flip-flop operator:

Yes, I know that. Also the description on perldoc seems clear if you already know what to expect. My whole point is that the result of perl -we'my @l = qw/ca qw/; for (@l) { print if /a/../c/ }' is not logical.

Suppose that I want to process html file where I have tags like this:

<tag> a </tag><tag> b </tag><tag> c
If my flip-flop condition is /<tag>/../<\/tag>/ it would print
<tag> a </tag><tag> </tag><tag>
which is not what you want. With three dots you get
<tag> a </tag><tag> </tag><tag> c </tag>
still not good :(

Basically, what I originally (and incorrectly as I see now) expected from this operator was that it processes each element char by char (as a real flip-flop) and not as a whole. Of course, in my html example I can first format the file but that is another story.

BTW: I am new here and have a question about writeup formatting. How do you cite someone's text if it contains a code? Copy-pasting and than manually putting those code tags back (which I did) seems pretty tedious.


In reply to Re^4: Scalar range operator again by kejv2
in thread Scalar range operator again by kejv2

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 having a coffee break in the Monastery: (2)
As of 2024-04-26 01:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found