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

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to