John McKown wrote:

> 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

Hi John,

I'd suggest that both approaches can be somewhat lacking in portability.  The
command line is something of a kludge, IMHO, as it still depends largely on
users typing in the correct parameters.  I think ini files would be portable
across a much wider variety of systems.  Just write the ini file per
installation configuration.

Joseph


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