aboutsummaryrefslogtreecommitdiff
path: root/challenge-028/dave-cross/perl5/ch-1.pl
blob: 5ae77b6180ea882c2f116619fdcf2f8480ca9477 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl

use strict;
use warnings;
use feature 'say';

use File::Basename;

@ARGV or die 'Usage: ', basename($0), " [list of filenames]\n";

for (@ARGV) {
  if (-T) {
    say "$_ looks like a text file";
  } elsif (-B) {
    say "$_ looks like a binary file";
  } else {
    say "$_ looks a bit weird";
  }
}