#!/usr/bin/perl use Image::Magick; use strict; use warnings; my $file = 'coolplayer.ico'; my $base = $1 if $file =~ /^(.*)\.[a-z]{3,4}$/; my $outf = 'bmp'; my $image = Image::Magick->new(); my $ERR = $image->Read('coolplayer.ico'); die $ERR if $ERR and $ERR !~ /configuration file found/i; for( my $x = 0; $image->[$x]; $x++ ) { $ERR = $image->[$x]->Write("$base.$x.$outf"); warn "x=$x;$ERR" if $ERR and $ERR !~ /configuration file found/i; }