I have the following piece of code,
#!/usr/bin/perl
$txt = "xxx yys";
$txt =~ s/\b/\!/g;
print "$txt\n";
basically I want to substitute at a word boundary a '!' character but not on the first word of the string or line.
the output that I am currently getting is
!xxx! !yys!
I want it to look something like this.
xxx! !yys!
Ideally I want it too be something like xxx!yys.
But I would highly appreciate if someone could give a hint of at least ignoring the first word boundary.
thanks
bcd
#!/usr/bin/perl
$txt = "xxx yys";
$txt =~ s/\b/\!/g;
print "$txt\n";
basically I want to substitute at a word boundary a '!' character but not on the first word of the string or line.
the output that I am currently getting is
!xxx! !yys!
I want it to look something like this.
xxx! !yys!
Ideally I want it too be something like xxx!yys.
But I would highly appreciate if someone could give a hint of at least ignoring the first word boundary.
thanks
bcd