develooper Front page | perl.perl5.porters | Postings from January 2004

(?{ }) inside split() regex

Thread Next
Jeff 'japhy' Pinyan
January 31, 2004 19:28
(?{ }) inside split() regex
Message ID:
This program:

  @parts = split m{
  }x, q{A "B C" D"E F" G};

  print "<$_>\n" for @parts;

prints some weird values:

  <D"E F">

I'd have expected:

  <"B C">
  <D"E F">

It looks like $x's value is getting used somewhere that it shouldn't be.
I'm using 5.8.0; could someone verify this in more recent versions?

Jeff "japhy" Pinyan
RPI Acacia brother #734
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About