Help for this page

Select Code to Download


  1. or download this
    print("\$variable1 = $Mylib::variable1\n");  # OK
    
  2. or download this
    use Mylib qw( $variable1 );           # If Mylib exports $variable1
    print("\$variable1 = $variable1\n");  # OK
    
  3. or download this
    our $variable1;
    local *variable1 = \$Mylib::variable1;  # Create an alias.
    print("\$variable1 = $variable1\n");    # OK
    
  4. or download this
    use Data::Alias qw( alias );
    alias my $variable1 = $Mylib::variable1;  # Create an alias.
    print("\$variable1 = $variable1\n");      # OK