Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: using split

by girarde (Hermit)
on Jun 04, 2007 at 21:22 UTC ( #619233=note: print w/replies, xml ) Need Help??


in reply to using split

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^2: using split
by imp (Priest) on Jun 04, 2007 at 21:30 UTC
    There is no difference in the two lines you listed.
    perl -MO=Deparse -e "split('|', 'ab|c');" split(/|/, 'ab|c', 0); -e syntax OK

      There is one subtle difference between using '...' and /.../ as regex delimiters. The latter interpolates where the former does not. That does not affect the examples in this thread though.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        And the difference between "..." and /.../ is that "..." unescapes too much.

        For example,
        "\d" is the same as /d/.
        If you want /\d/, the equivalent would be "\\d".

        I always use /.../ or qr/.../ to avoid confusion.

    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://619233]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2021-03-05 16:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (112 votes). Check out past polls.

    Notices?