Where is the Image::Size Perl Module?

software development

#1

Hiya, folks…

[I sent this to supprt via the form, but if somebody here knows what’s up, I could use a pointer…]

KBase says at:

https://kbase.newdream.net/index.cgi?area=996&keyword=Image::Size

…that the Image::Size Perl module is installed by default, but when I:

use Image::Size;

…the error log says:


Can’t locate Image/Size.pm in @INC (@INC contains: /usr/lib/perl5/5.005/i386-linux /usr/lib/perl5/5.005 /usr/local/lib/site_perl/i386-linux /usr/local/lib/site_perl /usr/lib/perl5 .)

I’m able to directly “use” other PMs this way, without having to push() a new path onto @INC… Is there some reason I need to push() some unusual path onto @INC for this particular module?

Or is the module not really installed? Are there other modules that are listed in the KBase that aren’t installed?

And… is there some way to list all the PMs on a machine?

The machine is gradius…

Thanks…

…Bob W.


#2

[Once again, I’m rudely following up to myself, but I think this discussion needs public review.]

Dream Host Support wrote:

[quote]Bob W. wrote:

[quote]You guys crack me up…
[/quote]

That’s great, we aim to please.

[/quote]

I’m pretty sure I answered this with the last response, but here are
more details (I know you love details):

[/quote]

Hey, take a gander at the response I just sent to []. You’ll love it.

In short–probably. See the next part for explanation.

[quote]If so, could we either correct the KBase list, or check all the
machines to make sure the defaults are really installed? I just don’t
want to run into this again with other modules that are supposed to
be there already.
[/quote]

Well, as I tersely told you before, “Not really.” The list from KBase
is not a definitive list.

[/quote]

Ah. The KBase post makes it sound that way…

[quote]It probably does not reflect every perl
module on the machines, and some machines may be inconsistent. I’ll
update that KBase entry now to include a disclaimer.

[/quote]

Thanks!

[quote]We are working on making all machines 99% consistent on installed
software (in fact it’s what I’m doing right after I finish writing
you), but we aren’t there yet. They are more like 90% at this point.

Having the installed Perl modules be consistent is extremely important
to us (as it allows machines to be totally redundant). However, listing
every installed Perl module isn’t.

It’s hard to list every installed Perl module. We could maybe write a
script to find all files named .pm and parse the module name from the
path preceding the filename and automatically put that list in KBase,
but that isn’t top on our list of priorities.

[/quote]

That would be a beautiful thing, and it would avoid users’ having to run into a brick wall before writing to Support.

[quote]Like I said before, if a module you want to use isn’t installed, in 9
out of 10 cases we’ll have it installed for you in a couple of hours.
We also have the “standard” modules that come with perl5 for sure and
most other extremely popular modules.

To be frank, I don’t know why you want a 100% accurate list.

[/quote]

Weird. I don’t know why anyone wouldn’t want a 100% accurate list (more below).

[quote]I don’t
see how it would help you (other than to make us less busy writing tech
support back to you).

[/quote]

That’s partially the point. Hey, why add the extra work for yourself and the user? It’d just be nice to know what’s there / not there so we know whether to start developing and testing a script, or instead to write and ask for installation.

If I know at 3pm that I’m going to need a module that’s not installed, it’d be best to write to support at that time, rather than having to wait until 3am when I’m ready to start testing… and find out it’s not there. (I’m assuming 3am installs don’t happen as fast as 3pm installs).

I think the more imprtant point is that the KBase entry is incorrect. Those modules aren’t really installed by default… So, if the KBase entry just said what you said above – that not all machines have all modules listed – then I wouldn’t have had to ask if that’s the case (and you wouldn’t have had to reply ).

[quote]If a module is missing we will install it
extremely quickly.

[/quote]

You’ve proven that (during daylight hours, at least).

[quote]So please be a little more understanding and cut us just a tiny bit of
slack here.

[/quote]

Slack? HUH?

[quote]I just reread this response and am hoping you aren’t put
off by its slightly surly tone. I’m just trying to give it to you
straight. I apologize if I seem like a jerk.

[/quote]

Sorry, but I have absolutely no idea why you’re offended.

All I asked was what modules are installed, and what modules are listed as being installed when they’re not. The KBase item is incorrect, so I just needed clarification. I didn’t ask you to do anything but give me information.

Maybe you’re having a bad day, eh?

[quote]So, I’m sorry we won’t be updating that list (maybe I’ll do it on a
slow day),

[/quote]

The disclaimer will serve that purpose just fine in the interim… thanks.

[quote]but in the meantime, have fun with Image::Size!

[/quote]

I’ve already got the script up and running. Works like a charm!

Thanks…

…Bob W.


#3

Here’s my reply to Bob’s TS message:

First off I’d like to apologize for giving you a little sass in the last response. I feel bad about it. I just didn’t understand your situation fully.

