#!/usr/bin/perl use strict; use warnings; my $fullelementpath = shift @ARGV; if ( -T $fullelementpath) { print "This is a text file\n"; } else { print "This is not a text file\n"; } if ( -B $fullelementpath ) { print "This is a binary file\n"; } else { print "This is not a binary file\n"; }