Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I have a doubt, I am posting my code here.
or in else condition shall I use
Which one is the best way? (Memory management point of view).
Regards,
John
I have a doubt, I am posting my code here.
#!/usr/bin/perl $type = $ARGV[0]; $argument = $ARGV[1]; if( $type eq 'job' || $type eq 'member' || $type eq 'file' ) { print "yes..."; } else { print "The parameters for this program are as follows: [job/member/fil +e] [jobnumber/membernumber/filename]"; die; }
or in else condition shall I use
else { print "The parameters for this program are as follows: [job/member/fil +e] [jobnumber/membernumber/filename]"; exit; }
Which one is the best way? (Memory management point of view).
Regards,
John
Edited by Arunbear: Changed title from 'Provide your valuable suggestion', as per Monastery guidelines
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: exit or die in error handling?
by monkey_boy (Priest) on Apr 14, 2005 at 10:16 UTC | |
by Thilosophy (Curate) on Apr 15, 2005 at 01:10 UTC | |
Re: exit or die in error handling?
by myuserid7 (Scribe) on Apr 14, 2005 at 10:15 UTC | |
Re: exit or die in error handling?
by QM (Parson) on Apr 14, 2005 at 15:30 UTC | |
Re: exit or die in error handling?
by Taulmarill (Deacon) on Apr 14, 2005 at 10:17 UTC | |
by monkey_boy (Priest) on Apr 14, 2005 at 10:21 UTC |
Back to
Seekers of Perl Wisdom