Re: escape character in regex

[email protected] (Henrik Park)
Newsgroups 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/
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.