Ronnie has asked for the wisdom of the Perl Monks concerning the following question:

Foos yer doos bretheren?! (Local Doric dialect for how are you keeping brothers!) Does anyone know how to call the chgrp module? We are not in charge of our own software and as such our support team installs any Perl modules required. I had chmod & chgrp installed today but - support assure me it has been installed - i can't load/access/run chgrp! (chmod is actually File::chmod). The use chgrp line in my code causes the usual @INC message when a module has not been located. Don't hold back I must be doing something so silly not even I can spot it - any ideas?
#!/usr/bin/perl -w # ############################################################### # Extra Modules should be declared here. # # All these modules MUST be found on the server attempting to # # call this script. # ############################################################### # use strict ; # Enforce private + variables use lib '/home/interface/scripts/Perl_Modules' ; # Where ACC_Vario +us lives use lib '/home/interface/sectran/lib' ; # Where SECTRAN l +ives use sectran ; # In-House FTP Pe +rl Module use Cwd ; # Current Working + Directory Module use Mail::Sender; # Email module use File::Find ; use File::chmod ; use chgrp ; # print "\n\tMod Test Starts\n" ; # my $file = 'xxrctest' ; chgrp save $file or die "\n\tNo kin n d min ::$!\n" ; print "\n\tMod Test Ends\n" ;
Cheers, Ronnie
I've been informed that you can't use "use chgrp" as it is a script not a module. That said if i remove the "use chgrp" I get the following error -
Mod Test Starts Can't locate object method "chgrp" via package "save" (perhaps you for +got to loa d "save"?) at Mod_test.pl line 23. $
Still non the wiser!

Replies are listed 'Best First'.
Re: Anyone used the chgrp module?
by monkey_boy (Priest) on Oct 20, 2005 at 12:29 UTC
    looking at the source , this is a script not a module, thus you cant "use" it.



    This is not a Signature...
Re: Anyone used the chgrp module?
by Moron (Curate) on Oct 20, 2005 at 13:23 UTC
    To use a file that isn't a module:
    require 'filename';
    Update: And (in view of subsequent reply) to execute another perl program...
    do 'filename';

    -M

    Free your mind

      Yes, but this is not a library of functions, its just a script & meant to be run stand-alone, not imported into another script.



      This is not a Signature...