#!/usr/bin/perl use warnings; use strict; use Win32::Sound; my $song = "one.wav"; Win32::Sound::Play($song); my $num = 0; for (1 .. 35) { $num++; print "$num\n"; sleep(1); if ($num == 30) { Win32::Sound::Stop(); } }