Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by swiftone (478) on 2002.06.05 15:39 (#9213)
    Okay, so Page 9 [perl.com] says that // is no longer a m//, but instead a short form of rx//.

    It also talks about delayed evaluation of the pattern.

    So, given that almost all the example patterns use /foo/ and not m/foo/, what is happening, and when is it happening?

    • So, given that almost all the example patterns use /foo/ and not m/foo/, what is
      happening, and when is it happening?


      /.../ now *always* returns a regex object.
      But a regex object in a void, boolean, string, numeric, or =~ context
      immediately matches against the current topic.

      So you get:

          /pattern/;                 # void context    -> automatch
          if /pattern/ {...}         # boolean context -> au