in reply to Looping in the background of your main program

I am not sure if this would work or not, but this might help you out.

untested:

#in your script you may have something like this if ( $ARGV[0] == 1 ) { # your mp3 playing code }else{ # we run the mp3 code & continue doing what we want/need # like this my $pid = system(1,"$0 1"); # you could monitor the pid yourself and/or kill the process when + exiting .. it's up to you. }

Hopes this will work, try it & post back.