Help for this page

Select Code to Download


  1. or download this
    package A;
    print "the global k in package B is $B::k\n";
    
  2. or download this
    package main;
    my $MW = ...; # Create your main window here.
    sub UNIVERSAL::MW {$MW}
    
  3. or download this
        # In the place/package where we want to create globals
        use vars::global create => qw( $foo @bar %baz );
    ...
    
        # If you're lazy, you can import all the globals defined so far
        use vars::global ':all';
    
  4. or download this
    package vars::global;
    {
    ...
    
    1;    # Magic true value required at end of module
    __END__
    
  5. or download this
    *{$caller . '::' . substr $symbol, 1} = $ref;
    
  6. or download this
    use vars::global qw( $these @exists ), 
           create => qw( $those @are %new );