C
cibalo
Hello,
I can print the postmatch variable with a perl script as follows:
#!/usr/bin/perl -w
$str = "abcdefghi"; $str =~ /def/; print "$`:$&:$'\n";
For perl one-liner, I can print without the $' as follows:
$ perl -e '$str = "abcdefghi"; $str =~ /def/; print "$`:$&:\n";'
abc:def:
But, I cannot print with $' as follows:
$ perl -e '$str = "abcdefghi"; $str =~ /def/; print "$`:$&:$'\n";'
Can you please let me know what I'm missing?
Thank you very much in advance!!!
Best Regards,
cibalo
I can print the postmatch variable with a perl script as follows:
#!/usr/bin/perl -w
$str = "abcdefghi"; $str =~ /def/; print "$`:$&:$'\n";
For perl one-liner, I can print without the $' as follows:
$ perl -e '$str = "abcdefghi"; $str =~ /def/; print "$`:$&:\n";'
abc:def:
But, I cannot print with $' as follows:
$ perl -e '$str = "abcdefghi"; $str =~ /def/; print "$`:$&:$'\n";'
Can you please let me know what I'm missing?
Thank you very much in advance!!!
Best Regards,
cibalo