01-16-2002 10:23 AM
I??m a beginner at Perl and trying to do a dumb sript ( using shell commands ) only for test.
I got a crab message:
Can't locate shell.pm in @INC (@INC contains: /opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi
/opt/perl/lib/site_perl/5.6.1 /opt/perl/lib/site_perl .) at ./ola line 2.
BEGIN failed--compilation aborted at ./ola line 2.
Somebody has an idea ?
The script is in the attachment.
Solved! Go to Solution.
01-16-2002 10:54 AM
find / -type f -name "[Ss]hell.pm"
then you will need the Config.pm, so find it:
find / -type f -name "[Cc]onfig.pm"
Now, set your PERL5LIB path variable:
like I have:
live free or die
01-16-2002 11:14 AM
Tks man !
I did what you told me and it works. The problem now is only the following:
How to right execute shell commands inside a Perl script, like the simple DATE command ?
I tried but no way !
01-17-2002 02:45 AM
For sure that for that I dont need the shell. But sometimes its necessary like a FTP, TELNET or other shell interaction.
How to do in this way ?
01-17-2002 06:12 AM
Here you will find Clay's ftp using perl example:
And for telnet:
live free or die
01-17-2002 07:32 AM
Since Harry has already posted a link to one of my FTP examples the only thing left to emphasize is that the Net::FTP module is not a part of bundled Perl but must be downloaded and installed from http://www.perl.org/CPAN.
I will add one other comment from my teeny-tiny Perl knowledge and that is the the Shell module is seldom used. There's nothing wrong with it; it's just that there are generally better ways to do it within Perl.
If you don't already have them you really need to purchase the O'Reilly Perl books; the learning curve for perl is rather steep because the language is so rich.