summaryrefslogtreecommitdiff
path: root/pod/perlembed.pod
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-07-06 00:40:24 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-07-06 00:40:24 +0000
commit1ee082b7cc0745c3a220deae68a0a3cc2ac5bd4b (patch)
treec5707f40808342e674d21f012fc388b7d182cab5 /pod/perlembed.pod
parent23e6a22f279db8eefd01132a30fcc45ff786ef2a (diff)
downloadperl-1ee082b7cc0745c3a220deae68a0a3cc2ac5bd4b.tar.gz
add Symbol::delete_package()
p4raw-id: //depot/perl@1330
Diffstat (limited to 'pod/perlembed.pod')
-rw-r--r--pod/perlembed.pod18
1 files changed, 1 insertions, 17 deletions
diff --git a/pod/perlembed.pod b/pod/perlembed.pod
index 12553452c3..f7c8e4a3e1 100644
--- a/pod/perlembed.pod
+++ b/pod/perlembed.pod
@@ -668,6 +668,7 @@ with my() whenever possible.
use strict;
use vars '%Cache';
+ use Symbol qw(delete_package);
sub valid_package_name {
my($string) = @_;
@@ -680,23 +681,6 @@ with my() whenever possible.
return "Embed" . $string;
}
- #borrowed from Safe.pm
- sub delete_package {
- my $pkg = shift;
- my ($stem, $leaf);
-
- no strict 'refs';
- $pkg = "main::$pkg\::"; # expand to full symbol table name
- ($stem, $leaf) = $pkg =~ m/(.*::)(\w+::)$/;
-
- my $stem_symtab = *{$stem}{HASH};
- my $leaf_glob = $stem_symtab->{$leaf};
- my $leaf_symtab = *{$leaf_glob}{HASH};
-
- %$leaf_symtab = ();
- delete $stem_symtab->{$leaf};
- }
-
sub eval_file {
my($filename, $delete) = @_;
my $package = valid_package_name($filename);