projects
/
gitmo/Moose.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Handle defaults with quote-breaking values correctly by using
[gitmo/Moose.git]
/
lib
/
Moose
/
Meta
/
Method
/
Constructor.pm
diff --git
a/lib/Moose/Meta/Method/Constructor.pm
b/lib/Moose/Meta/Method/Constructor.pm
index
644ed93
..
655a9b8
100644
(file)
--- a/
lib/Moose/Meta/Method/Constructor.pm
+++ b/
lib/Moose/Meta/Method/Constructor.pm
@@
-392,10
+392,7
@@
sub _generate_default_value {
return '$attrs->[' . $index . ']->default($instance)';
}
else {
- my $default = $attr->default;
- # make sure to quote strings ...
- return "'$default'";
-
+ return q{"} . quotemeta( $attr->default ) . q{"};
}
}