Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Re: using Template effectively

Reply
Thread Tools

Re: using Template effectively

 
 
Peter J. Holzer
Guest
Posts: n/a
 
      08-21-2012
On 2012-08-21 15:13, Ben Morrow <(E-Mail Removed)> wrote:
> Quoth Ben Morrow <(E-Mail Removed)>:
>> Linux distributions have a very nasty habit of splitting the perl core
>> into several packages. You will need to locate and install them all to
>> get a properly-functioning perl install.


Fortunately the error message clearly told Cal the name of the missing
package, so locating and installing it shouldn't be that hard.

>> Going from the information on
>> packages.debian.org, it looks like you need
>>
>> libcgi-fast-perl
>> libperl-dev
>> libperl5.14
>> perl-base
>> perl-doc
>> perl-modules

>
> A correction: it looks like you need
>
> perl
>
> as well. I was under the impression perl-base and perl were
> alternatives, but apparently you need both.


Yes, perl-base is a minimal perl package intended to run simple scripts
(it includes only /usr/bin/perl and the most essential core packages)
while perl contains the rest of the core (some of it indirectly through
perl-modules) except the documentation. So if you want to run perl
programs you normally install perl (which sucks in perl-base,
perl-modules and a lot of other stuff through dependencies) and if you
want to develop perl programs you install perl and perl-doc.

I don't think you need libperl5.14 or libperl-dev unless you want to
embed perl in another program. And of course you only need
libcgi-fast-perl if you want to use FastCGI (which doesn't seem to be
the case here but maybe Cal has mentioned it in another thread).

hp


--
_ | Peter J. Holzer | Deprecating human carelessness and
|_|_) | Sysadmin WSR | ignorance has no successful track record.
| | | http://www.velocityreviews.com/forums/(E-Mail Removed) |
__/ | http://www.hjp.at/ | -- Bill Code on (E-Mail Removed)
 
Reply With Quote
 
 
 
 
Rainer Weikusat
Guest
Posts: n/a
 
      08-21-2012
Ben Morrow <(E-Mail Removed)> writes:
> Quoth "Peter J. Holzer" <(E-Mail Removed)>:


[...]

>> And of course you only need libcgi-fast-perl if you want to use
>> FastCGI (which doesn't seem to be the case here but maybe Cal has
>> mentioned it in another thread).

>
> Well, CGI::Fast has been part of the core forever (since 5004), so CPAN
> modules can quite reasonably assume it will be there without declaring
> an explicit dependancy.


CPAN modules have been developed with a specific, packaged perl
distribution in mind (and its not that this specific packaged perl
distribution wouldn't change) ...

> IMHO anything less than 'everything installed by a normal manual
> perl install' is risky, unless you will only be using perl to run
> things installed from packages


.... and installing modules packaged for this specific distribution
might require additional work when they are supposed to be used with
other distributions.

> At which point I have to ask: what on Earth is all this supposed to
> achieve? A space saving of a few MB, at the cost of leaving users who
> don't know all these details with an incomplete mess that can't be
> trusted to run anything that hasn't been specifically tested against
> that environment?


Actually, no software downloaded from some random location on the
internet, including random other 'software distribution point' can be
'trusted to run' on a system it wasn't tested with. That's why users
of 'Linux distributions' are usually encouraged to stick to software
packaged for their distribution --- it has been tested with it, is
actually considered to be sufficiently bug free for a general release
and there's a 'well-known address' for dealing with bugs, as opposed
fiftythousand e-mail addresses distributed throughout a labyrinth of
four times as many web pages, half of which used to be used by people
who meanwhile died.
 
Reply With Quote
 
 
 
 
Peter J. Holzer
Guest
Posts: n/a
 
      08-21-2012
On 2012-08-21 20:56, Ben Morrow <(E-Mail Removed)> wrote:
> At which point I have to ask: what on Earth is all this supposed to
> achieve? A space saving of a few MB,


About 50 MB, actually, which is about 1/4 of the size of a minimal
Debian installation. Given the choice between increasing this size by
25% or replacing every perl perl essential perl script by one in a
different language, most Debian developers would probably prefer the
latter. Much of this is historical, of course, but there are still
embedded systems with very little space.

> at the cost of leaving users who don't know all these details with an
> incomplete mess that can't be trusted to run anything that hasn't been
> specifically tested against that environment?


Frankly, anyone who can't be bothered to type "apt-get install
libfoo-bar-perl" when a perl script complains about a missing Foo::Bar
module shouldn't even try to use CPAN. He's almost guaranteed to trip
over the first module which includes some XS code.

hp


--
_ | Peter J. Holzer | Deprecating human carelessness and
|_|_) | Sysadmin WSR | ignorance has no successful track record.
| | | (E-Mail Removed) |
__/ | http://www.hjp.at/ | -- Bill Code on (E-Mail Removed)
 
