Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

package require tar

by doomrak (Initiate)
on Nov 29, 2009 at 09:01 UTC ( #809980=perlquestion: print w/replies, xml ) Need Help??
doomrak has asked for the wisdom of the Perl Monks concerning the following question:


I have a tcl script calling a lot of perl scripts.

In the beginning of one of the scripts is the command:
#!/bin/sh #\ exec wish "$0" "$@" package require tar
The use is later on down the script in the following lines:
cd [file dirname $source] tar::create /tmp/directoryCopy.[pid].tar [file tail $source] cd $pwd cd $dest tar::untar /tmp/directoryCopy.[pid].tar file delete -force /tmp/directoryCopy.[pid].tar cd $pwd
As soon as I run the script,I get the error message:
Error in startup script: can't find package tar while executing "package require tar" (file "package.tcl" line 6)

could you pls help me debug the reason for the error?

thanks karuna

Replies are listed 'Best First'.
Re: package require tar
by holli (Monsignor) on Nov 29, 2009 at 09:57 UTC
    There is no tar module on cpan, so you are probably missing a custom module of your shop/organization/whatever. where did you get the script from?


    You can lead your users to water, but alas, you cannot drown them.
Re: package require tar
by angiehope (Pilgrim) on Nov 29, 2009 at 10:07 UTC
    Hi! What operating system do you use?
    It looks like your shell script can't call tar to unpack the tar file in /tmp .
    Tcl itself can process tar files using the tcllib package.

    If you wanted to rewrite the shell script using Perl, I would install Archive::Tar

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://809980]
Approved by broomduster
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2017-11-19 14:55 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (281 votes). Check out past polls.