Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: Config::Config{osname} and Config{osname}

by PhillipHuang (Sexton)
on Dec 07, 2011 at 09:43 UTC ( #942193=note: print w/replies, xml ) Need Help??

in reply to Re: Config::Config{osname} and Config{osname}
in thread Config::Config{osname} and Config{osname}

I see. When 'use Config' first, and then in 'package Huang', it must be identified with original path as "$Config::Config". If use '$Config{osname}', it will warn 'Global symbol "%Config" requires explicit package'.
  • Comment on Re^2: Config::Config{osname} and Config{osname}

Replies are listed 'Best First'.
Re^3: Config::Config{osname} and Config{osname}
by Anonymous Monk on Dec 07, 2011 at 10:02 UTC

    Yup, it all depends what package you're in

    $ perl -l use strict; use warnings; use Config; # main package Huang; use Config; package Batman; use Config; package main; print \%Config; print \%Huang::Config; print \%Batman::Config; print \%main::Config; print \%Config::Config; __END__ HASH(0x99abcc) HASH(0x99abcc) HASH(0x99abcc) HASH(0x99abcc) HASH(0x99abcc)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://942193]
[atcroft]: PriNet: %hash = ();? or foreach my $k ( keys %hash ) { delete $hash{$k}; }?
[PriNet]: go figure, i just tried that, it retains some of the values (not the key) of the pre-assigned value

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2017-06-28 02:56 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (619 votes). Check out past polls.