in reply to Naming Convention For Global Variables?

But that's in conflict with perl special vars ...

No it is not

  • Comment on Re: Naming Convention For Global Variables?

Replies are listed 'Best First'.
Re^2: Naming Convention For Global Variables?
by LanX (Saint) on Sep 28, 2012 at 11:12 UTC
    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

      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

      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.