#!/usr/bin/perl use MP3::Tag; #this is NOT the same as Store::Shirt::Tag ($file,$picture) = @ARGV; if(!-e $file) { die("Cannot open $file"); } if(!-e $picture) { die("Cannot open $picture"); } $mp3=MP3::Tag->new($file); $pict = qx(cat "$picture"); $id3v2 = $mp3->{ID3v2} if exists $mp3->{ID3v2} or die("Could not find ID3v2 tag set!"); $id3v2->remove_frame("APIC"); $id3v2->add_frame("APIC", "image/jpeg","\x03","cd-cover",$pict); $id3v2->write_tag() or die("Could not write ID3v2 data! Check write permissions?");