Re: using Template effectively

Discussion in 'Perl Misc' started by Peter J. Holzer, Aug 21, 2012.

  1. On 2012-08-21 15:13, Ben Morrow <> wrote:
    > Quoth Ben Morrow <>:
    >> 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.hjp.at/ | -- Bill Code on
     
    Peter J. Holzer, Aug 21, 2012
    #1
    1. Advertising

  2. Ben Morrow <> writes:
    > Quoth "Peter J. Holzer" <>:


    [...]

    >> 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.
     
    Rainer Weikusat, Aug 21, 2012
    #2
    1. Advertising

  3. On 2012-08-21 20:56, Ben Morrow <> 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.
    | | | |
    __/ | http://www.hjp.at/ | -- Bill Code on
     
    Peter J. Holzer, Aug 21, 2012
    #3
  4. Ben Morrow <> 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 ...
     
    Rainer Weikusat, Aug 22, 2012
    #4
  5. with <> 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
     
    Eric Pozharski, Aug 22, 2012
    #5
  6. Ben Morrow <> 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.
     
    Mart van de Wege, Aug 22, 2012
    #6
  7. On 2012-08-23 04:08, Cal Dershowitz <> wrote:
    > On 08/21/2012 03:48 PM, Peter J. Holzer wrote:
    >> On 2012-08-21 20:56, Ben Morrow <> 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.
    | | | |
    __/ | http://www.hjp.at/ | -- Bill Code on
     
    Peter J. Holzer, Aug 23, 2012
    #7
  8. Cal Dershowitz <> 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.
     
    Rainer Weikusat, Aug 23, 2012
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. J. Gleixner

    Re: using HTML::Template effectively

    J. Gleixner, Jun 26, 2012, in forum: Perl Misc
    Replies:
    0
    Views:
    477
    J. Gleixner
    Jun 26, 2012
  2. Peter Makholm

    Re: using HTML::Template effectively

    Peter Makholm, Jun 27, 2012, in forum: Perl Misc
    Replies:
    0
    Views:
    455
    Peter Makholm
    Jun 27, 2012
  3. Rainer Weikusat

    Re: using HTML::Template effectively

    Rainer Weikusat, Jun 27, 2012, in forum: Perl Misc
    Replies:
    4
    Views:
    492
    Ivan Shmakov
    Jul 7, 2012
  4. Rainer Weikusat

    Re: using Template effectively

    Rainer Weikusat, Aug 21, 2012, in forum: Perl Misc
    Replies:
    0
    Views:
    350
    Rainer Weikusat
    Aug 21, 2012
  5. Rainer Weikusat

    Re: using Template effectively

    Rainer Weikusat, Aug 21, 2012, in forum: Perl Misc
    Replies:
    0
    Views:
    338
    Rainer Weikusat
    Aug 21, 2012
Loading...

Share This Page