David Zhuo wrote: > On Friday 07 March 2003 13:26, Madhu Reddy wrote: >> Hi, >> I want to check for some ASCII chars in perl like following "C" >> code.. >> >> How to do this in Perl ? >> follwing will work in perl ? >> >> for($i=0;$i < length;$i++) { >> if (($_[$i] < 32) || (($_[$i] > 126)) { >> print "Char is non printable char\n"; >> } >> } >> > > i don't thing the above will work. try: > > for(split(//)){ > if(ord < 32 || ord > 126){ > print "Char is non printable char\n"; > }else{ > print "$_\n"; > } > } > > david
I got it to run but I had to add () to each ord otherwise it would not run. Wags ;) ********************************************************** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. **************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]