Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!caen!uflorida!gatech!prism!prism.gatech.EDU!tad From: tad@prism.gatech.EDU (Tad K. Mannes) Newsgroups: comp.lang.perl Subject: tr/y not deleting chars? Message-ID: <23829@hydra.gatech.EDU> Date: 8 Mar 91 01:00:13 GMT Sender: tad@prism.gatech.EDU Organization: Office of Information Technologies, Georgia Tech Lines: 19 I have the following simple script which does not do what I expect it to do.... I want `$pre' to contain the prefix (`TEST') and `$num' to contain the numeric portion (`012'). The output follows the script. Am I doing something wrong or is there really something wrong with `tr'? I've gotten around the problem using the `s' command so I don't need help with that.... --Tad ----------------------------Heres the Script-------------------------- #!/hydra2/tad/bin/hydra/perl printf("%s\n",$]); $test = "TEST012"; ($pre = $test) =~ y/0-9//d; ($num = $test) =~ y/A-Z//d; printf("prefix=%s number=%s\n",$pre,$num); ----------------------------Heres the Output-------------------------- $Header: perly.c,v 3.0.1.10 91/01/11 18:22:48 lwall Locked $ Patch level: 44 prefix=TEST012 number=TEST012