X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDevel%2FDeclare.pm;h=ed296868a7100e80a3d7308683f63bc0067aa8a1;hb=78bb475dd0c334ce6f507f501d7b9e1d8cbd8b0b;hp=8557b212b2c849aa0002748ea39f317f97d8b8a7;hpb=fb4e2a38b19e9f6cc64e1b8ade89c8c6890a93dc;p=p5sagit%2FDevel-Declare.git diff --git a/lib/Devel/Declare.pm b/lib/Devel/Declare.pm index 8557b21..ed29686 100644 --- a/lib/Devel/Declare.pm +++ b/lib/Devel/Declare.pm @@ -4,7 +4,7 @@ use strict; use warnings; use 5.008001; -our $VERSION = '0.005009'; +our $VERSION = '0.006006'; use constant DECLARE_NAME => 1; use constant DECLARE_PROTO => 2; @@ -14,7 +14,7 @@ use constant DECLARE_PACKAGE => 8+1; # name implicit use vars qw(%declarators %declarator_handlers @ISA); use base qw(DynaLoader); use Scalar::Util 'set_prototype'; -use B::Hooks::OP::Check; +use B::Hooks::OP::Check 0.19; bootstrap Devel::Declare; @@ -513,8 +513,21 @@ things like C). Also it Does The Right Thing with nested delimiters (like C). -It returns the length of the expression matched. Use C to -get the actual matched text. +It returns the effective length of the expression matched. Really, what +it returns is the difference in position between where the string started, +within the buffer, and where it finished. If the string extended across +multiple lines then the contents of the buffer may have been completely +replaced by the new lines, so this position difference is not the same +thing as the actual length of the expression matched. However, because +moving backward in the buffer causes problems, the function arranges +for the effective length to always be positive, padding the start of +the buffer if necessary. + +Use C to get the actual matched text, the content of +the string. Because of the behaviour around multiline strings, you +can't reliably get this from the buffer. In fact, after the function +returns, you can't rely on any content of the buffer preceding the end +of the string. =head4 C