in reply to How to Teach artists Perl w/out Modules

I would not just copy and paste the code you need. Create a local directory on your machine and save the CPAN files (which should be available in an archive format) on your hard drive or locker space or whatever is the easiest. Most universities with Unix systems can create public lockers that users can mount, or maybe you can share this in your home directory for others to use.

Then towards the top of the file

use lib "/path/to/mycpan";

You will be able to use most, if not all, modules as if you had installed them through the normal convention.

A good module to use might be GD

Replies are listed 'Best First'.
Re: [1] How to Teach artists Perl w/out Modules
by Intrepid (Curate) on Jan 30, 2004 at 22:51 UTC
    flyingmoose wrote:
    I would not just copy and paste the code you need. Create a local directory on your machine and save the CPAN files (which should be available in an archive format) on your hard drive or locker space or whatever is the easiest.

    Right. This is the right answer nearly all the time, I think. In this case particularly, modules that deal with images are very complex, usually use xsubs, and so on. Cutting-and-pasting is not likely to work out well.

    One question I have (for the OP) is "why targa (.tga)?" That's one of the odder and more difficult formats to work with. GD supports PNG (IMHO, the best format for this case), JPEG and so forth, and PerlMagick/ImageMagick.pm supports .tga and many others, but is much more difficult to install than GD. For starters I would recommend working in the PNG format, doing any pre-conversion of .tga to .png necessary.

        Soren A / somian / perlspinr / Intrepid

    -- 
    Cynicism is not "cool" or "hip" or "intelligent". It's like Saddam Hussein's piss mixed
    with 004 grit and nitric acid. It's corrosive to everything it touches, destructive to
    human endeavors, foul and disgusting. And ultimately will eat away the insides of the
    person who nurtures it.
time consuming to get right modules by hand
by g00n (Hermit) on Jan 31, 2004 at 05:24 UTC
    Create a local directory on your machine and save the CPAN files (which should be available in an archive format) on your hard drive or locker space or whatever is the easiest.

    ohh, this is a horrible way to do things. I know I've done this and would not recommend it. Why? CPAN modules are built much like LEGO. A lot of the image modules may be built upon other modules. So you require all the parent modules of the module you choose.

    I had to use this method (no net connection) to download, install a complex system using many CPAN modules. Downloading and installing by hand is bad, frustrating and slow.

      ... unless you want to waste a whole afternoon or evening, find an alternative.

    What system are you using? (Windows? - Can you install Cygwin?) or Do you have access to a laptop with net access so you can install the CPAN modules. Using CPAN to download modules is good.

      CPAN -e
      ls AUTHORNAME
      get AUTHORNAME/CPAN_MODULENAME

    At least you can use the systems side by side with the possibility of transferring working code from the laptop to target machine.

      It's linux w/ a non persistant home directory, ie. they delete whatever's in our homespce every night so we have to back up stuff onto cds. To make matters worse the school's tech policy was written in the windoews days and explicitly states no executables of any form should be installed.
        You could install modules onto a cd and use them with the appropriate use lib 'whatever'.

        Dominus talks about a simple graphics format PPM in his sample solution to his expert qotw #7. Your linux system may already have the cjpeg converter or some other installed.