my $device = "/dev/cdrom"; my $dir = "/mnt/cdrom"; my $testfile = ""; print `mount $device $dir`; if ($?) { if ( -f "$dir/$testfile" ) { print "mounted." } else { print "There was an error in mounting $device at $dir.\n" } } else { print "mounted\n" }