[32287] in Perl-Users-Digest
Perl-Users Digest, Issue: 3554 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 28 21:09:30 2011
Date: Mon, 28 Nov 2011 18:09:10 -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 Mon, 28 Nov 2011 Volume: 11 Number: 3554
Today's topics:
Re: access a 2D array column by column <ela@yantai.org>
Re: access a 2D array column by column <tadmc@seesig.invalid>
Index position of array item by string match? (correcte <tuxedo@mailinator.com>
Re: Index position of array item by string match? (corr <glex_no-spam@qwest-spam-no.invalid>
Re: Index position of array item by string match? (corr <tuxedo@mailinator.com>
Re: Index position of array item by string match? (corr <glex_no-spam@qwest-spam-no.invalid>
Index position of array item by string match? <tuxedo@mailinator.com>
Re: Index position of array item by string match? <rweikusat@mssgmbh.com>
Re: Index position of array item by string match? <justin.1111@purestblue.com>
Re: Index position of array item by string match? <tuxedo@mailinator.com>
Re: Index position of array item by string match? <tuxedo@mailinator.com>
Re: Index position of array item by string match? <rweikusat@mssgmbh.com>
Re: Index position of array item by string match? <tadmc@seesig.invalid>
Re: Index position of array item by string match? <rweikusat@mssgmbh.com>
Re: Index position of array item by string match? <ben@morrow.me.uk>
Re: Problem configuring OS/2 for installing CPAN packag <nospam-abwillis1-nopspam@nospam-gmail.com>
Re: Problem configuring OS/2 for installing CPAN packag <ben@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 28 Nov 2011 19:39:34 +0800
From: "ela" <ela@yantai.org>
Subject: Re: access a 2D array column by column
Message-Id: <javrtj$c18$1@ijustice.itsc.cuhk.edu.hk>
"Tad McClellan" <tadmc@seesig.invalid> wrote in message
news:slrnjcvds6.epp.tadmc@tadbox.sbcglobal.net...
> Justin C <justin.1111@purestblue.com> wrote:
>
>> But please read and understand
>
>
> That is extremely unlikely. :-(
>
>> the comments others have posted.
Trying hard to follow the etiquette. Sometimes when a program is used only
once I somehow become lazy and don't follow strictly... sorry again for
making you disappointed but I always remember when I become rich, this group
should be the first to which I should donate.
------------------------------
Date: Mon, 28 Nov 2011 08:39:37 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: access a 2D array column by column
Message-Id: <slrnjd77cu.652.tadmc@tadbox.sbcglobal.net>
ela <ela@yantai.org> wrote:
> Trying hard to follow the etiquette.
Bullshit.
> Sometimes when a program is used only
> once I somehow become lazy and don't follow strictly...
That is OK when you are the only person to see your program,
but once you decide to ask others to spend their time on it too,
it is courteous to go back and remove your "laziness" before posting.
You are the most inconsiderate poster I can remember ever
seeing post here.
"lazy" usually means that you want to do less work, right?
You are not being "lazy" (ie. saving time), you are
being "foolish" (ie. wasting time).
"use strict" will save you time by finding bugs for you.
Using "use strict" is being lazy.
Checking the return value from open() will save you time by
finding bugs for you.
Checking the return value from open() is being lazy.
Proper scoping of variables will save you time by finding bugs for you.
Proper scoping of variables is being lazy.
Start being truly lazy!
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
------------------------------
Date: Mon, 28 Nov 2011 17:10:55 +0100
From: Tuxedo <tuxedo@mailinator.com>
Subject: Index position of array item by string match? (corrected)
Message-Id: <jb0bqg$cr3$1@news.albasani.net>
Sorry, there were some errors in "img=img.." which should say "img=image.."
in the previous post, which have been corrected in the below version:
What is the best/simplest way to create the following clickthrough
procedure?
A perl script (display.pl) has a cgi-parameter that will show an image, by
accessing for example display.pl?img=image_xyz.jpg
use warnings;
use strict;
use CGI qw(param);
my $img = param("img");
print "Content-Type: text/html\n\n";
my @images = ("image_001.jpg",
"image_002.jpg",
"image_xyz.jpg",
"image_zzz.jpg);
# ???
# find the index position of matching $img string
# to print out $link_before and $link_after below
# ???
print "<a href=display.pl$link_before>";
print "<img src=$img>";
print "<a href=display.pl$link_after>";
------------------
The image names are kept in an array but not necessary in a numerical order
name form.
How can the corresponding index number of the matching $img cgi-string be
found and extracted in order to print out the link to the next
($link_after) and previous image ($link_before) items found in the array?
Of course, this would only be functional as long as each array item has a
unique name, which they would have.
The html output when accessing display.pl?img=image_xyz.jpg could be:
<a href=display.pl?img=image_002.jpg>previous</a>
<img src=image_xyz.jpg>
<a href=display.pl?img=image_zzz.jpg>next</a>
But while displaying either the first or last image, the link value could
simply loop to the end or the start of the array.
Alternatively, the opening and closing <a..></a> could be omitted when the
position is either at the beginning or the end of the array. So for
example, if accessing display.pl?img=image_zzz.jpg, the output can then be:
<a href=display.pl?img=image_xyz.jpg>previous</a>
<img src=image_zzz.jpg>
next
Any ideas how to best do the above would be appreciated.
Many thanks!
Tuxedo
------------------------------
Date: Mon, 28 Nov 2011 17:16:20 +0000
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Index position of array item by string match? (corrected)
Message-Id: <4ed3c1e4$0$73603$815e3792@news.qwest.net>
On 11/28/11 16:10, Tuxedo wrote:
> Sorry, there were some errors in "img=img.." which should say "img=image.."
> in the previous post, which have been corrected in the below version:
>
> What is the best/simplest way to create the following clickthrough
> procedure?
>
> A perl script (display.pl) has a cgi-parameter that will show an image, by
> accessing for example display.pl?img=image_xyz.jpg
>
> use warnings;
> use strict;
>
> use CGI qw(param);
> my $img = param("img");
>
> print "Content-Type: text/html\n\n";
There's a header() method in CGI?? Much cleaner.
>
> my @images = ("image_001.jpg",
> "image_002.jpg",
> "image_xyz.jpg",
> "image_zzz.jpg);
Provide code that's correct.
>
> # ???
> # find the index position of matching $img string
> # to print out $link_before and $link_after below
> # ???
>
> print "<a href=display.pl$link_before>";
> print "<img src=$img>";
> print "<a href=display.pl$link_after>";
>
> ------------------
>
> The image names are kept in an array but not necessary in a numerical order
> name form.
>
> How can the corresponding index number of the matching $img cgi-string be
> found and extracted in order to print out the link to the next
> ($link_after) and previous image ($link_before) items found in the array?
>
> Of course, this would only be functional as long as each array item has a
> unique name, which they would have.
>
> The html output when accessing display.pl?img=image_xyz.jpg could be:
>
> <a href=display.pl?img=image_002.jpg>previous</a>
> <img src=image_xyz.jpg>
> <a href=display.pl?img=image_zzz.jpg>next</a>
>
> But while displaying either the first or last image, the link value could
> simply loop to the end or the start of the array.
>
> Alternatively, the opening and closing<a..></a> could be omitted when the
> position is either at the beginning or the end of the array. So for
> example, if accessing display.pl?img=image_zzz.jpg, the output can then be:
>
> <a href=display.pl?img=image_xyz.jpg>previous</a>
> <img src=image_zzz.jpg>
> next
>
> Any ideas how to best do the above would be appreciated.
Create a subroutine that will iterate over @images, returning the index
of the current param('img'). The code for that iteration could be
something like:
for my $i ( 0 .. $#images )
{
return $i if $img eq $images[$i];
}
Call that subroutine and then print the HTML, or don't print HTML
if the index is 0 or the last index.
print "something" unless $index == 0;
Using CGI's a, img, and header methods will help clean up the code.
------------------------------
Date: Mon, 28 Nov 2011 19:58:12 +0100
From: Tuxedo <tuxedo@mailinator.com>
Subject: Re: Index position of array item by string match? (corrected)
Message-Id: <jb0lk5$3oh$1@news.albasani.net>
J. Gleixner wrote:
[..]
> Provide code that's correct.
Yes, thanks for pointing out the missing quotation mark.
>
> for my $i ( 0 .. $#images )
> {
> return $i if $img eq $images[$i];
> }
>
>
>
> Call that subroutine and then print the HTML, or don't print HTML
> if the index is 0 or the last index.
>
> print "something" unless $index == 0;
>
> Using CGI's a, img, and header methods will help clean up the code.
Any chance of a few more pointers to help fill out the blanks? I'm not
quite how to turn the above ideas into a working example.
Many thanks,
Tuxedo
------------------------------
Date: Mon, 28 Nov 2011 19:14:42 +0000
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Index position of array item by string match? (corrected)
Message-Id: <4ed3dda2$0$9083$815e3792@news.qwest.net>
On 11/28/11 18:58, Tuxedo wrote:
> J. Gleixner wrote:
>
> [..]
>
>> Provide code that's correct.
>
> Yes, thanks for pointing out the missing quotation mark.
>
>>
>> for my $i ( 0 .. $#images )
>> {
>> return $i if $img eq $images[$i];
>> }
>>
>>
>>
>> Call that subroutine and then print the HTML, or don't print HTML
>> if the index is 0 or the last index.
>>
>> print "something" unless $index == 0;
>>
>> Using CGI's a, img, and header methods will help clean up the code.
>
> Any chance of a few more pointers to help fill out the blanks? I'm not
> quite how to turn the above ideas into a working example.
>
use CGI qw( param a header img);
my @images = qw(
image_001.jpg
image_002.jpg
image_xyz.jpg
image_zzz.jpg
);
my $cur_index = find_index( param( 'img' ) );
print header;
print a( { href => "display.pl?img=$images[ $cur_index-1 ]" },
'previous'
) unless $cur_index == 0;
#etc.
sub find_index
{
my $img = shift;
for my $index ( 0 .. $#images )
{
return $index if $img eq $images[$i];
}
}
------------------------------
Date: Mon, 28 Nov 2011 16:58:30 +0100
From: Tuxedo <tuxedo@mailinator.com>
Subject: Index position of array item by string match?
Message-Id: <jb0b37$b0u$1@news.albasani.net>
What is the best/simplest way to create the following clickthrough
procedure?
A perl script (display.pl) has a cgi-parameter that will show an image, by
accessing for example display.pl?img=img_xyz.jpg
use warnings;
use strict;
use CGI qw(param);
my $img = param("img");
print "Content-Type: text/html\n\n";
my @images = ("image_001.jpg",
"image_002.jpg",
"image_xyz.jpg",
"image_zzz.jpg);
# ???
# find the index position of by matching $img string
# to print out $link_before and $link_after below
# ???
print "<a href=display.pl$link_before>";
print "<img src=$img>";
print "<a href=display.pl$link_after>";
------------------
The image names are kept in an array but not necessary in a numerical order
name form.
How can the corresponding index number of the matching $img cgi-string be
found and extracted in order to print out the link to the next
($link_after) and previous image ($link_before) items found in the array?
Of course, this would only be functional as long as each array item has a
unique name, which they would have.
The html output when accessing display.pl?img=img_xyz.jpg could be:
<a href=display.pl?img=image_002.jpg>previous</a>
<img src=image_xyz.jpg>
<a href=display.pl?img=image_zzz.jpg>next</a>
But while displaying either the first or last image, the link value could
simply loop to the end or the start of the array.
Alternatively, the opening and closing <a..></a> could be omitted when the
position is either at the beginning or the end of the array. So for
example, if accessing display.pl?img=image_zzz.jpg, the output can then be:
<a href=display.pl?img=image_xyz.jpg>previous</a>
<img src=image_zzz.jpg>
next
Any ideas how to best do the above would be appreciated.
Many thanks!
Tuxedo
------------------------------
Date: Mon, 28 Nov 2011 16:13:27 +0000
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Index position of array item by string match?
Message-Id: <877h2kmdi0.fsf@sapphire.mobileactivedefense.com>
Tuxedo <tuxedo@mailinator.com> writes:
> A perl script (display.pl) has a cgi-parameter that will show an image, by
> accessing for example display.pl?img=img_xyz.jpg
>
> use warnings;
> use strict;
>
> use CGI qw(param);
> my $img = param("img");
>
> print "Content-Type: text/html\n\n";
>
> my @images = ("image_001.jpg",
> "image_002.jpg",
> "image_xyz.jpg",
> "image_zzz.jpg);
>
> # ???
> # find the index position of by matching $img string
> # to print out $link_before and $link_after below
> # ???
>
> print "<a href=display.pl$link_before>";
> print "<img src=$img>";
> print "<a href=display.pl$link_after>";
>
> ------------------
>
> The image names are kept in an array but not necessary in a numerical order
> name form.
>
> How can the corresponding index number of the matching $img cgi-string be
> found and extracted in order to print out the link to the next
> ($link_after) and previous image ($link_before) items found in the
> array?
The simplest idea would be to scan the image array:
--------------
my $ndx;
for (@images) {
last if $_ eq $img;
++$ndx;
}
printf('<a href="display.pl?%s">', $images[$ndx - 1]) if $ndx;
printf('<a href="display.pl?%s">', $images[$ndx + 1]) if $ndx < $#images;
--------------
NB: If you're afraid of pointless warnings, make that my $ndx = 0;
The obvious other idea would be to use an image hash:
my ($ndx, %images);
$ndx = 0;
%images = map { $_ => $ndx++ } @images;
In this case, the current index would be in $images{$img}.
------------------------------
Date: Mon, 28 Nov 2011 16:31:14 +0000
From: Justin C <justin.1111@purestblue.com>
Subject: Re: Index position of array item by string match?
Message-Id: <ijpcq8-lfm.ln1@zem.masonsmusic.co.uk>
On 2011-11-28, Tuxedo <tuxedo@mailinator.com> wrote:
> What is the best/simplest way to create the following clickthrough
> procedure?
>
> A perl script (display.pl) has a cgi-parameter that will show an image, by
> accessing for example display.pl?img=img_xyz.jpg
>
> use warnings;
> use strict;
>
> use CGI qw(param);
> my $img = param("img");
>
> print "Content-Type: text/html\n\n";
>
> my @images = ("image_001.jpg",
> "image_002.jpg",
> "image_xyz.jpg",
> "image_zzz.jpg);
>
> # ???
> # find the index position of by matching $img string
> # to print out $link_before and $link_after below
> # ???
>
> print "<a href=display.pl$link_before>";
> print "<img src=$img>";
> print "<a href=display.pl$link_after>";
>
> ------------------
>
> The image names are kept in an array but not necessary in a numerical order
> name form.
>
> How can the corresponding index number of the matching $img cgi-string be
> found and extracted in order to print out the link to the next
> ($link_after) and previous image ($link_before) items found in the array?
Don't return the name in the link, but the index number. Previous and
next are then as simple as $link -1 and $link +1.
Justin.
--
Justin C, by the sea.
------------------------------
Date: Mon, 28 Nov 2011 19:10:46 +0100
From: Tuxedo <tuxedo@mailinator.com>
Subject: Re: Index position of array item by string match?
Message-Id: <jb0ir7$svc$1@news.albasani.net>
Rainer Weikusat wrote:
[...]
> The simplest idea would be to scan the image array:
>
> --------------
> my $ndx;
>
> for (@images) {
> last if $_ eq $img;
> ++$ndx;
> }
>
> printf('<a href="display.pl?%s">', $images[$ndx - 1]) if $ndx;
> printf('<a href="display.pl?%s">', $images[$ndx + 1]) if $ndx < $#images;
Thanks for the above example, it works nicely in that when the first image
is viewed there's no 'previous' link, or when the last image is viewed
there is no next link, or when an image somewhere between is viewed, both
the previous and next links appear.
This is my slightly modified version:
use CGI qw(param);
my $img = param("img");
my @images = ("image_001.jpg",
"image_002.jpg",
"image_003.jpg",
"image_004.jpg");
my $ndx;
for (@images) {
last if $_ eq $img;
++$ndx;
}
printf('<a href="display.pl?%s">previous',$images[$ndx - 1]) if $ndx;
print "<img src=$img>";
printf('<a href="display.pl?%s">next', $images[$ndx + 1]) if $ndx <
$#images;
How would the closing </a>'s be included in the above procedure? I had
forgotten these in the print statements in my previous mock-up.
Also, instead of displaying nothing if there is no previous or next image,
how can an alternative placeholder string be returned, such as printing
'previous' when displaying image_001.jpg but without the enclosing <a
..></a>, or printing 'next' without the enclosing <a..></a> when displaying
the last? Sorry, I don't fully see through the "printf(... if $indx"
procedure.
Thanks again, I will try the hash method next.
Tuxedo
> --------------
>
> NB: If you're afraid of pointless warnings, make that my $ndx = 0;
>
> The obvious other idea would be to use an image hash:
>
> my ($ndx, %images);
>
> $ndx = 0;
> %images = map { $_ => $ndx++ } @images;
>
> In this case, the current index would be in $images{$img}.
------------------------------
Date: Mon, 28 Nov 2011 20:12:18 +0100
From: Tuxedo <tuxedo@mailinator.com>
Subject: Re: Index position of array item by string match?
Message-Id: <jb0mej$5ur$1@news.albasani.net>
Tuxedo wrote:
[...]
> printf('<a href="display.pl?%s">previous',$images[$ndx - 1]) if $ndx;
> How would the closing </a>'s be included in the above procedure? I had
> forgotten these in the print statements in my previous mock-up.
Sorry, I think I've been staring at the screen too long, the missing </a>
obviously goes straight after previous</a>'.. or .. next</a>', eg.:
printf('<a href="display.pl?%s">previous</a>',$images[$ndx - 1]) if $ndx;
That's even plain html....
Tuxedo
------------------------------
Date: Mon, 28 Nov 2011 19:33:23 +0000
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Index position of array item by string match?
Message-Id: <87wrakavp8.fsf@sapphire.mobileactivedefense.com>
Tuxedo <tuxedo@mailinator.com> writes:
[...]
> Also, instead of displaying nothing if there is no previous or next image,
> how can an alternative placeholder string be returned, such as printing
> 'previous' when displaying image_001.jpg but without the enclosing <a
> ..></a>, or printing 'next' without the enclosing <a..></a> when displaying
> the last? Sorry, I don't fully see through the "printf(... if $indx"
> procedure.
The 'if $ndx' and 'if $ndx < $#images' are so-called statement
modifiers which can be used to execute a single statement
conditionally without creating a block and tearing it down again.
For more complicated choices, the 'full' syntax has to be used, eg
if ($ndx) {
# print image link
} else {
# alternate output
}
> Thanks again, I will try the hash method next.
While hashes are usually the way to go when doing 'by-name' lookups,
this would be suboptimal here: Constructing the hash requires
traversing the entire array, calculating the hash value of each string
and creating a slighlty more complicated data structure than the
original array based on this information. For the single lookup,
another hash value needs to be calculated and finally a string
comparison has to be performed in order to determine if the entry
which was found is the one which was supposed to be
located. Traversing the array once while looking for the sought after
string directly, which requires a partial string comparison for each
mismatch and a complete one for the entry in question, is going to be
cheaper.
------------------------------
Date: Mon, 28 Nov 2011 16:12:25 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Index position of array item by string match?
Message-Id: <slrnjd81u1.74u.tadmc@tadbox.sbcglobal.net>
Tuxedo <tuxedo@mailinator.com> wrote:
> What is the best/simplest way to create the following clickthrough
^^^^ ^^^^^^^^
Which is it?
The best way is not the simplest way.
The simplest way is not the best way.
> my @images = ("image_001.jpg",
> "image_002.jpg",
> "image_xyz.jpg",
> "image_zzz.jpg);
It is inconsiderate of you to post untested code.
>
> # ???
> # find the index position of by matching $img string
my($i) = grep $img eq $images[$_], 0..$#images;
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
------------------------------
Date: Mon, 28 Nov 2011 22:35:19 +0000
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Index position of array item by string match?
Message-Id: <877h2jub88.fsf@sapphire.mobileactivedefense.com>
Tad McClellan <tadmc@seesig.invalid> writes:
> Tuxedo <tuxedo@mailinator.com> wrote:
[...]
>> # ???
>> # find the index position of by matching $img string
>
>
> my($i) = grep $img eq $images[$_], 0..$#images;
This is bad because it always compares the input name to all names in
the array.
------------------------------
Date: Mon, 28 Nov 2011 18:05:08 -0600
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Index position of array item by string match?
Message-Id: <-PydnTTPR9cpvEnTnZ2dnUVZ8nGdnZ2d@bt.com>
Quoth Rainer Weikusat <rweikusat@mssgmbh.com>:
>
> --------------
> my $ndx;
>
> for (@images) {
> last if $_ eq $img;
> ++$ndx;
> }
>
> printf('<a href="display.pl?%s">', $images[$ndx - 1]) if $ndx;
> printf('<a href="display.pl?%s">', $images[$ndx + 1]) if $ndx < $#images;
> --------------
>
> NB: If you're afraid of pointless warnings, make that my $ndx = 0;
++ doesn't warn about undef, because that would be irritating.
('uninitialized' is the warnings category I turn off most often. The
only thing more irritating than the undef warnings I didn't want is the
fact that 'uninitialized' is a great long word I have to think about how
to spell (in American, too), when C<no warnings 'undef'> would have made
so much more sense...)
Ben
------------------------------
Date: Mon, 28 Nov 2011 23:00:53 GMT
From: "Andy" <nospam-abwillis1-nopspam@nospam-gmail.com>
Subject: Re: Problem configuring OS/2 for installing CPAN packages
Message-Id: <stfVq7QNr4pc-pn2-l0gOdRWfdBbo@localhost>
On Mon, 28 Nov 2011 18:43:16 UTC, Shmuel (Seymour J.) Metz
<spamtrap@library.lspace.org.invalid> wrote:
> I'm attempting to install a CPAN package for Perl 5.10 under
> eComStation 2.0 GA, a rebranded OS/2. I took the defaults when I ran
> 1.1. perl -MCPAN -e "shell". The kLIBC Paths application is mapping
> /perl and /perl5 to Q:\PROGRAMS\PERL. I get the following messages.
>
> [h:\]cdd H:\vendors\cpan\HTML-Tagset-3.20
> [h:\vendors\cpan\html-tagset-3.20]perl Makefile.PL
> Have Q:/PROGRAMS/PERL/LIB/5.10.0/os2/Config.pm expected
> /perl5/lib/5.10.0/os2/Config.pm
> Your perl and your Config.pm seem to have different ideas about the
> architecture they are running on.
> Perl thinks: [os2]
> Config says: [os2]
> This may or may not cause problems. Please check your installation
> of perl
> if you have problems building this extension.
> Note (probably harmless): No library found for -lsocket
> Writing Makefile for HTML::Tagset
> [h:\vendors\cpan\html-tagset-3.20]Q:\moztools\make.exe
> make.exe: *** No rule to make target
> `/perl5/lib/5.10.0/os2/Config.pm', needed by `Makefile'. Stop.
>
> I assume that I need to edit a configuration file, but I didn't see
> anything obvious in the documentation.
>
There is an open bug on this issue I believe:
http://mantis.smedley.info/view.php?id=303
--
------------------------------
Date: Mon, 28 Nov 2011 19:43:21 -0600
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Problem configuring OS/2 for installing CPAN packages
Message-Id: <QIadnRHMSrAkpUnTnZ2dnUVZ8sydnZ2d@bt.com>
[I should say first that I know nothing about OS/2, so I apologise if I
end up showing my ignorance...]
Quoth Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>:
> I'm attempting to install a CPAN package for Perl 5.10 under
> eComStation 2.0 GA, a rebranded OS/2. I took the defaults when I ran
> 1.1. perl -MCPAN -e "shell". The kLIBC Paths application is mapping
> /perl and /perl5 to Q:\PROGRAMS\PERL. I get the following messages.
Is this a standard OS/2 build of perl from the perl source, or is it a
patched version from somewhere else? README.os2 doesn't mention anything
about any path remapping.
>
> [h:\]cdd H:\vendors\cpan\HTML-Tagset-3.20
> [h:\vendors\cpan\html-tagset-3.20]perl Makefile.PL
> Have Q:/PROGRAMS/PERL/LIB/5.10.0/os2/Config.pm expected
> /perl5/lib/5.10.0/os2/Config.pm
The 'Have' path here is the path from @INC perl actually loaded
Config.pm from, and the 'expected' is the path where that copy of
Config.pm thought it had been installed. They ought to be the same,
since the default @INC is compiled into perl at the same time as the
installed version of Config.pm is written. (The subsequent message about
architectures is unnecessarily confusing, since incorrect arch is only
one possible cause of the paths being different.)
Is your build of perl changing its initial @INC based on the invoked
path to the binary? Normally that would only happen if
perl -V:userelocatableinc
says 'define', but if your perl's been patched it may do so anyway. If
it is, is there some way you can invoke it as /perl5/bin/perl (or
whatever the proper path is) instead of Q:\PROGRAMS\PERL\BIN\PERL? I
don't know if CMD understands those remapped paths, so you may have more
luck under some sort of kLIBC-compatible shell.
That should make the warning go away, however...
> Your perl and your Config.pm seem to have different ideas about the
> architecture they are running on.
> Perl thinks: [os2]
> Config says: [os2]
> This may or may not cause problems. Please check your installation
> of perl
> if you have problems building this extension.
> Note (probably harmless): No library found for -lsocket
> Writing Makefile for HTML::Tagset
> [h:\vendors\cpan\html-tagset-3.20]Q:\moztools\make.exe
> make.exe: *** No rule to make target
> `/perl5/lib/5.10.0/os2/Config.pm', needed by `Makefile'. Stop.
...this suggests your make doesn't understand these remapped paths. Is
this the make used to build that copy of perl? The 'right' solution here
is to get a shell and a make and a perl all built against the same
libraries and using the same paths, so if your perl is built against
some sort of Unix compatibility layer you need a make that is as well...
> I assume that I need to edit a configuration file, but I didn't see
> anything obvious in the documentation.
...on the other hand, you could try simply editing that copy of
Config.pm and globally replacing /perl and /perl5 with Q:/PROGRAMS/PERL.
(Back it up first, obviously.) If the path mapping is all that's wrong,
and the perl binary is happy using native rather than mapped paths, it
ought to be OK.
Ben
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 V11 Issue 3554
***************************************