#!/usr/bin/perl # Copyright 2004, Michael Allan use strict; use warnings; no warnings 'once'; =pod =head1 NAME is-text - test whether a file contains text =head1 DESCRIPTION Tests whether a file contains text. Exits with status 0 for true; 1 for false. =cut my $file = shift; defined $file or die; my $true = 0; # for 'test' purposes my $false = 1; my $result; if( -f $file && -T $file ) { $result = $true; } else { $result = $false; } exit $result; __END__ =pod =head1 AUTHOR Michael Allan =cut