Hi,
I'm sending data through the POST from HTML and then try to save it as YAML.
This is a form to create data
<form action="/send.pl" method="POST">
<input name="product" size="50">
<input type="submit" value="Go">
</form>
here is the processing of the data in send.pl:
use YAML::Syck;
use CGI::Fast ':standard';
while ( my $q = new CGI::Fast ) {
my $data;
$data->{'product'}=$q->param('product');
$data->{'product_test'}="test product"; #for test that YAML is working
DumpFile( 'test.yml', $data );
print "Content-type: text/html\n\n";
print "q=".$q->param('product'); # this is for test only
}
The result on the screen is perfect. q contains what ever it should contain.
But the YAML file is bad.
---
product: ~
product_test: "test product"
Why the data are destroyed?
UPD: The problem was solved by switching from YAML::Syck to YAML::Dumper library.