Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by moritz (Cardinal)
on Jul 13, 2012 at 12:10 UTC ( #981605=note: print w/replies, xml ) Need Help??


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

YAML::XS's Load function turn a YAML string into a perl data structure. So you modify those like any other data structure i Perl. And then you call Dump to create a YAML string from it again.

Which part are you having trouble with?

Replies are listed 'Best First'.
Re^5: How to make changes in yaml file thorugh perl
by Anonymous Monk on Jul 13, 2012 at 12:12 UTC
    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.
        Got it YAML::Tiny has methods like read and write which helps in editing yaml file on disk.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://981605]
help
Chatterbox?
[shmem]: Lanx: that just enables the border. Looking up style attributes...
[LanX]: ?
[karlgoethebier]: code><table style="border: 1px solid black;}"></code> same for th and td ?
[shmem]: my scratchpad
[karlgoethebier]: oops!

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2017-07-24 16:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (356 votes). Check out past polls.