This manual page is for Mac OS X version 10.6

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



B::Showlex(3pm)                       Perl Programmers Reference Guide                       B::Showlex(3pm)



NAME
       B::Showlex - Show lexical variables used in functions or files

SYNOPSIS
               perl -MO=Showlex[,-OPTIONS][,SUBROUTINE] foo.pl

DESCRIPTION
       When a comma-separated list of subroutine names is given as options, Showlex prints the lexical vari-ables variables
       ables used in those subroutines.  Otherwise, it prints the file-scope lexicals in the file.

EXAMPLES
       Traditional form:

        $ perl -MO=Showlex -e 'my ($i,$j,$k)=(1,"foo")'
        Pad of lexical names for comppadlist has 4 entries
        0: SPECIAL #1 &PL_sv_undef
        1: PVNV (0x9db0fb0) $i
        2: PVNV (0x9db0f38) $j
        3: PVNV (0x9db0f50) $k
        Pad of lexical values for comppadlist has 5 entries
        0: SPECIAL #1 &PL_sv_undef
        1: NULL (0x9da4234)
        2: NULL (0x9db0f2c)
        3: NULL (0x9db0f44)
        4: NULL (0x9da4264)
        -e syntax OK

       New-style form:

        $ perl -MO=Showlex,-newlex -e 'my ($i,$j,$k)=(1,"foo")'
        main Pad has 4 entries
        0: SPECIAL #1 &PL_sv_undef
        1: PVNV (0xa0c4fb8) "$i" = NULL (0xa0b8234)
        2: PVNV (0xa0c4f40) "$j" = NULL (0xa0c4f34)
        3: PVNV (0xa0c4f58) "$k" = NULL (0xa0c4f4c)
        -e syntax OK

       New form, no specials, outside O framework:

        $ perl -MB::Showlex -e \
           'my ($i,$j,$k)=(1,"foo"); B::Showlex::compile(-newlex,-nosp)->()'
        main Pad has 4 entries
        1: PVNV (0x998ffb0) "$i" = IV (0x9983234) 1
        2: PVNV (0x998ff68) "$j" = PV (0x998ff5c) "foo"
        3: PVNV (0x998ff80) "$k" = NULL (0x998ff74)

       Note that this example shows the values of the lexicals, whereas the other examples did not (as
       they're compile-time only).

       OPTIONS

       The "-newlex" option produces a more readable "name => value" format, and is shown in the second
       example above.

       The "-nosp" option eliminates reporting of SPECIALs, such as "0: SPECIAL #1 &PL_sv_undef" above.
       Reporting of SPECIALs can sometimes overwhelm your declared lexicals.

SEE ALSO
       "B::Showlex" can also be used outside of the O framework, as in the third example.  See "B::Concise"
       for a fuller explanation of reasons.

TODO
       Some of the reported info, such as hex addresses, is not particularly valuable.  Other information
       would be more useful for the typical programmer, such as line-numbers, pad-slot reuses, etc..  Given
       this, -newlex isnt a particularly good flag-name.

AUTHOR
       Malcolm Beattie, "[email protected]"



perl v5.8.9                                      2001-09-21                                  B::Showlex(3pm)

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation to the Perl project. (See perlbug(1) for submission instructions.)
Bug reports
Report bugs in the functionality of the described tool or API to Apple through Bug Reporter and to the Perl project using perlbug(1).
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.