#!/usr/bin/env perl
# mtime -- list modification time of all given files

sub usage {
	print "Usage: mtime [-q] <files>\n";
}

if (!@ARGV) {
	warn "error: missing filenames\n";
	usage();
	exit 2;
}
elsif ($ARGV[0] eq "--help") {
	usage();
	exit 0;
}
elsif ($ARGV[0] eq "-q") {
	shift @ARGV;
	print for map {((stat $_)[9] // "?\t"), "\n"} @ARGV;
}
else {
	print for map {((stat $_)[9] // "?\t"), "\t", $_, "\n"} @ARGV;
}
