Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Reading "slices" out of a file at known start markers

by hacker (Priest)
on Oct 03, 2008 at 05:54 UTC ( #715140=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Reading "slices" out of a file at known start markers
in thread Reading "slices" out of a file at known start markers

Responding to my own question: I think I may have figured out an easier way:

use strict; use warnings; use Data::Dump qw(dump ddx);; use Config::General; my $conf = new Config::General("Makefile"); my %config = $conf->getall; print dump(\%config);

This puts each item as key/value pairs in the %config hash, which I can them print out and manipulate as $config{'SOURCES'} for example.

I guess the only thing I end up losing here, is the basic original formatting, but I can probably iterate through the hash and reconstruct that back somehow.

Anyone familiar with the innards of Config::General that can lend a hand so I can use it correctly?


Comment on Re^3: Reading "slices" out of a file at known start markers
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://715140]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (20)
As of 2015-07-06 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (83 votes), past polls