> >and hence the magic of using single quotes doesn't work as you'd expect.
> >It does get you out of other trouble though:
> >
> >s'$%@|'replacement';
> >
> >where you'd otherwise spend all day backslashing things.
> 
> All single quotes do is stop INTERPOLATION.  Interpolation is not the
> issue with regex metacharacters.

This is going off-topic... may I take the oppertunity to remind Jafhy
that he should recognise my name by now?  If being subscribed to the
[EMAIL PROTECTED] list makes me a beginner... then I should qualify
to ask for help - and boy do I have one >:)

  I am a co-author of Games::Golf, and in Games::Golf::TestSuite we
  find _unix_capture(), which combines the use of IO limits, exceptions,
  signals, sysread, syswrite, IO:Select and IPC::Open3.  All IO is
  asychronous, and we must reap our children.

  If anyone can stand code indented to the 10th level, and can solve
  challenging flow control issues then give me an email.  Since it's
  a tight loop, and the deepest levels need virtually all the upper
  level lexical variables there is no neat way to split it down.

And the point of that diversion is [1]:

  I know what INTERPOLATION is, and the difference and similarities
  between q, qq, qw, '' and "" etc.  Maybe going on to talk about
  s''' didn't follow on from the topic very well.  Japhy, assume I
  know a lot more than I seem to let on!  :-)

Now, this:

  "and hence the magic of using single quotes doesn't work as you'd expect."

Really meant:

  I expected the behaviour of split to change when given a string.  It seems
  far more reasonable to consider it a string unless told it is a regex,
  easily done with //.  Personally, I see this as a carry over from earlier
  design mistakes and laziness in getting it fixed.  That's why I mentioned
  the Perl 6 RFC.

The RPC also mentions:

2. Empty trailing fields are currently suppressed (although a -1 as the third
   argument disables this).

Which means that:

  @line = split /:/, "one:two:three::"

gives you:

  @line = ('one', 'two', 'three')

and not:

  @line = ('one', 'two', 'three', '', '')

3. When not in list context, split currently splits into @_.

Isn't this something I've met already today :P

4. split ?pat? in any context currently splits into @_.

Few people use ?? anyway.

5. split ' ' (but not split / /) currently splits on whitespace,
   but also removes leading empty fields.

This could cause some VERY hard to spot errors for maintainers who
see both // and '' used regularly.

Jonathan Paton

[1] It's also an attempt to flog the problem onto someone else!

=====
---------------BEGIN GEEKCODE BLOCK-----------v3.12
GCS/E d+ s+: a20 C++(+++)>$ UHL++>+++ P+++ L++>++++
E- W++(-) N+ o? K- w--- !O M-- !V PS-- PE++ Y++ PGP
t@ 5-- X-- R- tv- b  DI+ D- G++ e h! !r--->++ !y---
----------------END GEEKCODE BLOCK-----------------
JAPH: print`perldoc perlembed`=~/(Ju.*)/,"\n"

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to