Why not just make DIR1, DIR2, IPADDR AND IPPORT global variables within
the script, rather then requiring user to set env variables, which can
become a pain in the ass.

Your best bet would be to set them to some default variable, and then if
the user needs to, she can override the default values by passing the
new values as parameters. Hope that helps.

Steven Kreuzer
Linux Systems Administrator
Etagon, Inc
W: 646.728.0656
F: 646.728.0607
E: [EMAIL PROTECTED]


-----Original Message-----
From: John McKown [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 26, 2003 12:38 PM
To: Perl Beginners Mailing List
Subject: Hi & a question

I'm new here and a very novice Perl coder. And I have a question, of 
course <grin>.

Is it more "Perl-like" to get information from the shell via UNIX 
Environment Variables or via the command line? For an example, I have 
writing a Perl program which reacts to messages sent to it. It has four 
input parameters. The current program gets this information, which is
two 
distinct subdirectories, a port number, and an IP address, via four 
different environment variables. My question is should I do it that way
or 
should I pass this information in via the command line. 

E.g.

export DIR1=...
export DIR2=...
export IPADDR=...
export IPPORT=...
perl-script.perl

or

perl-script.perl DIR1 DIR2 IPADDR IPPORT

Although my current code uses the first way, I'm beginning to think that

the second is preferrable because it would be more portable to non-UNIX 
environments.

I hope everybody is having a good holiday.

--
Maranatha!
John McKown


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



--
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