Tan Rui wrote:
> here is my perl script:
>  
> $a = "aaa bbb ccc ddd ttt";
> $a =~ tr/a-z/ttt/d;
> print "$a\n";
>  
> But I cannot understant why the result is "ttt ttt ttt". Can someone
> explain it to me? thanks.

a, b and c are replaced by the first, second and third t, resp.

The rest (d ... z) are deleted - per delete criteria:

    d   Delete found but unreplaced characters.

-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (Free site for Perl/Lakers)


_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to