Skip Menu |

This queue is for tickets about the Data-Dump CPAN distribution.

Report information
The Basics
Id: 63883
Status: resolved
Priority: 0/
Queue: Data-Dump

People
Owner: Nobody in particular
Requestors: tomita [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.19
Fixed in: (no value)



Subject: dump() override $1, $2, $3
tested : 5.12.2, 5.8.8 not ok 1 # Failed test at regex.t line 9. # got: 'undef' # expected: 'abc' # Looks like you failed 1 test of 1. dump() override pattern match var($1, $2, $3). Because _dump() using regex. Show quoted text
> if (overload::StrVal($rval) =~ /^(?:([^=]+)=)?([A-Z]+)\
(0x([^\)]+)\)$/) { Can you fix this? -- Tomita
Subject: pattern-match-var.t
use strict; use warnings; use Test::More tests => 1; use Data::Dump qw/dump/; if ("abc" =~ /(.+)/) { my $dump = dump $1; is($dump, "abc"); }
I don't know any good way to fix this. A workaround might be to quote regexp vars if you pass them directly to dump; for example dump("$1").
ah, it certainly is a good way. I think you can write to this POD. ty for reply. On 2011-9-28 Wed 16:20:26, GAAS wrote: Show quoted text
> I don't know any good way to fix this. A workaround might be to quote > regexp vars if you pass them directly to dump; for example dump("$1").
On 2011-10月-02 日 07:05:52, GAAS wrote: Show quoted text
> Found a way to make dump($1) work; https://github.com/gisle/data- > dump/commit/f4f4f485aae5dbbc0f395de403bbb218fca251b3
ty for about this ;) t/dollar-one.t works completely. But sorry I find bugs 1.20. test: use Test::More tests => 1; if ("123" =~ /(.+)/) { is(dump($1), "123"); } result: not ok 1 # Failed test at ref-list.pl line 26. # got: '$a' # expected: '123' # Looks like you failed 1 test of 1. I'm looking for where "$a" was from..
On Wed Oct 12 23:07:04 2011, TOMITA wrote: Show quoted text
> if ("123" =~ /(.+)/) { > is(dump($1), "123"); > } > > result: > > not ok 1 > # Failed test at ref-list.pl line 26. > # got: '$a' > # expected: '123' > # Looks like you failed 1 test of 1. > > I'm looking for where "$a" was from..
I've no idea where the "$a" came from; but I found a cure for this case as well. https://github.com/gisle/data-dump/commit/6caed8ae7347757ab611a47c07b2d2047e470c98
I found an even simpler solution the numeric $1 problem and have now uploaded Data-Dump-1.21 with the fix.
Finally. nice and ty :)