http://qs1969.pair.com?node_id=896303

osmy has asked for the wisdom of the Perl Monks concerning the following question:

Hi everyone, I am a newbie on linux and just searching everything about perl scripting and modules nearly 3-4 days. I need a perl script but one of not easy to find on searching google. Okey now I need a perl script which create or recreate (edit) id3 tags (artist,comment,album,year,cover) of mp3 files stored on my linux centos server. I installed MP3::Tag version 1.13 pearl module to my server. I Searched tutorials about how to use it, finally I get through reading id3 tag of mp3 file but not achieve to modify it or create a new id3tag. So I need your help and knowledge about scripting.
These are the details: I have a mp3 file called 1.mp3 this script will process that '1.mp3' file read its id3tag if there is one, than modify or create id3tag for it by my fix artist name for example: '1.mp3' files id3 tag details are like this
Artist: Dj xx
Year:2010
Title:yyyyy
Comment:eerwer
Cover: x.jpg

now via this perl script which uses MP3::TAG I will change it's
artist as YYY
Title:ttt
Comment:cool
Cover:t.jpg
these are gonna be my fixed values. I mean all '1.mp3' file will have same artist based on script value.
The reason of this script is I will share Dj podcasts on my server and Dj's would have upload their mp3's which has got different id3 tags and cover pics. etc. I want to create more organized podcasts of them by the way I would trigger this perl script via Cronjob.
Thank you for your help and sorry for taking up your time

Here is the code which I try:
#!/usr/bin/perl
use MP3::Tag;
$mp3 = MP3::Tag->new('1.mp3'); # create object
$mp3->get_tags(); # read tags
if (exists $mp3->{ID3v1}) {
$mp3->{ID3v1}->title("ttt");
$mp3->{ID3v1}->artist("YYY");
$mp3->{ID3v1}->album("zzz");
$mp3->{ID3v1}->year("2010");
$mp3->{ID3v1}->write_tag();
}
$mp3->close(); # destroy object
Waiting your answers!