Timothy Donahue wrote:
> 
> I have a program that I am writing that I need to accept input from
> either STDIN (for file redirections or pipes) or from the command-line.
> The program manipulates email addresses for our mail servers, so I
> should have the option to do either 'email_add
> [EMAIL PROTECTED]' or 'email_add < /path/to/file'.
> 
> I thought that an algorithm similar to this should work.

I see that Steve already gave you a good answer but...

> if (defined(@ARGV) {

perldoc -f defined
[snip]
       Use of `defined' on aggregates (hashes and arrays)
       is deprecated.  It used to report whether memory
       for that aggregate has ever been allocated.  This
       behavior may disappear in future versions of Perl.
       You should instead use a simple test for size:

           if (@an_array) { print "has array elements\n" }
           if (%a_hash)   { print "has hash members\n"   }


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to