rdf_compatible method for RDF::Trine::Statement

Gregory Williams greg at evilfunhouse.com
Fri Jul 2 17:12:39 CEST 2010


On Jul 2, 2010, at 6:11 AM, Toby Inkster wrote:

> On Thu, 2010-07-01 at 20:22 -0400, Gregory Williams wrote:
>> Interesting. Is there a reason to prefer returning $self/undef in the
>> method instead of, for example, 1/0? I'll see about applying this
>> patch soon.
> 
> No particular reason. All that is important is to return a value that
> evaluates to true/false. I thought $self/undef might be a way of doing
> that which is useful for map. e.g.
> 
> 	@rdf_triples = map { $_->rdf_compatible } @triples;
> 
> But I've not really checked what returning undef from the code block
> does - it probably litters @rdf_triples with undefs.

That makes sense. Replace `return undef` with just `return` and that map should work.

.greg


More information about the Dev mailing list