in reply to perlapp, die, and __DATA__
Also couple of comments on your code:
UPDATE: integral is absolutely right, and I'm in a case of do what I mean not what I say :(. Updated comment to correct.use strict; package SAR; &get_args (@ARGV); #Ok here you're passing a copy #of @ARGV into get_args's @_. #BTW your don't need & the #trailing ()'s make strict happy sub get_args { my @help = <DATA>; #Why read this now #You don't know if you need #it yet. ($ARGV[0] eq "/?") && (die @help); #Ok you passed the contents of #@ARGV into your sub in @_ but #you ignore it and read the #global @ARGV directly. #copy @_ that way you don't have #to worry about modifing the #global @ARGV. #my @array = @_; #die @help if ($array[0] eq "/?") }
| Mynd you, mønk bites Kan be pretti nasti... |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: perlapp, die, and __DATA__
by integral (Hermit) on Apr 25, 2003 at 06:44 UTC |