Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: sharing symbols

by bart (Canon)
on Apr 13, 2007 at 11:42 UTC ( [id://609891]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    our @GLOBAL_SYMBOLS; # these are not package constants, but Perl artif
    +acts
    BEGIN {
        @GLOBAL_SYMBOLS = qw(BEGIN EXPORT);
    }
    
  2. or download this
    sub is_constant {
        my $k = shift;
       return $k =~ /^[A-Z]+$/ 
           && !grep { $_ eq $k } @GLOBAL_SYMBOLS
    }
    
  3. or download this
    our %GLOBAL_SYMBOL; # these are not package constants, but Perl artifa
    +cts
    BEGIN {
        %GLOBAL_SYMBOL = map { $_ => 1 } qw(BEGIN EXPORT ISA EXPORT_OK GLO
    +BAL_SYMBOL);  
    }
    
  4. or download this
    sub is_constant {
        my $k = shift;
       return $k =~ /^[A-Z_0-9]+$/
           && !$GLOBAL_SYMBOL{$k};
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-24 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found