in reply to Re^2: Return Question in Subroutine
in thread Return Question in Subroutine
You can probably clean up your cleanup code a little like this:
use strict; use warnings; my $str = "<some> text with';*()/? nasty chars. scripted should be ok, + but not script"; print cleanup($str); sub cleanup { $_[0]=~tr|<>;()"'?/*||d; $_[0]=~s/\bscript\b//g; return $_[0]; }
Prints:
some text with nasty chars. scripted should be ok, but not
|
|---|