[25241] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 7486 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 5 18:05:45 2004

Date: Sun, 5 Dec 2004 15:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 5 Dec 2004     Volume: 10 Number: 7486

Today's topics:
    Re: FAQ 2.15: Archives of comp.lang.perl.misc <bik.mido@tiscalinet.it>
        FAQ 5.5: How do I make a temporary file name? <comdog@panix.com>
        FAQ 8.47: How do I keep my own module/library directory <comdog@panix.com>
        FAQ 9.3: How can I get better error messages from a CGI <comdog@panix.com>
    Re: File locking <joe@inwap.com>
    Re: File locking <nobull@mail.com>
    Re: GD Graph Pie Formatting <mgjv@tradingpost.com.au>
    Re: Golf... <bik.mido@tiscalinet.it>
    Re: Golf... <bik.mido@tiscalinet.it>
    Re: Golf... <wyzelli@yahoo.com>
    Re: How to kill all child processes except itself? <nobull@mail.com>
    Re: installing dbd::mysql via cygwin on windows <user@example.net>
    Re: Perl crashes <daveandniki@ntlworld.com>
    Re: read image file - and process the result <anon@toplevel.tld>
    Re: read image file - and process the result (Alx)
        Trying to install module with CPAN <two@telia.com>
    Re: Trying to install module with CPAN <jkeen_via_google@yahoo.com>
    Re: Trying to install module with CPAN <two@telia.com>
    Re: Trying to install module with CPAN <jkeen_via_google@yahoo.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 05 Dec 2004 10:06:00 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: FAQ 2.15: Archives of comp.lang.perl.misc
Message-Id: <2aj5r0hl3filtu40147b0hql5um1q5e75j@4ax.com>

On Sat, 4 Dec 2004 13:54:45 -0500, "Matt Garrish"
<matthew.garrish@sympatico.ca> wrote:

>Might do good to post this one in high rotation! (i.e., every day... : )

More seriously I *think* that the PerlFAQ Server's currently just
randomly selects the FAQ entry to post. I also think that in this
respect the selection algorithm should be made to work more on a
shuffling base, i.e. with no reposting of the same FAQ too soon and
with no FAQs failing to be sent in a reasonable amount of time.

Sorry for the bad wording, but this morning I couldn't express myself
any better. Hope you understood what I meant. At least I did...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Sun, 5 Dec 2004 23:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 5.5: How do I make a temporary file name?
Message-Id: <cp0435$6ds$1@reader1.panix.com>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.

--------------------------------------------------------------------

5.5: How do I make a temporary file name?

    Use the File::Temp module, see File::Temp for more information.

      use File::Temp qw/ tempfile tempdir /;

      $dir = tempdir( CLEANUP => 1 );
      ($fh, $filename) = tempfile( DIR => $dir );

      # or if you don't need to know the filename

      $fh = tempfile( DIR => $dir );

    The File::Temp has been a standard module since Perl 5.6.1. If you don't
    have a modern enough Perl installed, use the "new_tmpfile" class method
    from the IO::File module to get a filehandle opened for reading and
    writing. Use it if you don't need to know the file's name:

        use IO::File;
        $fh = IO::File->new_tmpfile()
            or die "Unable to make new temporary file: $!";

    If you're committed to creating a temporary file by hand, use the
    process ID and/or the current time-value. If you need to have many
    temporary files in one process, use a counter:

        BEGIN {
            use Fcntl;
            my $temp_dir = -d '/tmp' ? '/tmp' : $ENV{TMPDIR} || $ENV{TEMP};
            my $base_name = sprintf("%s/%d-%d-0000", $temp_dir, $$, time());
            sub temp_file {
                local *FH;
                my $count = 0;
                until (defined(fileno(FH)) || $count++ > 100) {
                    $base_name =~ s/-(\d+)$/"-" . (1 + $1)/e;
                    # O_EXCL is required for security reasons.
                    sysopen(FH, $base_name, O_WRONLY|O_EXCL|O_CREAT);
                }
                if (defined(fileno(FH))
                    return (*FH, $base_name);
                } else {
                    return ();
                }
            }
        }



