aboutsummaryrefslogtreecommitdiff
path: root/Plugin/URL_Title.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Plugin/URL_Title.pm')
-rw-r--r--Plugin/URL_Title.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/Plugin/URL_Title.pm b/Plugin/URL_Title.pm
index 53d6326..9d20cd6 100644
--- a/Plugin/URL_Title.pm
+++ b/Plugin/URL_Title.pm
@@ -6,13 +6,13 @@ use HTTP::Tiny;
use HTML::Parser;
use utf8;
-my %config;
+my $config;
sub configure {
- my $self = $_[0];
- my $cmdref = $_[1];
- my $cref = $_[2];
- %config = %$cref;
+ my $self = shift;
+ my $cmdref = shift;
+ shift; # run_command
+ $config = shift;
return $self;
}
@@ -75,7 +75,7 @@ sub on_message
$shorturl =~ s,/$,,g;
# truncate URL without http(s):// to configured length if needed
- $shorturl = (substr $shorturl, 0, $config{url_len}) . "…" if length ($shorturl) > $config{url_len};
+ $shorturl = (substr $shorturl, 0, $config->{url_len}) . "…" if length ($shorturl) > $config->{url_len};
my $composed_title = "$title ($shorturl)";
return $composed_title;