Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Env:Modulecmd issue

by TeTeKe (Initiate)
on May 10, 2017 at 21:48 UTC ( #1190014=perlquestion: print w/replies, xml ) Need Help??

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

Hi,
I'm using Env::Modulecmd (after some searching) in my perl script trying to load my environment module, but somehow it's not working.
Here's a simple command line example,

% perl -e 'use Env::Modulecmd { load => 'VDIkit' }'

This produced the error message below:

Unable to execute 'modulecmd perl load VDIkit':
-> No such file or directory
Error loading module VDIkit at -e line 1
BEGIN failed--complilation aborted at -e line 1.

Please advise,
teteke

Replies are listed 'Best First'.
Re: Env:Modulecmd issue
by Mr. Muskrat (Canon) on May 10, 2017 at 22:17 UTC

    The documentation for Env::Modulecmd indicate that the the "module" should exist in your PATH. Is VDIkit in one of the directories within your PATH?

      thanks for the reply.

      Yes, 'VDIkit' module exists on my module path setting $MODULEPATH. Under linux, I can load it fine with "% module load VDIkit"
      teteke
        But do you have a bin/modulecmd or bin/module or whatever its called in your $PATH?
Re: Env:Modulecmd issue
by thanos1983 (Parson) on May 10, 2017 at 23:18 UTC

    Hello ,

    Why don't you want to load your module normally, is there any reason?

    For example:

    #!/usr/bin/perl use strict; use warnings; =alternative BEGIN { push ( @INC,"/home/tinyos/Monks/"); } use My::Math qw(add); =cut use lib qw(/home/tinyos/Monks); use My::Math qw(add); my $addition = add(19, 23); print $addition . "\n"; __DATA__ $ perl test.pl 42

    In my dir /home/tinyos/Monks I have my module My::Math or My/Math.pm.

    Sample of module for replication purposes:

    package My::Math; use strict; use warnings; use Exporter qw(import); our @EXPORT_OK = qw(add multiply); sub add { my ($x, $y) = @_; return $x + $y; } sub multiply { my ($x, $y) = @_; return $x * $y; } 1;

    Simple straight forward and the job is done.

    Hope this helps.

    Seeking for Perl wisdom...on the process of learning...not there...yet!
      My modules are environment modules, which are used to setup environment variables for specific EDA tools (cadence,mentor,etc..) so they can be invoked correctly.
      Thanks,
      teteke

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1190014]
Approved by beech
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2022-07-01 10:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (98 votes). Check out past polls.

    Notices?