For when we don't want the the passthru behaviour of BashSh (and ZshZh when `setopt +o nomatch` is set) but would rather it simply drop failed matches: ```plaintext #!/usr/bin/env perl use strict; for(@ARGV) { if(stat) { print "$_\n"; } } ``` example use case ```plaintext filterstat *.mkv *.webm *.mp4 # will return a list of files matching these wildcards ``` whereas with e.g. `bash` and `ls` ```plaintext ls *.mkv *.webm *.mp4 ``` will, if there are no `.mp4` files, complain with ```plaintext ls: cannot access '*.mp4': No such file or directory ``` For seeing of one of a list of filenames exists (no arguments means fail) ```plaintext #!/usr/bin/env perl use strict; for(@ARGV) { if(stat) { exit(0); } } exit(1); ``` For seeing if all of a list of filenames exist (no arguments means success) ```plaintext #!/usr/bin/env perl use strict; for(@ARGV) { if(!stat) { exit(1); } } exit(0); ``` For finding the newest file of those listed ```plaintext #!/usr/bin/env perl use strict; my($newest,$newest_mtime); $newest_mtime = -1; $newest = ""; for(@ARGV) { if(my @stat = stat) { my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = @stat; if($mtime > $newest_mtime) { $newest = $_; $newest_mtime = $mtime; } } } if($newest) { print "$newest\n"; } else { die("No matching files"); } ``` Example usage: ```plaintext newest *.mp4 ```