William wrote:
Hello, what is the syntax for having constant in regular expression ? Such as
use constant (NL => '\n');
#check if there is newline in the text
my $txt = "foo \n bar";
if($txt =~ m/
# ???
/x)
{
}
Constants cannot be interpolated into strings like var
William wrote:
> Hello, what is the syntax for having constant in regular expression ? Such as
>
> use constant (NL => '\n');
You know this will create NL as a two-character string - backslash and 'N' -
right? You need double quotes if you want the "\n"
Hello, what is the syntax for having constant in regular expression ? Such as
use constant (NL => '\n');
#check if there is newline in the text
my $txt = "foo \n bar";
if($txt =~ m/
# ???
/x)
{
}
Thanks.
Send instant messages to your online friends http://uk.mes