Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^2: Stucked in YAML::Tiny

by ckj (Chaplain)
on Jul 16, 2012 at 07:28 UTC ( #981982=note: print w/replies, xml ) Need Help??

in reply to Re: Stucked in YAML::Tiny
in thread Stucked in YAML::Tiny

On using LoadFile instead of read, it gives:
"Failed to load YAML document from 'YAML::Tiny' at line 7 +"
UPDATE The same code is working fine on unix machine, while on windows it's giving the same error. Not getting exactly what is the reason behind this. I checked but there also nothing was found. Perl code:
use strict; use warnings; use YAML::Tiny; use Data::Dumper; # Create a YAML file my $yaml = YAML::Tiny->new; # Open the config $yaml = YAML::Tiny->read( 'test.yaml' ); #changing yaml file $yaml->[0]->{'order.create'}->{domain} = 'ckjckcjckj'; # Save the file $yaml->write('test.yaml');
Yaml File:
--- order.create: domain: sdfsdfsdfsdf
The same code works in unix but gives error in windows "Can't call method "write" on unblessed reference at line 16.".

Replies are listed 'Best First'.
Re^3: Stucked in YAML::Tiny
by moritz (Cardinal) on Jul 16, 2012 at 08:39 UTC
Re^3: Stucked in YAML::Tiny
by aitap (Deacon) on Jul 16, 2012 at 10:14 UTC
    In my code I use use YAML qw{LoadFile}, and it works fine on both Windows and *nix. YAML file example:
    --- version: 0.11 greek: - greek_plain - greek_italic csr: FontStyle: Italic: italic Position: Subscript: sub Superscript: sup gs: - EPS - PDF
    Can you try running perl debugger on your code and using s command after LoadFile call shows up to trace code inside LoadFile?
    Sorry if my advice was wrong.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://981982]
and !@monks...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-02-23 22:33 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (351 votes). Check out past polls.