Next | Trivial Utilities | 109 |
Skip some broken files
FILE: for my $file (@ARGV) { unless (-e $file) { warn "No such file: $file; skipping\n"; next; } my $type = defined($opt_t) ? $opt_t : file_type($file);
Also decompress compressed files
while (is_compressed($type)) { warn "File is compressed\n" if $opt_v; $file = convert($file, 'uncompressed', decompress_command($type)); next FILE unless defined $file; $type = file_type($file); }
This could be used for MIME-decoding also
Next | Menu | Copyright © 2012 M. J. Dominus |