luxs has asked for the wisdom of the Perl Monks concerning the following question:
here is the processing of the data in send.pl:<form action="/send.pl" method="POST"> <input name="product" size="50"> <input type="submit" value="Go"> </form>
The result on the screen is perfect. q contains what ever it should contain. But the YAML file is bad.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 }
Why the data are destroyed? UPD: The problem was solved by switching from YAML::Syck to YAML::Dumper library.--- product: ~ product_test: "test product"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: YAML problem
by Anonymous Monk on May 26, 2015 at 03:05 UTC | |
by Anonymous Monk on May 26, 2015 at 11:26 UTC | |
by Corion (Patriarch) on May 26, 2015 at 11:37 UTC | |
by Anonymous Monk on May 26, 2015 at 14:38 UTC | |
by Corion (Patriarch) on May 26, 2015 at 15:02 UTC | |
| |
by luxs (Beadle) on May 26, 2015 at 21:59 UTC | |
by Corion (Patriarch) on May 27, 2015 at 06:47 UTC | |
| |
|
Re: YAML problem
by GotToBTru (Prior) on May 26, 2015 at 15:34 UTC | |
by luxs (Beadle) on May 26, 2015 at 22:28 UTC | |
by afoken (Chancellor) on May 27, 2015 at 03:45 UTC | |
by luxs (Beadle) on May 27, 2015 at 10:47 UTC | |
by jeffa (Bishop) on May 26, 2015 at 23:17 UTC |