escape character in regex

Henrik Park <[email protected]>
Newsgroups gmane.comp.lang.perl.beginners
Message-ID <[email protected]>
Hello

I know "/" is a special character for regex, which should be escaped.

But if I put "/" in a variable and use the variable in regex, then it 
doesn't need the explicit escape. Like this one:

$ perl -le '$delimiter="/"; $str="hello/world/buddy"; 
@list=split/$delimiter/,$str;print "@list"'
hello world buddy


Am I right? thank you.


-- 
Simple Mail
https://simplemail.co.in/

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.