--------------------------------------------------------------------

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-2002 Tom Christiansen and Nathan
    Torkington, and other contributors as noted. All rights 
    reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.


------------------------------

Date: Sun, 5 Dec 2004 11:03:02 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 8.47: How do I keep my own module/library directory?
Message-Id: <coupt6$nq0$1@reader1.panix.com>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.

--------------------------------------------------------------------

8.47: How do I keep my own module/library directory?

    When you build modules, use the PREFIX and LIB options when generating
    Makefiles:

        perl Makefile.PL PREFIX=/mydir/perl LIB=/mydir/perl/lib

    then either set the PERL5LIB environment variable before you run scripts
    that use the modules/libraries (see perlrun) or say

        use lib '/mydir/perl/lib';

    This is almost the same as

        BEGIN {
            unshift(@INC, '/mydir/perl/lib');
        }

    except that the lib module checks for machine-dependent subdirectories.
    See Perl's lib for more information.



--------------------------------------------------------------------

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-2002 Tom Christiansen and Nathan
    Torkington, and other contributors as noted. All rights 
    reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.


------------------------------

Date: Sun, 5 Dec 2004 17:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 9.3: How can I get better error messages from a CGI program?
Message-Id: <covf05$stf$1@reader1.panix.com>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.

--------------------------------------------------------------------

9.3: How can I get better error messages from a CGI program?

    Use the CGI::Carp module. It replaces "warn" and "die", plus the normal
    Carp modules "carp", "croak", and "confess" functions with more verbose
    and safer versions. It still sends them to the normal server error log.

        use CGI::Carp;
        warn "This is a complaint";
        die "But this one is serious";

    The following use of CGI::Carp also redirects errors to a file of your
    choice, placed in a BEGIN block to catch compile-time warnings as well:

        BEGIN {
            use CGI::Carp qw(carpout);
            open(LOG, ">>/var/local/cgi-logs/mycgi-log")
                or die "Unable to append to mycgi-log: $!\n";
            carpout(*LOG);
        }

    You can even arrange for fatal errors to go back to the client browser,
    which is nice for your own debugging, but might confuse the end user.

        use CGI::Carp qw(fatalsToBrowser);
        die "Bad error here";

    Even if the error happens before you get the HTTP header out, the module
    will try to take care of this to avoid the dreaded server 500 errors.
    Normal warnings still go out to the server error log (or wherever you've
    sent them with "carpout") with the application name and date stamp
    prepended.



--------------------------------------------------------------------

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-2002 Tom Christiansen and Nathan
    Torkington, and other contributors as noted. All rights 
    reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.


------------------------------

Date: Sun, 05 Dec 2004 10:16:32 GMT
From: Joe Smith <joe@inwap.com>
Subject: Re: File locking
Message-Id: <4eBsd.514832$D%.372544@attbi_s51>

Tintin wrote:

> Your test for file existence, not copy completion (unless NTFS buffers 
> everything before copying)

The Windows operating system not only has a mandatory write lock, it
has a mandatory read lock.  Opening a file for reading will fail
if the process doing the writing has not yet closed the file.


------------------------------

Date: Sun, 05 Dec 2004 11:25:20 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: File locking
Message-Id: <couqtu$12r$1@sun3.bham.ac.uk>


[ Please don't post TOFU. It is considered rude an will predispose 
people not to want to help you.  ]

MadDogMcGee wrote:
> "MadDogMcGee" <nospam@all.thx> wrote in message
> 
>>I want to process the contents of a file, but only when it's copied across
>>to the work folder. Some of the files take a few seconds to bring across.
>>How do I detect that the file is complete and ready for processing?
> 
> I seem to have solved my problem:

