# This one works:
my $lnbk = "\r\n";
$var =~ m{\G(.*?)$lnbk}gc
# This one fails:
my $null = chr(0);
$var =~ m{\G(.*?)$null}gc
Why won't the regex work with a Null character? But this does work...
s/(.*)$null//g
I don't want to use the replacement, but "walk" the variable as I have been...
I'm trying to "walk" a string, and fill $1/$2 with a string and a character which follows it. Heres an example...
my $istr = "TESTING();";
pos $istr = 0;
while (pos $istr < length $istr) {
if ( $istr =~ m{
\G (.*) ([ (); ])
}gcxms ) {
print("1: $1; 2...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.