in reply to Using config::any

You guys are making this all far more difficult than it needs to be.

use strict; use warnings; use Config::Any; #By the way, load_files is only useful for multiple files, in which ca +se you will have to change the code below. For only one file, load() +is good enough. my $cfg = Config::Any->load( "C:\\wamp\\www\\password.ini" ); #Simply printing $cfg will print its reference, like you asked for. #Config::Any returns a hashref(when used with [cpan://Config::Any::INI +] which interfaces to [cpan://Config::Tiny]), so you need to access i +t like one. print $cfg->{password}->{password};

The docs for Config::any can be a bit confusing for the beginning programmer, I know.

~Thomas~
bless( $you ) if $you->{sneezed};

Replies are listed 'Best First'.
Re^2: Using config::any
by ItsyBitsy (Novice) on May 31, 2012 at 02:54 UTC
    Thanks for the reponse. But when i try load it says
    Can't locate object method "load" via package "Config::Any" at caller. +pl line 15
    Also is there any way to upvote answers which you feel are good like in stackoverflow?

      load() is not a documented method of Config::Any. Developers provide an interface for you to interact with their modules (e.g. Config::Any's Interface) which you can generally expect to be stable across versions of a module: these are the only methods you should use. They may write other methods for the implementation of their modules: these may change at any time without notice. Perhaps load() was such a method at one time.

      Voting/Experience System explains about voting - there's a link to this in the panel on the right-hand side in the Information section.

      -- Ken

        Okay. Thanks.