On Dec 17, 2003, at 6:20 AM, Paul Kraus wrote: [..]
Create a symbolic link in usr/local/bin with the filename you want them
to use.

Of the group, paul's is the most pragmatic, IMMHO, since this can be done in the classical

ln -s /opt/WidgetSnack/bin/fooBar.pl /usr/local/bin/fooBar

for each of the "little pearl scripts" without requiring
that the users actually change their "profiles" to
include a new PATH element.

minor Whine here, for those who have not checked int,
there IS a difference between $RealBin and $Bin in the
FindBin module that becomes important in these types symbolic cases.
cf perldoc FindBin - since if one wanted to consolidate the
support and maintenance of the suite of tools with perl modules
in the /opt/WidgetSnack/lib - then one will want to do say:

[jeeves: 17:] sed 's/^/### /' fooBar.pl
### #!/usr/bin/perl
### use strict;
### use warnings;
### use FindBin qw($RealBin);
### use lib "$RealBin/../lib";
###
### foreach my $entry (@INC)
### {
###     print "$entry \n";
### }
###
### system('echo "oldPath: $PATH"');
### $ENV{PATH} = $RealBin . ":" . $ENV{PATH} ;
### system('echo "new $PATH"');
[jeeves: 18:]

so that when the user types fooBar, they will get the right
redirection to the correct WidgetSnack "libraries" ...

[jeeves: 9:] fooBar
/opt/WidgetSnack/bin/../lib
/System/Library/Perl/5.8.1/darwin-thread-multi-2level
/System/Library/Perl/5.8.1
/Library/Perl/5.8.1/darwin-thread-multi-2level
/Library/Perl/5.8.1
/Library/Perl
/Network/Library/Perl/5.8.1/darwin-thread-multi-2level
/Network/Library/Perl/5.8.1
/Network/Library/Perl
.
oldPath: /home/drieux/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/ X11R6/bin
new /opt/WidgetSnack/bin:/home/drieux/bin:/usr/local/bin:/bin:/sbin:/usr/ bin:/usr/sbin:/usr/X11R6/bin


[jeeves: 10:] which fooBar
/usr/local/bin/fooBar
[jeeves: 11:] ls -l /usr/local/bin/fooBar
lrwxr-xr-x 1 admin staff 30 17 Dec 07:43 /usr/local/bin/fooBar -> /opt/WidgetSnack/bin/fooBar.pl
[jeeves: 12:]


One may wish to think about whether or not one needs to
expose ALL of the 'little perl scripts' to the user for
their use on the command line, or should one adopt a
'driver' script approach that knows how to find the
rest of the scripts???? - hence why I opted for
the $ENV{PATH} gag in the little fooBar.pl...

I'm still confused on why we need to keep the
"*.pl" model around for 'finding' them. Three
of the better known pieces of 'perl code'

        h2xs
        perldoc
        a2p

are perl, but without the extensions.

ciao
drieux

---


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