#!/usr/bin/perl -w use strict; system "sudo mount $ARGV[0] /tmp/mnt -o loop=/dev/loop0" and die "mount: ", $? >> 8, "\n"; print "Mounted successfully.\n"; system "sudo umount /tmp/mnt -l" and die "umount: ", $? >> 8, "\n"; print "Unmounted successfully.\n"; #### ben@Jotunheim:/tmp$ ./mt ubuntu_9_10.iso Mounted successfully. Unmounted successfully. ben@Jotunheim:/tmp$ ./mt fake_filename fake_filename: No such file or directory mount: 32