in reply to Re^2: Illegal character CTRLCHAR code 27
in thread Illegal character CTRLCHAR code 27
I think you're not testing your code properly:
$ perl -wE '$_="\01\02"; say length; tr/\000-\007//; say length' 2 2
Nothing removed. (Update: But replaced, see Re^5: Illegal character CTRLCHAR code 27) Still you're on the right track. For deleting with tr///, you need a trailing /d:
$ perl -wE '$_="\01\02"; say length; tr/\000-\007//d; say length' 2 0
Perl 6 - links to (nearly) everything that is Perl 6.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Illegal character CTRLCHAR code 27
by ultranerds (Hermit) on May 03, 2010 at 09:32 UTC | |
by FunkyMonk (Chancellor) on May 03, 2010 at 09:36 UTC | |
by ultranerds (Hermit) on May 03, 2010 at 10:36 UTC |
In Section
Seekers of Perl Wisdom