Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML CPAN distribution.

Report information
The Basics
Id: 18678
Status: resolved
Priority: 0/
Queue: YAML

People
Owner: Nobody in particular
Requestors: bugs [...] bereft.net
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.58
Fixed in: (no value)



Subject: LoadCode sometimes fails: Illegal character in prototype
Hi, perl -MYAML -e '$YAML::UseCode++; Load(Dump(sub { $_ }))' Illegal character in prototype for main::CODE : 0x8524dbc at (eval 59) line 1. But the above example works with -Mstrict. The reason seems to be the length difference in the Deparse output. Load gets confused and attempts to the 'CODE(0x8524dbc)' output causing the prototype error around YAML/Types.pm line 143 Brad The attached code produces the following output for me: Name "YAML::UseCode" used only once: possible typo at ./load_code_fails.pl line 3. Succeeds --- !perl/code: | { use strict 'refs'; $_++; } CODE(0x8527d98) at ./load_code_fails.pl line 9. Fails --- !perl/code: "{\n $_++;\n}\n" Illegal character in prototype for main::CODE : 0x8527be8 at (eval 62) line 1. Use of uninitialized value in warn at ./load_code_fails.pl line 16. Warning: something's wrong at ./load_code_fails.pl line 16. ====== YAML: 0.58 Deparse: 0.7 Perl: 5.008007
Subject: load_code_fails.pl
#!/usr/bin/perl -w use YAML; $YAML::UseCode=1; { use strict; warn "\nSucceeds\n"; warn $_ = Dump(sub { $_++ }); warn $_ = Load($_); } { no strict; warn "\nFails\n"; warn $_ = Dump(sub { $_++ }); warn $_ = Load($_); } warn <<"" ====== YAML: $YAML::VERSION Deparse: $B::Deparse::VERSION Perl: $]
This issue has been copied to: https://github.com/ingydotnet/yaml-pm/issues/59 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
This problem has been fixed with https://github.com/ingydotnet/yaml-pm/pull/180 which I gather is being considered for merging.
On Tue Oct 24 18:26:08 2017, ETJ wrote: Show quoted text
> This problem has been fixed with https://github.com/ingydotnet/yaml- > pm/pull/180 which I gather is being considered for merging.
yep, merged, thanks, closing =)