Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read file key value

Status
Not open for further replies.

sun9

Programmer
Dec 13, 2006
31
US
I am currently using a file that has key and value pairs is it possible to read those values into some variable in perl as we do with the property file in java?

Thanks.
 
The file format
Code:
{
key1 => 'value1',
key2 => 'value2',
}
To access those variables
Code:
my $data = do '/path/to/file';
print $data->{key1};
or you can use the perl module AppConfig

M. Brooks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top