[quote]Ah. The KBase post makes it sound that way…

[/quote]

I’ve updated the KBase article to reflect the fact that the list is not always definitive, as well as adding instructions for how to test whether a Perl module is installed (which I think is the root of your problems).

[quote]That would be a beautiful thing, and it would avoid users’ having to run
into a brick wall before writing to Support.

[/quote]

Well, I guess one of the reason I responded the way I did is that I assumed that you knew how to very quickly check whether a Perl module is installed. In the future when you need to do this, simply write a small script that use-s the modules you need:

use Some::Thing;
use Other::Stuff;

or just type “perl -MSome::Module” on the commandline. If you don’t get an error, you’re golden.

[quote]If I know at 3pm that I’m going to need a module that’s not installed,
it’d be best to write to support at that time, rather than having to wait
until 3am when I’m ready to start testing… and find out it’s not there.
(I’m assuming 3am installs don’t happen as fast as 3pm installs).

[/quote]

Well, I just figured that you knew how to test whether Perl modules were installed. Or at the very least if it was such a looming concern why you wouldn’t just write a small script that attempts to “use” them at the start. Now that I know you didn’t know
how to do that, I understand where you’re coming from. I just looked at your 4/5 expertise rating and jumped to conclusions.

[quote]Slack? HUH?

[/quote]

I thought you were pressing me on a very insignificant detail for no reason. I apologize. I didn’t realize you didn’t know how to test whether you could use a Perl module. The length of your reply was daunting and implied a gravity that the situation
(from my perspective) did not at all warrant.

[quote]All I asked was what modules are installed, and what modules are listed
as being installed when they’re not. The KBase item is incorrect, so I
just needed clarification. I didn’t ask you to do anything but give me
information.

[/quote]

Well, the question is simple, but the answer would have been difficult to discover and is, in the end, not particularly useful. I’m sorry for being short with you! I’ll be more understanding in the future, I promise!

[quote]Maybe you’re having a bad day, eh?

[/quote]

It’s getting better!


#4

And here’s my reply to Nathaniel’s reply to my TS message:

Hi, Nathaniel…

You wrote:

[quote]First off I’d like to apologize for giving you a little sass in the
last response. I feel bad about it. I just didn’t understand your
situation fully.

[/quote]

Hey, don’t worry about it. I think I may tend to confuse people; I can sound like I know what I’m doing, but I have major gaps in my knowledge…

I’ve updated the KBase article to reflect the fact that the list is not
always definitive, as well as adding instructions for how to test
whether a Perl module is installed (which I think is the root of your
problem).

[/quote]

Thanks!

[quote]or just type “perl -MSome::Module” on the commandline. If you don’t get
an error, you’re golden.

[/quote]

Too easy. Thanks!

[quote]Well, I just figured that you knew how to test whether Perl modules
were installed. Or at the very least if it was such a looming concern
why you wouldn’t just write a small script that attempts to “use” them
at the start. Now that I know you didn’t know
how to do that, I understand where you’re coming from. I just looked at
your 4/5 expertise rating and jumped to conclusions.

[/quote]

Ah… Yeah, I’m at 4/5 in some areas, and 0/5 in others, I guess. Maybe I should always just mark myself as a 0 so I can get all my knowledge gaps plugged.

<lots of unnecessary (but still appreciated) grovelling snipped>

It’s getting better!

[/quote]

Good!

Thanks for the help.

…Bob W.


#5

Why don’t you go ahead and download the module yourself? There’s no harm in downloading and installing a trusty module into your root directory and point your perl programs to there.

I’ve done this with a Date::Calc module I needed a while back.

You should write to Tech Support just to get confirmation, or to ‘authorise’ this I suppose. I’m sure they would appreciate knowing what’s running on their systems.

Wil


#6

You should write to Tech Support just to get confirmation, or to ‘authorise’ this I suppose. I’m sure they would appreciate knowing what’s running on their systems.

We have no problems with any code run from a user’s directory, as long as it complies with the usual issues (ie. nothing that poses a security threat, bogs down the server, etc).

We’re pretty liberal on that kind of stuff, as far as hosts go. Probably because most of us couldn’t stand not having at least a little freedom (I imagine many of us piggy-backed on university servers way-back-when, and disliked silly restrictions then as much as we do now).

So yeah, download away. If it’s something you think lots of other people might want as well, though, let us know.

  • Jeff @ DreamHost
  • DH Discussion Forum Admin

#7

Yes. As I said, I did this a while back with a paticular date manipulation module. I installed it locally at first (I have a machine setup the same as egon for local testing :-)) and then uploaded to one of my folders. When satisifed, I sent a note suggesting the package be added to the global module list, which it did.

What more could I ask for? As always, great service.

Wil


#8

