Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: Re: spaces in filenames

by MarkM (Curate)
on Feb 03, 2003 at 03:46 UTC ( [id://232129]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: spaces in filenames
in thread spaces in filenames

You are correct that "\W" produces a different result from /\W/ as a first argument to split(). You are not correct in concluding that this means split() is assuming that a quoted string is a literal. Examples:

$ perl -e '$t = "abc,def"; @t = split("\\W", $t); print "@t\n"' abc def
$ perl -e '$a = "abc,def"; @a = split("[^a-z]", $a); print "@a\n"' abc def

In both cases, the string is being interpretted as a regular expression. As a string, a different set of interpolation rules apply.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-23 15:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found