> 
> $file = "test.iso";
> 
> while (1) {
> 
>   if (open(FILE, "< $file")) {
>     print "Transfer completed\n";
>     close (FILE);
> 
>   }
>   else {
>     print "Not ready\n";
>   }
> 
> }
> 
> 
> 
> Is there anything undesirable about this approach?

It's a busy loop. Busy loops are undesirable on multi-taking system. 
You should pause for a non-zero time between unsucessful opens.

> Notes: I'm on an NT based system, and the file is being copied by a
> different program. I don't want to work on the file with Perl until it's
> finished being copied across.

This only works if the process writing the file is taking a manatory 
exclusive lock.  It also does not destinguish between a successful 
transfer and an one that dies before incompletion.

If it seems to be working then it would appear that the process writing 
the file is taking a manatory exclusive lock.  I'm not a expert on the 
intracacies of Windows' locking semantics.

As I and others have said this is not really a Perl question.



------------------------------

Date: 05 Dec 2004 22:26:13 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: GD Graph Pie Formatting
Message-Id: <slrncr72o9.haq.mgjv@verbruggen.comdyn.com.au>

On 30 Nov 2004 22:56:32 -0800,
	Pascal <pascal@straec.com> wrote:
> I am trying to create dynamic bar charts using data from a database
> and am having issues formatting it. The labels can be long so i use
> vertical labels but the font is small and hard to read. I try setting
> font but it doesn't make a difference. Am i doing something wrong?  I
> am using the following code:

> $my_graph->set_x_label_font=>(gdLargeFont);
> $my_graph->set_y_label_font=>(gdLargeFont);

set_*_label_font sets the font for the axis labels, not the value
labels. Use set_*_axis_font instead.

One day I'll clean up that terminology in the documentation and
finction names.

Martien
-- 
                        | 
Martien Verbruggen      | prepBut nI vrbLike adjHungarian! qWhat's
                        | artThe adjBig nProblem? -- Alec Flett
                        | 


------------------------------

Date: Sun, 05 Dec 2004 10:06:01 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Golf...
Message-Id: <e2j5r0t3ejcamha1im68de2ol46j7oiklv@4ax.com>

On Sun, 05 Dec 2004 04:45:15 GMT, "Peter Wyzl" <wyzelli@yahoo.com>
wrote:

>Subject: Golf...
          ^^^^
          ^^^^
[snip]
>looking for a good solution to represent this in dotted quad.  Since there 
>are many repetitions of this manipulation, efficiency is important.
                                            ^^^^^^^^^^
                                            ^^^^^^^^^^

Please note that in (Perl-)golfing efficiency is not an issue. The
subject may have been more accurate...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Sun, 05 Dec 2004 10:06:02 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Golf...
Message-Id: <o9j5r01ivnin9m63lfg3imo4b7vcrnlno6@4ax.com>

On Sun, 05 Dec 2004 06:10:23 GMT, "Peter Wyzl" <wyzelli@yahoo.com>
wrote:

>(guess who is finally starting to understand this function? :) And that's 
>even after reading MJD's excellent tutorial at I know not where (can't seem 
>to find it again)

I didn't know about that tutorial. Probably I'll search it @
plover.com, however out of curiosity can you please anticipate how it
compares in your opinion to 'perldoc perlpacktut'?


Just curious,
Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Sun, 05 Dec 2004 10:20:19 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: Golf...
Message-Id: <DhBsd.59812$K7.23436@news-server.bigpond.net.au>

"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message 
news:o9j5r01ivnin9m63lfg3imo4b7vcrnlno6@4ax.com...
: On Sun, 05 Dec 2004 06:10:23 GMT, "Peter Wyzl" <wyzelli@yahoo.com>
: wrote:
:
: >(guess who is finally starting to understand this function? :) And that's
: >even after reading MJD's excellent tutorial at I know not where (can't 
seem
: >to find it again)
:
: I didn't know about that tutorial. Probably I'll search it @
: plover.com, however out of curiosity can you please anticipate how it
: compares in your opinion to 'perldoc perlpacktut'?

Having a quick look...

