From: Shawn Boyette Date: Wed, 14 Jan 2009 14:08:34 +0000 (+0000) Subject: initial checkin X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=072efb63a94c69c32a84c97b92d1d30441ab72f2 initial checkin --- diff --git a/extract_loadset b/extract_loadset new file mode 100644 index 0000000..9b0be3c --- /dev/null +++ b/extract_loadset @@ -0,0 +1,46 @@ +#!/usr/bin/perl +use strict; +use warnings; +use open ':utf8'; + +use Getopt::Long; + +my $conf = {}; # configuration hashref +initialize($conf); + +open FP, '<', shift or die "Can't open input file: $!\n"; + +while () { + +} + +sub initialize { + my ($c) = @_; + my @missing = (); + + # set mode on existing filehandles + binmode(STDIN, ':utf8'); + + my $rc = GetOptions( $c, + 'prefix|p=s', + 'help|h', + ); + show_help() unless $rc; + show_help() if ($c->{help}); + + my @keys = keys %{$c}; + show_help() unless (@ARGV and @keys); + for my $key ('prefix') + { push @missing, $key unless $c->{$key} } + if (@missing) { + print "Required option: ", join(', ', @missing), " missing!\n"; + show_help(); + } +} + +sub show_help { + print <