#!/usr/bin/perl use warnings; use strict; use Test::More tests => 5; ok( require( 'myScript' ), 'loaded file okay' ) or exit; throws_ok { main( ) } qr/Usage:/, 'main( ) should give a usage error without any arguments'; throws_ok { main( 'bad command' ) } qr/Unknown command 'bad command'/, '... or with a bad command given'; #### ./test_myScript.t 1..5 ok 1 - loaded file okay parameter `files' not set parameter `output' not set # Looks like you planned 5 tests but only ran 1.