#!/usr/bin/perl

use 5.034;

say "LIST OF PERL SCRIPTS IN CURRENT DIRECTORY";
say "-----------------------------------------";
my @DIR = glob(".* *"); 
my $c;
for my $file (@DIR){
    next if $file eq '.' || $file eq '..';
    next if ($file =~ /\~/);
    next unless (-T $file);     # -T is heuristic for signaling ASCII and UTF-8
    my $first = `head \-n1 \"$file\"`;  # lazy version
#    next if ($first =~ /\sno\s/i);
    if ($first =~ /perl/){
	++$c;
	say "$c) $file";
    }
}

exit 3;




