Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: How to make changes in yaml file thorugh perl

by tospo (Hermit)
on Jul 11, 2012 at 08:32 UTC ( #981052=note: print w/ replies, xml ) Need Help??


in reply to Re: How to make changes in yaml file thorugh perl
in thread How to make changes in yaml file thorugh perl

I think the OP wants to manipulate a YAML file with a Perl script (according to the title of the post), so yes, please do check out the various YAML handling modules on CPAN.
My favourite is YAML::Tiny - simple and leight-weight and good for most cases. You would read the YAML file into a Perl data structure, manipulate the data in there and then dump it to a new YAML file (or overwrite the existing one). Have a go and post your code here if you are running into trouble.


Comment on Re^2: How to make changes in yaml file thorugh perl
Re^3: How to make changes in yaml file thorugh perl
by Anonymous Monk on Jul 13, 2012 at 12:04 UTC
    topso, I am able to fetch yaml contents but not getting how to make changes in any of the attribute and then save it back. Actually writing the changes in the .yaml file is becoming a pain. Can you help in this?
        Yes that's working, after doing dump it's showing the changes but when I open .yaml file it is unchanged. I also want that .yaml file to be changed.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (14)
As of 2014-07-24 13:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (160 votes), past polls