diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-01 22:51:16 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-01 22:51:16 +1300 |
commit | cbd10eb8c9ff6d21410e06e6a4a8d3304323854f (patch) | |
tree | 61036e14ae683badd4cd5f6fef56c30741c8196e /lib | |
parent | Use set_tag() and add_lyric() internally for parse (diff) | |
download | Music-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.pm | 4 |
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> ) { |