Skip Menu |

This queue is for tickets about the String-Tagged CPAN distribution.

Report information
The Basics
Id: 97900
Status: resolved
Priority: 0/
Queue: String-Tagged

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

Bug Information
Severity: Wishlist
Broken in: 0.08
Fixed in: 0.09



Subject: Support chained calls to ->apply_tagged
Would it be possible to return $self from ->apply_tagged, and maybe other methods as well? Instead of this: my $v = String::Tagged->new(strftime '%Y-%m-%d %H:%M:%S', localtime $item); $v->apply_tag( 0, 4, b => 1); $v->apply_tag( 6, 2, b => 1); $v->apply_tag( 8, 2, b => 1); $v->apply_tag(12, 2, fg => 2); $v->apply_tag(14, 2, fg => 4); $v->apply_tag(16, 2, fg => 1); Future->wrap( $v ) it'd be nice to have the ability to write as a single expression: Future->wrap( String::Tagged->new(strftime '%Y-%m-%d %H:%M:%S', localtime $item) ->apply_tag( 0, 4, b => 1) ->apply_tag( 6, 2, b => 1) ->apply_tag( 8, 2, b => 1) ->apply_tag(12, 2, fg => 2) ->apply_tag(14, 2, fg => 4) ->apply_tag(16, 2, fg => 1) ) cheers, Tom
I in fact thought of the very same, and included it in the 0.09 release: https://metacpan.org/changes/distribution/String-Tagged#L3 :) -- Paul Evans