Uri Guttman wrote:
"sw" == shawn wilson<ag4ve...@gmail.com>  writes:

   sw>  my $data;

   sw>  while ( my $line =<FILE>  ) {

   sw>          chomp ($line);
   sw>          my @word = split / /, $line;


   sw>          my $count = 0;
   sw>          foreach my $aword ( @word ) {
   sw>                  $aword =~ tr/^[\-a-zA-Z]//;

that isn't a good tr call/ it will not delete [] chars. those are not
metachars in tr. tr is NOT a regex!

It will not delete *any* characters. It will replace '^' with '^' and '[' with '[' and '-' with '-' and 'a' through 'z' with 'a' through 'z' and 'A' through 'Z' with 'A' through 'Z' and ']' with ']'.



John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction.                   -- Albert Einstein

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to