Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I think you can only use alternative delimiters if you use the complete form of the regex like:  $a =~ m AreA;

And then spaces aren't allowed anymore since 5.002 or somesuch. In fact in the above the space is REQUIRED between the "m" and the "AreA" portions or Ovid's bug kicks in and it doesn't parse correctly!

use strict; my $a = "freak"; my $b = "freakmAreA"; print "Yay!\n" if $a=~m AreA; print "Boo!\n" if $a=~mAreA; print "BUG!\n" if $b=~mAreA;

The above prints "Yay! and BUG!" in 5.6 under Linux. The "bare" word promotion is happening even when it shouldn't IMHO. Altho reading `perldoc perlop` leads me to believe that it should have not printed "Yay!" either:

If "/" is the delimiter then the initial m is optional. With the m you can use any pair of non- alphanumeric, non-whitespace characters as delimiters. This is particularly useful for matching path names that contain "/", to avoid LTS (leaning toothpick syndrome). If "?" is the delimiter, then the match-only-once rule of ?PATTERN? applies. If "'" is the delimiter, no interpolation is performed on the PATTERN.

... since really ...

$c =~ s eieioeio; #or $d =~ s ei$oeio$ioeieo;

... radiates pure evil. =)

--
$you = new YOU;
honk() if $you->love(perl)


In reply to RE: RE: RE: Odd... by extremely
in thread Odd... by Ovid

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 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? | Other CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2022-05-19 03:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (71 votes). Check out past polls.

    Notices?