in reply to -c
And that you have your tester file called tester.pl:#!/usr/bin/perl sub Foo { print "foo\n"; } Bar(); 1;
And your result when running tester.pl is:#!/usr/bin/perl use strict; eval { require 'testee.pl'; }; if ($@) { warn(); } print "\nDone!\n";
The only problem I see with this method is that you're testee.pl must return a true statement (hence the 1; at the end). But other than that it seems to do what you want!20:54:50.70@admin:> perl tester.pl Undefined subroutine &main::Bar called at testee.pl line 7. ...caught at tester.pl line 9. Done! 20:54:56.11@admin:>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: -c
by Adam (Vicar) on May 09, 2000 at 04:12 UTC |