summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-11-25 13:16:43 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-11-25 13:16:43 +0000
commit464940c09a42f968e359606bddb8d4ee83718403 (patch)
tree82a1cead4d6d666ee284ad81bbf3b860be685372
parentdcfc8c7302059b30fc97aee62a5d29a3d690d7f5 (diff)
downloadperl-MDK-Common-464940c09a42f968e359606bddb8d4ee83718403.tar
perl-MDK-Common-464940c09a42f968e359606bddb8d4ee83718403.tar.gz
perl-MDK-Common-464940c09a42f968e359606bddb8d4ee83718403.tar.bz2
perl-MDK-Common-464940c09a42f968e359606bddb8d4ee83718403.tar.xz
perl-MDK-Common-464940c09a42f968e359606bddb8d4ee83718403.zip
get rid of MDK::Common::Globals (not used anymore by drakconnect)
-rw-r--r--MDK/Common.pm.pl3
-rw-r--r--MDK/Common/Globals.pm61
-rw-r--r--perl_checker.src/tree.ml3
-rw-r--r--tutorial.html1
4 files changed, 2 insertions, 66 deletions
diff --git a/MDK/Common.pm.pl b/MDK/Common.pm.pl
index 2dc0b11..d5529c0 100644
--- a/MDK/Common.pm.pl
+++ b/MDK/Common.pm.pl
@@ -26,7 +26,6 @@ C<MDK::Common> is a collection of packages containing various simple functions:
L<MDK::Common::DataStructure>,
L<MDK::Common::File>,
L<MDK::Common::Func>,
-L<MDK::Common::Globals>,
L<MDK::Common::Math>,
L<MDK::Common::String>,
L<MDK::Common::System>,
@@ -74,7 +73,7 @@ our @ISA = qw(Exporter);
# perl_checker: RE-EXPORT-ALL
our @EXPORT = map { @$_ } map { values %{'MDK::Common::' . $_ . 'EXPORT_TAGS'} } grep { /::$/ } keys %MDK::Common::;
-our $VERSION = "1.1.24";
+our $VERSION = "1.1.25";
1;
EOF
diff --git a/MDK/Common/Globals.pm b/MDK/Common/Globals.pm
deleted file mode 100644
index 0e73b83..0000000
--- a/MDK/Common/Globals.pm
+++ /dev/null
@@ -1,61 +0,0 @@
-package MDK::Common::Globals;
-
-=head1 NAME
-
-Shares constant values between modules
-
-=head1 SYNOPSIS
-
- use MDK::Common::Globals "foo", qw($a $b);
-
- MDK::Common::Globals::init(a => 2, b => 3);
-
- print $a; # 2
-
-=cut
-
-
-sub import {
- my (undef, $name, @globals) = @_;
- foreach (@globals) {
- $name =~ /^\$/ and die qq(usage : use MDK::Common::Globals "group", qw(\$var1 \$var2 ...);\n);
- s/^\$// or die qq(bad parameter to "use MDK::Common::Globals": missing variable ``$_'' should be written ``\$$_''); #);
-
- no strict 'refs';
- my $v = caller() . '::' . $_;
- my $lv = "$name __ $_";
- *$v = *$lv;
- eval { undef = $$lv; tie $$lv, 'MDK::Common::Globals', $_ };
- }
-}
-
-sub init {
- @_ % 2 == 0 or die "usage MDK::Common::Globals::init(key => val, key2 => val2, ...)\n";
- my %l = @_;
- foreach (keys %l) {
- my $v = caller() . '::' . $_;
- no strict 'refs';
- $$v = $l{$_};
- }
-}
-
-sub TIESCALAR {
- my ($class, $name) = @_;
- my $var;
- bless [$var, undef, $name], $class;
-}
-
-sub STORE {
- my ($o, $val) = @_;
- $o->[1] and die "MDK::Common::Globals::$o->[2] already set\n";
- $o->[1] = 1;
- $o->[0] = $val;
-}
-
-sub FETCH {
- my ($o) = @_;
- $o->[1] or die "MDK::Common::Globals::$o->[2] unset\n";
- $o->[0];
-}
-
-1;
diff --git a/perl_checker.src/tree.ml b/perl_checker.src/tree.ml
index a4b5dfb..6008703 100644
--- a/perl_checker.src/tree.ml
+++ b/perl_checker.src/tree.ml
@@ -176,7 +176,7 @@ let get_exported t =
) empty_exports t
let uses_external_package = function
- | "vars" | "MDK::Common::Globals" | "Exporter" | "diagnostics" | "strict" | "lib" | "POSIX" | "Gtk" | "Storable"
+ | "vars" | "Exporter" | "diagnostics" | "strict" | "lib" | "POSIX" | "Gtk" | "Storable"
| "Config" | "Socket" | "IO::Socket" | "DynaLoader" | "Data::Dumper" | "Time::localtime" | "Expect" -> true
| _ -> false
@@ -308,7 +308,6 @@ let get_vars_declaration global_vars_declared file_name package =
| My_our("our", ours, pos) ->
List.iter (fun (context, name) -> Hashtbl.replace package.vars_declared (context, name) (pos, ref Access_none, None)) ours
- | Use(Ident(Some "MDK::Common", "Globals", pos), [ String _ ; ours ])
| Use(Ident(None, "vars", pos), [ours]) ->
List.iter (fun (context, name) -> Hashtbl.replace package.vars_declared (context, name) (pos, ref Access_none, None)) (from_qw ours)
| Use(Ident(None, "vars", pos), _) ->
diff --git a/tutorial.html b/tutorial.html
index a7fc973..7659949 100644
--- a/tutorial.html
+++ b/tutorial.html
@@ -36,7 +36,6 @@
<ul>
<li><tt>MDK::Common::File</tt>: some useful list/hash functions</li>
<li><tt>MDK::Common::Func</tt>: functions suited to functional-style programming</li>
- <li><tt>MDK::Common::Globals</tt>: allows to share constant values between packages</li>
<li><tt>MDK::Common::Math</tt>: some math functions</li>
<li><tt>MDK::Common::String</tt>: functions to perform various formatting on strings</li>
<li><tt>MDK::Common::System</tt>: system-related useful functions</li>