title: Can't access an mp3 file in perl
body: <p>I am new to perl and was messing around with mp3 files using this program, but it doesn't seem to work.
  So I want to access this file in my music folder and print it out, but whenever I'm running the script I'm getting the error:</p>
  
  <blockquote>
    <p>Can't call method <code>get_tags</code> on an <code>undefined</code> value at line 5.</p>
  </blockquote>
  
  <p>I know it's probably something basic but I couldn't find it on google. Thanks in advance</p>
  
  <pre><code>use 5.0.10;
  #!/usr/bin/perl;
  use MP3::Tag;
  $mp3=MP3::Tag-&gt;new("C:\Users\plank223\Music\Ellie Goulding - Bright Lights (Deluxe Edition).mp3");
  $mp3-&gt;get_tags();
  if (exists $mp3-&gt;{ID3v1}) {
      print "Filename: $filename\n";
      print "Artist: " . $mp3-&gt;{ID3v1}-&gt;artist."\n";
      print "Title: " . $mp3-&gt;{ID3v1}-&gt;title . "\n";
      print "Album: " . $mp3-&gt;{ID3v1}-&gt;album . "\n";
      print "Year: " . $mp3-&gt;{ID3v1}-&gt;year . "\n";
      print "Genre: " . $mp3-&gt;{ID3v1}-&gt;genre . "\n";
  } else {
      print "Oi, no data here";
  }
  $mp3-&gt;close();
  </code></pre>