Well, I would have done that, but the KBase article said it should be on the server already… and since I’m still a total hack in some ways, I thought the module was there, but there might be something different I needed to do.

I didn’t realize that the KBase article – which said that all of the listed modules were part of the default installation – was wrong. Nate said he’s posted a caveat there now, so that confusion is gone.

Like I said, I’m a total hack in some ways, so also I feel safer getting the scoop from TS or getting them to install the module (as they volunteered) than I would feel if I were to attempt to install it myself.

Now that I know that article was wrong, I understand what’s up… and since Nate’s offered an easy method for detecting module presence, I’m all set.

BTW-- I’m using the Image::Size module to help create a self-publishing system for my clients. It’ll free me up to do more design and less maintenance.

Anyway, thanks for the suggestion…

…Bob W.


#9

As I was telling Wil, I just thought it might be there, and I was screwing up.

Since Image::Size is supposed to be a part of the default install, I figured I’d let TS take care of me…

Thanks!

…Bob W.


#10

I’ve found that a lot of the systems are not running the default setup.

As you may have noticed from a few replies to my messages on this forum; a few servers are running Analog 4 while others are on 5.

Same with Perl I think? Some servers are still on Perl 5.004(have to check my figures) while others are up to 5.5x

Cheers

Wil


#11

In theory everything should be pretty much identical; in actual practice there are a few machines that are off. we do make an effort to ensure that the hosting machines (which we lovingly refer to as ‘peons’) are pretty much identical so that if we have to swap one out quickly we can do so without things going awry. this was one of the main problems with dh1 - it was difficult to move users or swap machines if there was some sort of machine failure. we’re working on some stuff now which will keep all the machines even further in sync.

w/r/t perl modules, there’s never a problem with installing perl modules in your home dir, and this is actually probably the best way to go if you have esoteric perl modules your scripts require.

you can use a simple ‘use lib’ statement to include these perl modules, and installing perl modules from source is usually super easy.

the reason it’s more difficult for us and sometimes takes a while is that we have to make debian packages of them and then distribute them everywhere for consistency. this is much more difficult than simply using cpan or installing from the tarball.

i think all the machines are running perl 5.005 but don’t quite me on that. i’m almost certain we’re not running 5.5 or 5.6 anywhere (is there even a 5.5? i thought 5.6 was directly after 5.005 but i could be wrong… i don’t know that much about perl). yes - I just checked and all dh2 web machines are running the exact same version - 5.005_03. if you find 5.004 anywhere (perl -v or perl -V) let me know and i’ll look into it.


#12

Yes. I was wrong on the point of perl. I remember this question arising a while back and I believe the answer was that you were having some difficulties with the latest version of perl on a test machine.

I think the follow-up to that was that you were actually waiting for woody to be released with the latest, stable version of perl running on that.

I agree with you re modules, however. It is much easier for me to use cpan to install modules into my local directory. As I mentioned, if I think the module is a good one, I’ll pass on the information to support and see if they are interesed in adding it to the standard dist. Most of the time however, it’s me wanting some silly math function .

Cheers

Wil


#13

[color=#CC0000]> And… is there some way to list all the PMs on a

[quote]machine?[/color]

[/quote]

[code] #!/usr/bin/perl

use File::Find;

foreach $start (@INC) { find(&modules, $start); }

sub modules {
if (-d && /^[a-z]/) { $File::Find::prune = 1; return; }
return unless /.pm$/;

my $filename = “$File::Find::dir/$_”;
$filename =~ s!^$start/!!;
$filename =~ s!.pm$!!;
$filename =~ s!/!::!g;
print “$filename\n”;
}
[/code]


#14

Thanks, Wil!

Did you write that, or find it somewhere? I like to make sure there’s an author attribution on scripts I save, just so’s I know whether it’s safe to use them later on, and for giving credit where it’s due…

And the list is great. Shows everything. I also noticed that Image::Size is the last one listed, since it was the latest to be installed.

Thanks again…

…Bob W.


#15

That was taken from the Perl FAQ. It’s just a simple sub though, you could probably write an even simpler than that without the use of a Module, actually.

http://www.perlfaq.com/cgi-bin/view?view_by_id=205

Cheers

Wil


#16

I was looking at…

http://www.perldoc.com/perl5.6/pod/perlfaq.html

…and didn’t find anything like it.

I don’t know why I’d forgotten to look at Perlfaq.comduh!

Thanks…

…Bob W.


#17

Take a look at this one too from Jeff [color=#CC0000]japhy[/color] Pinyan:

http://www.crusoe.net/~jeffp/programs/modlist

He’s just basicaly added a HTTP header to output results to a browser.

Wil


#18

Hey, Wil…

Yeah, that’s pretty much what I did to get the list I was referring to in:

http://discussion.dreamhost.com/showthreaded.pl?Cat=&Board=forum_programming&Number=1044

Thanks!

…Bob W.