Reply With Quote
 
Rainer Weikusat
Guest
Posts: n/a
 
      08-22-2012
Ben Morrow <(E-Mail Removed)> writes:

[...]

>> Frankly, anyone who can't be bothered to type "apt-get install
>> libfoo-bar-perl" when a perl script complains about a missing Foo::Bar
>> module shouldn't even try to use CPAN. He's almost guaranteed to trip
>> over the first module which includes some XS code.

>
> In which case the Debian package should include a CPAN.pm modified to
> loudly print 'DO NOT USE THIS. USE .debS INSTEAD, OR BUILD YOUR OWN
> PERL.' every time it's used,


That would be rather annoying, given that some people use cpan because
they need or want to, not just because they've been tricked into doing
it for no good reason ...
 
Reply With Quote
 
Eric Pozharski
Guest
Posts: n/a
 
      08-22-2012
with <(E-Mail Removed)> Ben Morrow wrote:
*SKIP* [[ jeez ]]

Then,.. I assume, you propos to raid debian, or something?

--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
 
Reply With Quote
 
Mart van de Wege
Guest
Posts: n/a
 
      08-22-2012
Ben Morrow <(E-Mail Removed)> writes:

> But 'apt-get install perl' should install a complete perl
> distribution, including everything, in way which is consistent with
> the installed Config.pm.


It does. 'perl' drags in 'perl-modules' as well, giving a complete perl
install.

It *doesn't* pull in perl-doc by default, but anyone installing Debian
*should* known that Debian doesn't auto-install documentation packages
anyway.

Of course, anyone installing Ubuntu is not supposed to worry about that,
but that's *Ubuntu's* fault, for not patching their packages for this
use case.


--
"We will need a longer wall when the revolution comes."
--- AJS, quoting an uncertain source.
 
Reply With Quote
 
Peter J. Holzer
Guest
Posts: n/a
 
      08-23-2012
On 2012-08-23 04:08, Cal Dershowitz <(E-Mail Removed)> wrote:
> On 08/21/2012 03:48 PM, Peter J. Holzer wrote:
>> On 2012-08-21 20:56, Ben Morrow <(E-Mail Removed)> wrote:
>>> at the cost of leaving users who don't know all these details with an
>>> incomplete mess that can't be trusted to run anything that hasn't been
>>> specifically tested against that environment?

>>
>> Frankly, anyone who can't be bothered to type "apt-get install
>> libfoo-bar-perl" when a perl script complains about a missing Foo::Bar
>> module shouldn't even try to use CPAN. He's almost guaranteed to trip
>> over the first module which includes some XS code.

>
> Ouwa, peter, I understand the criticism, but from my perspective it's
> almost impossible to discern context on most of this.
>
> Q1) What warning/error would I have seen in order to know that I didn't
> have whatever comes with perl,


This thread has moved to a slightly different topic, but the error
message you quoted was:

| You need to install the perl-doc package to use this program.

So you just had to run

apt-get install perl-doc

(instead of apt-get you can of course use aptitude or the Ubuntu
Software Center or whatever your favourite way to install packages is).

