Don't ask to ask, just ask | |
PerlMonks |
Re: How can I tell if a string contains binary data or plain-old text?by ambrus (Abbot) |
on Oct 31, 2003 at 11:19 UTC ( [id://303529]=note: print w/replies, xml ) | Need Help?? |
Why does this one not work (on perl 5.8.0)? It should, I think, but -T always gives undef.
open A,"<",\$a or die 1;print +(-T(A) ? "text" : "bin"), $/;close A;'
In Section
Seekers of Perl Wisdom
|
|