seems they are one and the same... maybe I was reading too much of MJD's web 
site at the same time and confused them...

My apologies to Simon and Wolfgang, and thanks to you for reminding where 
the tut was...

:)

-- 
Wyzelli 




------------------------------

Date: Sun, 05 Dec 2004 12:02:50 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: How to kill all child processes except itself?
Message-Id: <cout48$215$1@sun3.bham.ac.uk>

zeal wrote:


> What I want to do is that kill all child processes after the timeout
> but keep the script itself alive. Actually I need to kill all processes
> (the whole process group) invoked from the system() call. The reason I
> need to use system is, I need to analysis the return value "$rc".
> In most cases, the system() can finish before the timeout, however, in
> some cases, it will time out, then I want to kill all the processes
> after the timeout.
> 
> The way I used to do the kill is
> -----------------------------
> local $SIG{INT} = 'IGNORE';
> kill INT => -$$;
> -----------------------------
> I got this from somewhere, it's said that when a SIG sent to a negative
> pid, it will be sent to the whole process group. Since I "INGORE"
> myself, then this shouls satisfy my requirement.
> 
> I run this script in LINUX system.
> Most of the case, it works fine. However, sometimes, I found that when
> the script is finished, some child processes are still running, which
> means that they were not killed.
> 
> And use "pstree -p", I found that those alive child processes's parent
> PID is changed, not the pid of the perl script process.

Is it 1 ?  When a process dies it's children are adopted by process 1.

Note that a process group is not the same thing as all the decentants of 
a process, it is all the processes with the same process group id.  When 
a process forks its new child will inherit the parent's PGID.  But any 
process can at any time decide to break away form its parent's process 
group and start its own (with a PGID equal to its PID).

I suggest you look at the PGID of the children that won't die to see if 
they have broken away from the group.

A neat trick that may help in this cases is to create the tree of 
subrocesses with STDERR/STDOUT redirected to a pipe or pipes then they 
all get killed with a SIGPIPE simply by closing these pipes. This  of 
course only works if they don't redirect STDERR and STDOUT.

This is all more to do with Unix/Linux than it is to do with Perl.



------------------------------

Date: Sun, 05 Dec 2004 17:54:04 GMT
From: Glenn <user@example.net>
Subject: Re: installing dbd::mysql via cygwin on windows
Message-Id: <0XHsd.6533$9M4.5840@news01.roc.ny>

Alan Mead wrote:
> On Sat, 04 Dec 2004 00:31:11 +0000, Glenn wrote:
> 
> 
>>I'm having an issue installing the DBD::mysql; it's complaining about 
>>not being able to find mysql_config.
>>
>>I've seen some posts regarding installing mysql-devel.. I'm unsure what 
>>this means.
>>
>>I have installed MySQL in Program Files _prior_ to my install of 
>>cygwin.. is this an issue in and of itself?
>>
>>Is it possible for someone to provide a template mysql_config file that 
>>I can plus in one of my cygwin dir's somewhere?
> 
> 
> If you can find it, a few days ago there was a thread about this and Paul
> Lalli, I think, posted a link to some DBD::mysql docs.  It looked as
> though it might be difficult to do this.  I agree with the other poster;
> you should see if there is someone in the mysql community that has done
> this and could help.
> 
> -Alan

OK, I'll check it out.. from what I see there are a bunch of 
"mailing.mysql" groups, then a mysql.users.  I'll post in the latter, 
although I didn't even see any posts in there.

If you know of a better group to post on, please let me know.

Thanks again for the responses

~Glenn


------------------------------

Date: Sun, 05 Dec 2004 14:40:10 GMT
From: "Dave" <daveandniki@ntlworld.com>
Subject: Re: Perl crashes
Message-Id: <e5Fsd.204$_n5.3@newsfe2-win.ntli.net>


