Re: escape character in regex

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

for my this code:

my $delimiter = '$';
my $str = 'hello$world$buddy';
my @li = split/$delimiter/,$str;
print "@li","\n";

How can I make it work correctly?

Thanks

John W. Krahn wrote:
> "/" is NOT a special charater in a regular expression.  It is just that 
> in Perl the default delimiter for some operators is "/" (i.e. m//, s///, 
> tr///, etc.).

-- 
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.