package B::Showlex;
our $VERSION = '1.00';
use strict;
use B::Terse ();
#
# Invoke as
# perl -MO=Showlex,foo bar.pl
# to see the names of lexical variables used by &foo
# or as
# perl -MO=Showlex bar.pl
# to see the names of file scope lexicals used by bar.pl
#
sub shownamearray {
my $i;
print "$name has $count entries\n";
for ($i = 0; $i < $count; $i++) {
print "$i: ";
} else {
}
}
}
sub showvaluearray {
my $i;
print "$name has $count entries\n";
for ($i = 0; $i < $count; $i++) {
print "$i: ";
}
}
sub showlex {
}
sub showlex_obj {
}
sub showlex_main {
}
sub compile {
my @options = @_;
if (@options) {
return sub {
my $objname;
eval "showlex_obj('&$objname', \\&$objname)";
}
}
} else {
return \&showlex_main;
}
}
1;
=head1 NAME
B::Showlex - Show lexical variables used in functions or files
=head1 SYNOPSIS
perl -MO=Showlex[,SUBROUTINE] foo.pl
=head1 DESCRIPTION
When a subroutine name is provided in OPTIONS, prints the lexical
variables used in that subroutine. Otherwise, prints the file-scope
lexicals in the file.
=head1 AUTHOR
Malcolm Beattie, C<mbeattie@sable.ox.ac.uk>
=cut