in reply to Re: Trying to find and copy mp3s
in thread Trying to find and copy mp3s

Its definately getting to the loops and everything, but now I get an error on the copy cammand, saying that the file I'm copying to does not exist. How can I create it?

Replies are listed 'Best First'.
Re^3: Trying to find and copy mp3s
by kyle (Abbot) on Feb 12, 2007 at 02:07 UTC

    It's probably telling you that because the destination directory does not exist. You can create it with mkdir. For example:

    my $destination = "/home/zack/music"; my $music = "$destination/$mp3"; if ( ! -d $destination && ! mkdir $destination ) { die "Can't mkdir $destination: $!"; } copy( $mp3, $music ) or die "Can't copy $mp3 to $music: $!";