In this case you don't even have to guess because it tells you exactly
what to do.

But this isn't what the last few messages were about. Ben was
complaining that some core modules (actually only one, CGI::Fast) are
not installed automatically when you install the "perl" package.

While this is strange (I have no idea why CGI::Fast was singled out) I
really don't think that it makes any difference: The package name
follows the same convention as for (almost) all non-core modules, so
when you try to run a FastCGI script and get an error message

Can't locate CGI/Fast.pm in @INC (@INC contains: ...)

you just invoke

apt-get install libcgi-fast-perl

just as you would invoke

apt-get install libtemplate-perl

if you got the message

Can't locate Template.pm in @INC (@INC contains: ...)

You really don't have to know or care that CGI::Fast is a core module
(in fact I didn't know that until this thread, although I've been using
it for years: If it's already installed in system that's nice, and if
it isn't installed, I know how to install it)

If you are going to administrate a Debian (or Ubuntu) system, you will
need a basic understanding of the Debian packaging system. There is no
way around that. And if you are going to use CPAN on a Debian/Ubuntu
system, you will need that, too. Because some packages on CPAN need
header files to compile and libraries to link against, and you will need
to know how to find and install the necessary development packages.

That was why I wrote that anybody who couldn't install CGI::Fast with
apt-get should steer clear of CPAN. If you know enough about Debian to
install arbitrary packages (either from the distribution repository or
CPAN), you won't even notice anything special about CGI::Fast. And if
you can't install CGI::Fast on a Debian system, you won't be able to
install any non-core module from the Debian repository or any module
which needs to compile something from CPAN, either. So the fact that
CGI::Fast is in a separate package is IMHO just a puzzling oddity, it
doesn't turn perl into an "incomplete mess".


> and in this context, I don't mean perl the language or perl the
> interpreter. Not perl the library. Apparently it's perl the module.


I have no idea what you mean by "perl the module".

hp


--
_ | Peter J. Holzer | Deprecating human carelessness and
|_|_) | Sysadmin WSR | ignorance has no successful track record.
| | | (E-Mail Removed) |
__/ | http://www.hjp.at/ | -- Bill Code on (E-Mail Removed)
 
Reply With Quote
 
Rainer Weikusat
Guest
Posts: n/a
 
      08-23-2012
Cal Dershowitz <(E-Mail Removed)> writes:
> On 08/21/2012 03:48 PM, Peter J. Holzer wrote:


[...]

>> Frankly, anyone who can't be bothered to type "apt-get install
>> libfoo-bar-perl" when a perl script complains about a missing Foo::Bar
>> module shouldn't even try to use CPAN. He's almost guaranteed to trip
>> over the first module which includes some XS code.

>
> Ouwa, peter, I understand the criticism, but from my perspective it's
> almost impossible to discern context on most of this.
>
> Q1) What warning/error would I have seen in order to know that I
> didn't have whatever comes with perl, and in this context, I don't
> mean perl the language or perl the interpreter. Not perl the library.
> Apparently it's perl the module.


[rw@sapphire]~ $perl -e 'use NoSuchModule;'
Can't locate NoSuchModule.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

That's an example of an error you get when some Perl code attempts to
use a module which isn't available. In this case, the obvious solution
is to install the missing module. As per Debian naming convention
(probably also used by Ubuntu) for that, a package providing a Perl
module named NoSuchModule should be called libnosuchmodule-perl.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: using Template effectively Rainer Weikusat Perl Misc 0 08-21-2012 03:37 PM
Re: using Template effectively Rainer Weikusat Perl Misc 0 08-21-2012 12:36 PM
Re: using HTML::Template effectively Rainer Weikusat Perl Misc 4 07-07-2012 04:56 AM
Re: using HTML::Template effectively Peter Makholm Perl Misc 0 06-27-2012 07:25 AM
Re: using HTML::Template effectively J. Gleixner Perl Misc 0 06-26-2012 08:25 PM



Advertisments