Skip to content

Instantly share code, notes, and snippets.

@xaicron
Created August 13, 2012 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xaicron/3338915 to your computer and use it in GitHub Desktop.
Save xaicron/3338915 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use File::Zglob;
use Getopt::Long;
use Pod::Usage;
our $VERSION=$File::Zglob::VERSION;
GetOptions (
'h|help' => \my $help,
'v|version' => \my $version,
) or pod2usage(2);
$version and do { print "zglob: $VERSION\n"; exit 0 };
pod2usage(1) if $help;
pod2usage(2) unless @ARGV;
local $\ = "\n";
for (@ARGV) {
print $_ and next if -f $_;
print $_ for zglob($_);
}
__END__
=head1 NAME
zglob - extended globs
=head1 SYNOPSIS
zglob ([options] --) pattern
Options:
-help -h brief help message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment