}
}
-use Text::Balanced qw(extract_multiple extract_quotelike);
sub edit_tags :Exported {
my ($self, $r) = @_;
my $photo = $r->objects->[0];
sub add_tags {
my ($photo, $tagstring) = @_;
- for my $tag (map { s/^"|"$//g; $_} extract_multiple(lc $tagstring, [ \&extract_quotelike, qr/([^\s]+)/ ], undef,1)) {
+ for my $tag (Tagtools->separate_tags($tagstring)) {
$photo->add_to_tags({tag => Memories::Tag->find_or_create({name =>$tag}) })
}
}
use Cache::FileCache;
use Storable qw(freeze); use MIME::Base64;
use Calendar::Simple;
+use Text::Balanced qw(extract_multiple extract_quotelike);
sub import {
my $whence = caller;
my ($class) = @_;
}
+sub separate_tags {
+ map { s/^"|"$//g; $_}
+ extract_multiple(
+ lc $_[1], [
+ \&extract_quotelike,
+ qr/([^\s,]+)/
+ ], undef,1)
+}
# THIS IS A HACK