sub getopt ($;$) {
local($argumentative, $hash) = @_;
local($_,$first,$rest);
- local $Exporter::ExportLevel;
+ local @EXPORT;
while (@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
($first,$rest) = ($1,$2);
}
}
}
- $Exporter::ExportLevel++;
- import Getopt::Std;
+ unless (ref $hash) {
+ local $Exporter::ExportLevel = 1;
+ import Getopt::Std;
+ }
}
# Usage:
local($argumentative, $hash) = @_;
local(@args,$_,$first,$rest);
local($errs) = 0;
- local $Exporter::ExportLevel;
+ local @EXPORT;
@args = split( / */, $argumentative );
while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
}
}
}
- $Exporter::ExportLevel++;
- import Getopt::Std;
+ unless (ref $hash) {
+ local $Exporter::ExportLevel = 1;
+ import Getopt::Std;
+ }
$errs == 0;
}