Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Naming Convention For Global Variables?

by LanX (Canon)
on Sep 28, 2012 at 11:12 UTC ( #996179=note: print w/ replies, xml ) Need Help??


in reply to Re: Naming Convention For Global Variables?
in thread Naming Convention For Global Variables?

perldoc -u perlvar |perl -ne '$seen{$1}=1 if /(\$[A-Z_]+)\b/}{ print +join "\n", keys %seen' $ERRNO $RS $OSNAME $OUTPUT_FIELD_SEPARATOR $EXTENDED_OS_ERROR $LAST_SUBMATCH_RESULT $COMPILING $PREMATCH $OFMT $OUTPUT_RECORD_SEPARATOR $FORMAT_NAME $SUBSCRIPT_SEPARATOR $LIST_SEPARATOR $WARNING $EUID $FORMAT_LINE_BREAK_CHARACTERS $OS_ERROR $FORMAT_FORMFEED $PERL_VERSION $I $INPUT_RECORD_SEPARATOR $DEBUGGING $NR $REAL_USER_ID $CHILD_ERROR $PID $FORMAT_TOP_NAME $EVAL_ERROR $FORMAT_LINES_LEFT $POSTMATCH $EXECUTABLE_NAME $ACCUMULATOR $EXCEPTIONS_BEING_CAUGHT $FORMAT_LINES_PER_PAGE $LAST_PAREN_MATCH $OLD_PERL_VERSION $ORS $OUTPUT_AUTOFLUSH $EGID $ARRAY_BASE $BASETIME $REAL_GROUP_ID $EFFECTIVE_GROUP_ID $SUBSEP $OFS $ARGV $PROGRAM_NAME $SIG $FORMAT_PAGE_NUMBER $UID $SYSTEM_FD_MAX $INPUT_LINE_NUMBER $GID $INPLACE_EDIT $MATCH $LAST_REGEXP_CODE_RESULT $PROCESS_ID $EFFECTIVE_USER_ID $PERLDB $_

Cheers Rolf

UPDATE: added underscore


Comment on Re^2: Naming Convention For Global Variables?
Download Code
Re^3: Naming Convention For Global Variables?
by Anonymous Monk on Sep 28, 2012 at 11:24 UTC

    Where is the conflict?

    $ perl -wE " say $BASETIME " Name "main::BASETIME" used only once: possible typo at -e line 1. Use of uninitialized value $BASETIME in say at -e line 1.
Re^3: Naming Convention For Global Variables?
by tobyink (Abbot) on Sep 28, 2012 at 12:56 UTC

    With the exception of $ARGV none of those variables are used by perl itself. They are specific to English.pm (see English) and are documented in perlvar for convenience (even though barely anybody uses English.pm).

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
      You forgot at least $MATCH, $PREMATCH and $POSTMATCH.

      I'll check later...

      UPDATE:

      Your right it's Perl Critic moaning w/o checking if English was used. :(

      Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996179]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2014-09-21 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (166 votes), past polls