"Steve Butler" <jodox@sbcglobal.net> wrote in message 
news:Emqsd.28722$zx1.26012@newssvr13.news.prodigy.com...
> Thanks for the feedback all! I sent in a bug via perldoc perlbug last 
> night.
>
> I neglected to mention my platform being windows xp. Sorry for any 
> confusion. Here is the perl -v loved by all:
>
> E:\My Projects\perl\chapter 6>perl -v
>
> This is perl, v5.6.1 built for MSWin32-x86-multi-thread
> (with 1 registered patch, see perl -V for more detail)
>
> Copyright 1987-2001, Larry Wall
>
> Binary build 638 provided by ActiveState Corp. http://www.ActiveState.com
> ActiveState is a division of Sophos.
> Built Apr 13 2004 19:24:21
>
> Perl may be copied only under the terms of either the Artistic License or 
> the
> GNU General Public License, which may be found in the Perl 5 source kit.
>
> Complete documentation for Perl, including FAQ lists, should be found on
> this system using `man perl' or `perldoc perl'.  If you have access to the
> Internet, point your browser at http://www.perl.com/, the Perl Home Page.
>
>
>
> "Steve Butler" <jodox@sbcglobal.net> wrote in message 
> news:gn8sd.38110$6q2.16464@newssvr14.news.prodigy.com...
>> Hi all,
>>
>> I have not posted here before. I am compelled to ask about this code 
>> snipet crashing perl.exe when attempting a perl -c:
>>
>> #!/usr/bin/perl -w
>> use strict;
>>
>> sub &total {
>>    my $sum;
>>    foreach (@_){
>>        sum+=$_;
>> }
>>
>> Basically I know the code is bad, but I never expected perl to crash on a 
>> syntax check. Should I send this bug somewhere or just not write bad 
>> code?
>>
>> Thanks!
>> Steve
>>
>
>

There is no problem with ActiveState perl 5.8.3 on XP (I just tested it), so 
I'd recommend updating. I don't know if anyone would be that interested in 
bug fixes for 5.6 these days.

Dave




------------------------------

Date: Sun, 05 Dec 2004 08:40:49 GMT
From: Gran <anon@toplevel.tld>
Subject: Re: read image file - and process the result
Message-Id: <lQzsd.41488$VL6.6200@clgrps13>

Alx wrote:

> I'd like to read an image file - in PBM/PGM format, to perform some
> processing on the image itself.
> I didnt find exactly what I need on CPAN:
> Image::Magick looks powerful, but it seems to let you read and apply
> the manipulation methods that itself provides - I'd like instead to
> just get a beautiful array @image=(00,FF,CC,...) with pixel color
> values.
> Do you happen to know what I could use?

How about gimp-perl?


> 
> Thanks a lot...
> 
> 
> Alessandro Magni



------------------------------

Date: 5 Dec 2004 10:30:09 -0800
From: nenamiele@libero.it (Alx)
Subject: Re: read image file - and process the result
Message-Id: <38d4c7d4.0412051030.6f167f10@posting.google.com>

> 
> How about gimp-perl?
> 

thanks for the suggestion - but at last I noticed it was an overkill.
PPM format is a well documented sequence of RGB ascii values: I just
wrote down the routine that reads them all in a 2D array of hashes.

Thanks!

Alessandro


------------------------------

Date: Sun, 05 Dec 2004 12:35:20 GMT
From: simon <two@telia.com>
Subject: Trying to install module with CPAN
Message-Id: <cgDsd.10261$d5.91334@newsb.telia.net>

Hi I've been trying for days to install the module MIME::Base64 with 
CPAN but no matter how I try it never seems to work. I am on SUSE 9.1, 
Perl is pre-installed: version 5.8.3. I am a total newbie when it comes 
to perl but I have scanned the Internet for answers and now turn to 
asking for help. Heres how it looks:


cpan> o conf
CPAN::Config options from /usr/lib/perl5/5.8.3/CPAN/Config.pm:
     commit             Commit changes to disk
     defaults           Reload defaults from disk
     init               Interactive setting of all options

     build_cache        10
     build_dir          /root/.cpan/build
     cache_metadata     1
     cpan_home          /root/.cpan
     dontload_hash
     ftp                /usr/bin/ftp
     ftp_proxy
     getcwd             cwd
     gpg                /usr/bin/gpg
     gzip               /usr/bin/gzip
     histfile           /root/.cpan/histfile
     histsize           100
     http_proxy
     inactivity_timeout 0
     index_expire       1
     inhibit_startup_message 0
     keep_source_where  /root/.cpan/sources
     lynx
     make
     make_arg
     make_install_arg
     makepl_arg
     ncftp
     ncftpget
     no_proxy           localhost
     pager              less
     prerequisites_policy ask
     scan_cache         atstart
     shell              /bin/bash
     tar                /bin/tar
     term_is_latin      1
     unzip              /usr/bin/unzip
     urllist
         ftp://ftp.du.se/pub/CPAN/
         ftp://ftp.sunet.se/pub/lang/perl/CPAN/
     wget               /usr/bin/wget


cpan> o conf makepl_arg PREFIX=/root/.cpan
     makepl_arg         PREFIX=/root/.cpan

cpan> install MIME::Base64
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
   Database was generated on Sat, 04 Dec 2004 02:50:14 GMT
LWP not available
CPAN: Net::FTP loaded ok
Fetching with Net::FTP:
   ftp://ftp.du.se/pub/CPAN/authors/01mailrc.txt.gz
Going to read /root/.cpan/sources/authors/01mailrc.txt.gz
LWP not available
Fetching with Net::FTP:
   ftp://ftp.du.se/pub/CPAN/modules/02packages.details.txt.gz
Going to read /root/.cpan/sources/modules/02packages.details.txt.gz
   Database was generated on Sun, 05 Dec 2004 05:56:01 GMT
   HTTP::Date not available
LWP not available
Fetching with Net::FTP:
   ftp://ftp.du.se/pub/CPAN/modules/03modlist.data.gz
Going to read /root/.cpan/sources/modules/03modlist.data.gz
Going to write /root/.cpan/Metadata
Running install for module MIME::Base64
Running make for G/GA/GAAS/MIME-Base64-3.05.tar.gz
CPAN: Digest::MD5 loaded ok
Checksum for 
/root/.cpan/sources/authors/id/G/GA/GAAS/MIME-Base64-3.05.tar.gz ok
Scanning cache /root/.cpan/build for sizes
MIME-Base64-3.05/
MIME-Base64-3.05/t/
MIME-Base64-3.05/t/warn.t
MIME-Base64-3.05/t/bad-sv.t
MIME-Base64-3.05/t/unicode.t
MIME-Base64-3.05/t/quoted-print.t
MIME-Base64-3.05/t/base64.t
MIME-Base64-3.05/README
MIME-Base64-3.05/QuotedPrint.pm
MIME-Base64-3.05/MANIFEST
MIME-Base64-3.05/decode-qp
MIME-Base64-3.05/encode-base64
MIME-Base64-3.05/encode-qp
MIME-Base64-3.05/Base64.pm
MIME-Base64-3.05/Changes
MIME-Base64-3.05/Makefile.PL
MIME-Base64-3.05/decode-base64
MIME-Base64-3.05/Base64.xs
Removing previously used /root/.cpan/build/MIME-Base64-3.05

   CPAN.pm: Going to build G/GA/GAAS/MIME-Base64-3.05.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for MIME::Base64
     -- NOT OK
Running make test
   Can't test without successful make
Running make install
   make had returned bad status, install seems impossible

cpan>



------------------------------

Date: Sun, 05 Dec 2004 14:12:31 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: Trying to install module with CPAN
Message-Id: <jHEsd.1526$gF5.568@trndny01>

simon wrote:
> Hi I've been trying for days to install the module MIME::Base64 with 
> CPAN but no matter how I try it never seems to work. I am on SUSE 9.1, 
> Perl is pre-installed: version 5.8.3. I am a total newbie when it comes 
> to perl but I have scanned the Internet for answers and now turn to 
> asking for help. Heres how it looks:
> 
> 
> cpan> o conf
>
[snip]

> cpan> install MIME::Base64
[snip]

> MIME-Base64-3.05/Base64.xs
> Removing previously used /root/.cpan/build/MIME-Base64-3.05
> 
>   CPAN.pm: Going to build G/GA/GAAS/MIME-Base64-3.05.tar.gz
> 
> Checking if your kit is complete...
> Looks good
> Writing Makefile for MIME::Base64
>     -- NOT OK
> Running make test
>   Can't test without successful make
> Running make install
>   make had returned bad status, install seems impossible
> 

Let's test one possibility:  MIME::Base64 uses C-code via file 
Base64.xs.  Hence, you need a working C compiler.  Could there be 
something wrong with our C compiler?  (Try writing and compiling a 
simple C program.  Also, try installing from CPAN one other distribution 
which has a .xs file and one which does *not*.)

jimk


------------------------------

Date: Sun, 05 Dec 2004 15:30:07 GMT
From: simon hawkins <two@telia.com>
Subject: Re: Trying to install module with CPAN
Message-Id: <3QFsd.123505$dP1.437307@newsc.telia.net>

Jim Keenan wrote:
> simon wrote:
> 
>> Hi I've been trying for days to install the module MIME::Base64 with 
>> CPAN but no matter how I try it never seems to work. I am on SUSE 9.1, 
>> Perl is pre-installed: version 5.8.3. I am a total newbie when it 
>> comes to perl but I have scanned the Internet for answers and now turn 
>> to asking for help. Heres how it looks:
>>
>>
>> cpan> o conf
>>
> [snip]
> 
>> cpan> install MIME::Base64
> 
> [snip]
> 
>> MIME-Base64-3.05/Base64.xs
>> Removing previously used /root/.cpan/build/MIME-Base64-3.05
>>
>>   CPAN.pm: Going to build G/GA/GAAS/MIME-Base64-3.05.tar.gz
>>
>> Checking if your kit is complete...
>> Looks good
>> Writing Makefile for MIME::Base64
>>     -- NOT OK
>> Running make test
>>   Can't test without successful make
>> Running make install
>>   make had returned bad status, install seems impossible
>>
> 
> Let's test one possibility:  MIME::Base64 uses C-code via file 
> Base64.xs.  Hence, you need a working C compiler.  Could there be 
> something wrong with our C compiler?  (Try writing and compiling a 
> simple C program.  Also, try installing from CPAN one other distribution 
> which has a .xs file and one which does *not*.)
> 
> jimk
Hi jimk

You hit the nail on the head! The C- compiler was....er...non existant! 
I assumed it was already installed as part of the SUSE 9.1 std 
configuration but alas...

Thanks so much for your help! Much appreciated.

//Simon


------------------------------

Date: Sun, 05 Dec 2004 17:25:51 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: Trying to install module with CPAN
Message-Id: <zwHsd.1555$gF5.460@trndny01>

simon hawkins wrote:
> Jim Keenan wrote:
> 
>>
>> Let's test one possibility:  MIME::Base64 uses C-code via file 
>> Base64.xs.  Hence, you need a working C compiler.  Could there be 
>> something wrong with our C compiler?  (Try writing and compiling a 
>> simple C program.  Also, try installing from CPAN one other 
>> distribution which has a .xs file and one which does *not*.)
>>
>> jimk
> 
> Hi jimk
> 
> You hit the nail on the head! The C- compiler was....er...non existant! 
> I assumed it was already installed as part of the SUSE 9.1 std 
> configuration but alas...
> 

I'm not familiar with SUSE Linux, but, based on my experience with 
RedHat, I would have made the same assumption.

OTOH, Mac OS X is based on BSD, but you have to install the Developer 
Tools package yourself to get goodies like the C-compiler there.  So 
perhaps this is not so wierd as it seems at first.

jimk


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 7486
***************************************


home help back first fref pref prev next nref lref last post