> Dan Muey wrote: > > > > Say I have a variable $data that has file contents in it. > > Is there a way to tell if it is binary or ascii? > > > > if($data =~ ???) { print "It is binary weeee"; } > > elsif($data =~ ???) { print "It is ascii woo hoo"; } > > else { print "I do not know what it is, doh!"; } > > > if ( $data =~ /[^[:ascii:]]/ ) { > print "\$data contains non-ASCII characters\n"; > } > else { > print "\$data contains only ASCII characters\n"; > }
Interesting John. Anyone know where is the [:ascii:] class/group/whatever you call it documented? I'd like to get more info on it to compare the other method mentioned earlier in the thread, {which works good on all my tests so far) Thanks Dan > > > > John -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]