aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-01 22:51:16 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-01 22:51:16 +1300
commitcbd10eb8c9ff6d21410e06e6a4a8d3304323854f (patch)
tree61036e14ae683badd4cd5f6fef56c30741c8196e /lib
parentUse set_tag() and add_lyric() internally for parse (diff)
downloadMusic-Lyrics-LRC-cbd10eb8c9ff6d21410e06e6a4a8d3304323854f.tar.gz
Music-Lyrics-LRC-cbd10eb8c9ff6d21410e06e6a4a8d3304323854f.zip
Verify reftype of param passed to load()
Diffstat (limited to 'lib')
-rw-r--r--lib/Music/Lyrics/LRC.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Music/Lyrics/LRC.pm b/lib/Music/Lyrics/LRC.pm
index 919452b..0930386 100644
--- a/lib/Music/Lyrics/LRC.pm
+++ b/lib/Music/Lyrics/LRC.pm
@@ -157,6 +157,10 @@ sub unset_tag {
sub load {
my ( $self, $fh ) = @_;
+ # Panic if this doesn't look like a filehandle
+ ref $fh eq 'GLOB'
+ or croak 'Not a filehandle';
+
# Iterate through lines
LINE: while ( my $line = <$fh> ) {