[22866] in Perl-Users-Digest
Perl-Users Digest, Issue: 5087 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 7 03:05:44 2003
Date: Sat, 7 Jun 2003 00:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 7 Jun 2003 Volume: 10 Number: 5087
Today's topics:
Re: [Crypt::SSLeay] Win32 Compile Problems <randy@theoryx5.uwinnipeg.ca>
Re: and if I killed this programmer *I'd* go to jail.. (Michael G.)
Re: bareword complaints in if statement (Jay Tilton)
Re: Changing form output (Steve)
Re: Critique my code - need a bit of help (Perl for Win (Tad McClellan)
Re: Critique my code - need a bit of help (Perl for Win (Tad McClellan)
Re: Critique my code - need a bit of help (Perl for Win (Tad McClellan)
Re: Generate second child after a while <jurgenex@hotmail.com>
Re: Help with XML::Simple (Jay Tilton)
Re: perl and surveys <jurgenex@hotmail.com>
select and vec <jkipp5@comcast.net>
Sorting IP's <abuse@sgrail.org>
Re: Sorting IP's <jurgenex@hotmail.com>
Re: Sorting IP's <noreply@gunnar.cc>
Re: Sorting IP's <abuse@sgrail.org>
Re: Sorting IP's <jurgenex@hotmail.com>
Re: Sorting IP's <noreply@gunnar.cc>
strange case of missing print statement in Windows perl (Unknown Poster)
Re: strange case of missing print statement in Windows <bwalton@rochester.rr.com>
Re: Strange observation (Jay Tilton)
Re: Unusual Can't load fail (web only) <kalinabears@hdc.com.au>
Re: Unusual Can't load fail (web only) <randy@theoryx5.uwinnipeg.ca>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 7 Jun 2003 01:04:58 -0500
From: "Randy Kobes" <randy@theoryx5.uwinnipeg.ca>
Subject: Re: [Crypt::SSLeay] Win32 Compile Problems
Message-Id: <dgfEa.32628$NC4.132766@news1.mts.net>
"john" <raptnor@msn.com> wrote in message
news:a3db0d59.0306060923.594d4456@posting.google.com...
> Hello all,
>
> I'm trying to compile Crypt::SSLeay and have run into compile problems
> using VC++, Perl 5.8.0, the latest stable from OpenSSL (compiled,
> installed, and tested), and the latest copy of Crypt::SSLeay.
>
> I have noticed that this problem has been posted before, but there was
> no visible resolution to it. Has anyone here encountered this before
> and found a solution? Using ActiveState's distribution is not an
> option.
>
> Thanks in advance,
>
> John Fraser
> (raptnor at mac dot com)
>
> Capture from the Command Window:
>
>
> cl -c -Ic:\openssl\include -Ic:\openssl\inc32 -nologo -Gf -W3 -MD
> -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT
> -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
> -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -DNDEBUG
> -O1 -DVERSION=\"0.49\" -DXS_VERSION=\"0.49\"
> "-IC:\perl\lib\CORE" SSLeay.c
> SSLeay.c
> SSLeay.xs(53) : error C2064: term does not evaluate to a function
> SSLeay.xs(53) : warning C4133: 'function' : incompatible types - from
> 'char [7]' to 'FILE *'
> SSLeay.xs(57) : error C2064: term does not evaluate to a function
> SSLeay.xs(57) : warning C4133: 'function' : incompatible types - from
> 'char [21]' to 'FILE *'
> SSLeay.xs(64) : error C2064: term does not evaluate to a function
> SSLeay.xs(64) : warning C4133: 'function' : incompatible types - from
> 'char [17]' to 'FILE *'
> SSLeay.xs(66) : error C2064: term does not evaluate to a function
> SSLeay.xs(66) : warning C4133: 'function' : incompatible types - from
> 'char [16]' to 'FILE *'
> SSLeay.xs(172) : warning C4047: '=' : 'FILE *' differs in levels of
> indirection from 'PerlIO * '
> SSLeay.xs(174) : warning C4047: 'function' : 'PerlIO * ' differs in
> levels of indirection from 'FILE *'
> SSLeay.xs(247) : warning C4090: 'function' : different 'const'
> qualifiers
> SSLeay.xs(247) : warning C4028: formal parameter 1 different from
> declaration
This is strange - using a self-compiled Perl (from the latest 8xx
ActiveState sources), I don't see such a problem with the module
and openssl-0.9.7b. And my compile-time flags are the same
as yours, except I have -DHAVE_DES_CRYPT, which I don't
think would make a difference in this.
The above seems to indicate a problem with Perl's file operations
(fprintf, fopen) - when you compiled Perl, did you see any problems
with the file tests? Have you seen any similar problems with other
modules you've built? Is it possible to try the ActiveState 8xx sources
(sometimes these have patches not yet in the CPAN Perl sources)?
best regards,
randy kobes
------------------------------
Date: Sat, 07 Jun 2003 01:43:23 GMT
From: uhuh@nono.net (Michael G.)
Subject: Re: and if I killed this programmer *I'd* go to jail..
Message-Id: <3ee14292.9124770@news.charter.net>
On 5 Jun 2003 10:58:35 -0700, genericax@hotmail.com (Sara) wrote:
>This is one of the less ugly examples what I've inherited from my
>"ancestral" programmers here. I think he must have had a C-to-Perl
>script he ran to produce his Perl Code..
>
>805: for($i=0;$i<=$#g_INFO;$i++){
>806: if($g_INFO[$i][$x_ID] ne $id){ next; }
>807: @tmp1 = split(/;/,$g_INFO[$i][$_TEXT]);
>808: for($j=0;$j<=$#tmp1;$j++){
>809: $tmp1[$j] =~ s/^(\s)*//g;
>810: @tmp2 = split(/,/,$tmp1[$j]);
>811: if($tmp2[0] == $level){ return "$tmp2[1]"; }
>
>I'll be in rehab before this project is though.. ACK....
You'll have plenty of time to write a de-obfuscator in prison. As long
as you don't use one to kill him/her/it, you'll probably have access
to a computer there...
------------------------------
Date: Sat, 07 Jun 2003 02:14:03 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: bareword complaints in if statement
Message-Id: <3ee149e7.271351676@news.erols.com>
ktom <abc@nowhere.com> wrote:
: i have the simple if statement that barfs with the 'bareword' error
: message.. "Bareword "l200" not allowed while "strict subs" in use at.."
:
: this doesn't work as it is expected("1200" is not 1200)
: if( ( $testNum >= 100 ) && ( $testNum <= "l200" ) ) {
:
: this generates the bareword error
: if( ( $testNum >= 100 ) && ( $testNum <= l200 ) ) {
:
: this works just fine
: if( $testNum >= 100 ) {
:
: how do i get this to suck up the number 1200??
By spelling "1200" with a "1" (digit)
instead of a "l" (lowercase "L")
:)
------------------------------
Date: 6 Jun 2003 22:34:31 -0700
From: techadmin@shaw.ca (Steve)
Subject: Re: Changing form output
Message-Id: <2e27f51a.0306062134.3c52894f@posting.google.com>
Eric Schwartz <emschwar@pobox.com> wrote in message news:<etobrxass5s.fsf@wormtongue.emschwar>...
> techadmin@shaw.ca (Steve) writes:
> > Who gave you the right to decide what gets asked in this forum? Self
> > proclaimed are you?
>
> No, in fact he's being rather polite. You come across as demanding
> someone else solve your problem, without showing any evidence you've
> tried yourself. That may or may not be true, but it's how you appear,
> and that's not the sort of attitude this newsgroup likes very much.
>
> > Read the question like I wrote it, a simple question to a simple
> > problem.
>
> Perhaps you should read the Posting Guidelines to this newsgroup,
> which are posted here regularly. If you don't see them on your
> newsgroup, please read them online at
> <URL:http://mail.augustmail.com/~tadmc/clpmisc.shtml>. Specifically,
> see the "Provide enough information" section.
>
> > And for your information, through help from this forum, I have made a
> > couple of changes to the code already so that it meets my needs. Sorry
> > that my knowledge of perl, or code in general, is not to your
> > liking.....
>
> It's not a matter of "liking". It's a matter of your posting,
> demanding others do your work for you, without showing that you've
> made any effort yourself. Some few people will go ahead and help
> anyway, but they quickly get burnt out on helping others who show no
> signs of trying to do the work themselves first.
>
> > After reading through some of your other replies I see that this is
> > nothing personel as you seem to apply your higher than mighty attitude
> > to others as well.
>
> *sigh* Tell ya what, why don't you hang out on clpm for a few months
> and see how many people post messages like yours, and see how many of
> them just want someone else to write them some code without their
> having to invest anything in it. It's not certain that your situation
> is like that, but it shows all the signs of being that way. Perhaps
> if you were a tad less defensive, and took a clear look at how others
> see you, you might see how to present yourself in a more favourable
> light.
>
> -=Eric
Please excuse if I have offended anyone,
I am still at a loss as to where the idea that my question was
'DEMANDING' comes from. I have re-read it and I simply asked a
question not unlike any other question in this forum. In return I
hoped that some one would assist me?
As for your reference as to being burnt out from answering other
peoples questions, why do you answer so negativley? would it be better
to just not answer at all.
Done.
------------------------------
Date: Fri, 6 Jun 2003 20:38:05 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Critique my code - need a bit of help (Perl for Win32)
Message-Id: <slrnbe2gft.3ai.tadmc@magna.augustmail.com>
Jason Bunston <noreply@sympatico.ca> wrote:
> I'm certain the best advice will be the most obvious to the veteran coders
> here.
You do not need to be a veteran, you just need to have seen the
Posting Guidelines that are posted here twice each week.
> I appreciate every bit of advice,
Here's a whole bunch more:
http://mail.augustmail.com/~tadmc/clpmisc.shtml
[ snip TOFU ]
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 6 Jun 2003 21:26:08 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Critique my code - need a bit of help (Perl for Win32)
Message-Id: <slrnbe2ja0.3ai.tadmc@magna.augustmail.com>
Jason B <jbunsto@toronto.ca> wrote:
> {
> my ($LM, $hkey);
[snip]
> my ($hkey, $DataType, $Ver, $ProfileDir);
[snip]
> }
You should always enable warnings when developing Perl code.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 6 Jun 2003 21:23:42 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Critique my code - need a bit of help (Perl for Win32)
Message-Id: <slrnbe2j5e.3ai.tadmc@magna.augustmail.com>
Jason B <jbunsto@toronto.ca> wrote:
> it's not working.
Hmmph.
> foreach (@ARGV)
> {
>
> my $HostName=$ARGV[0];
Your code never refers to that variable after this point. Why not?
> open FH_NAME, "$_.txt";
You should always, yes *always*, check the return value from open():
open FH_NAME, "$_.txt" or die "could not open '$_.txt' $!";
> @HostID=<FH_NAME>;
> foreach $Machine (@HostID)
You don't need to read the entire file into memory, and you don't
need the temporary array variable:
while ( $Machine = <FH_NAME> )
> $Machine =~ tr/a-z/A-Z/;
That does not respect locales.
Use the operator for replacing chars when you want to replace chars.
Use the operator for changing case when you want to change case. :-)
$Machine = uc $Machine;
> if (!grep { /Reply/ } @Ping)
"unless" is the same as "if not", and you don't need the block:
unless ( grep /Reply/, @Ping )
(just a point of style, but excessive punctuation gets in the way of
clear communication, so I try to avoid punctuation.
)
> next if (!grep {/S-1-5-21/} $SID);
Why are you grep()ing a one-element list?
next unless $SID =~ /S-1-5-21/;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 07 Jun 2003 01:43:48 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Generate second child after a while
Message-Id: <orbEa.55087$da1.530@nwrddc03.gnilink.net>
Jessie wrote:
> I am developing a multiple process application. There are totally two
> children generated. The requirement is the child#1 start immediately
> after program run. But the child#2 starts after a period of time like
> 1 minute after the first child starts. Which command I should use to
> ask Child#2 wait for 1 minute? I have tried ask it to sleep, but seems
> it doesn't work.
Show us the code you got (reduced to a minimal script that still shows the
problem).
There is no obvious reason why sleep() should not work.
jue
------------------------------
Date: Sat, 07 Jun 2003 01:21:11 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Help with XML::Simple
Message-Id: <3ee13b68.267640351@news.erols.com>
"Jonah Bishop" <jgbdif@yahoo.com> wrote:
: I'm trying to parse an XML file that has the following format:
:
: <phonebook>
: <developers>
: <person id="asmith">
: <fullname>Angela Smith</fullname>
: <phone>1-2345</phone>
: <email>asmith@somewhere.com</email>
: </person>
: <person id="bbrown">
: <fullname>Billy Brown</fullname>
: <phone>4-5678</phone>
: <email>bbrown@somewhere.else.com</email>
: </person>
: </developers>
: </phonebook>
:
: In trying parse this XML file, I am using the XML::Simple parser and the
: following perl code:
:
: my $parser = XML::Simple->new();
: my $doc = $parser->XMLin($BluePagesFilename);
: foreach my $id (keys (%{$doc->{developers}->{person}}))
: {
: print "ID: $id,Phone: $id->{$phone}\n";
^^^^^^
Is that really supposed to be a variable, or did you mean to use a
plain string for this hash key?
: }
:
: As you can see, I'd simply like to print each person's ID value and then
: their phone. But the phone number portion is not appearing correctly. I may
: be assuming too much when I think that $id can "point" to the fields
: underneath it.
$id is a hash key--nothing but a string.
The substructure is in the hash value.
my %persons = %{ $doc->{developers}->{person} };
foreach my $id (keys %persons ) {
my $phone = $persons{$id}->{phone};
print "ID: $id,Phone: $phone\n";
}
------------------------------
Date: Sat, 07 Jun 2003 01:50:25 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: perl and surveys
Message-Id: <BxbEa.55119$da1.5571@nwrddc03.gnilink.net>
Steve wrote:
> Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in message
> news:<bbqo1d$cjlq4$1@ID-184292.news.dfncis.de>...
>> Plain requests for programming help, without showing that you have
>> tried yourself, simply don't fit here.
>
> Is this not a message board where people ask questions about perl
> script? and hope that maybe someone will assist?
First of all "this" is a newsgroup.
With that formality out of the way: yes, asking specific questions about
Perl problems someone encountered while writing a script would be something
to discuss in this NG. What was the Perl question again?
> who ever asked about a job?
The OP did. He asked "Here is what I want. Can you write it for me?" Usually
that is called a job offer.
jue
------------------------------
Date: Sat, 7 Jun 2003 00:32:02 -0400
From: "neptuna" <jkipp5@comcast.net>
Subject: select and vec
Message-Id: <ifOdnXiM8qYy9nyjXTWcqg@comcast.com>
I am was reading through some docs on socket IO. It mentions using select()
to test the readability of the socket. here is the code:
-------------------
$rin = ''; # initialize bitmask
vec($rin, fileno(SOCKET), 1) = 1; # mark SOCKET in $rin
# repeat calls to vec() for each socket to check
$timeout = 10;
$nfound = select($rout = $rin, undef, undef, $timeout);
if (vec($rout, fileno(SOCKET),1)){
# data to be read on SOCKET....
-----------------------
I could not understand the Author's explanation and was hoping someone here
could explain the vec() and select() in this code
Thanks
------------------------------
Date: Sat, 07 Jun 2003 01:35:29 GMT
From: derek / nul <abuse@sgrail.org>
Subject: Sorting IP's
Message-Id: <n4g2evg8f1mb2ki3vnallqnlmtmqi3psug@4ax.com>
Can someone point me to any information about sorting IP addresses.
Derek
------------------------------
Date: Sat, 07 Jun 2003 01:52:24 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Sorting IP's
Message-Id: <szbEa.55129$da1.18979@nwrddc03.gnilink.net>
derek / nul wrote:
> Can someone point me to any information about sorting IP addresses.
Without any further details given:
- perldoc -f sort
- perldoc -q sort
jue
------------------------------
Date: Sat, 07 Jun 2003 04:05:30 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Sorting IP's
Message-Id: <bbrha2$d2cej$1@ID-184292.news.dfncis.de>
derek / nul wrote:
> Can someone point me to any information about sorting IP addresses.
http://www.sysarch.com/perl/sort_paper.html
/ Gunnar
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 07 Jun 2003 02:43:30 GMT
From: derek / nul <abuse@sgrail.org>
Subject: Re: Sorting IP's
Message-Id: <t5k2evga1aafo2rv1gn23vfk97ke0feios@4ax.com>
On Sat, 07 Jun 2003 01:52:24 GMT, "Jürgen Exner" <jurgenex@hotmail.com> wrote:
>derek / nul wrote:
>> Can someone point me to any information about sorting IP addresses.
>
>Without any further details given:
>- perldoc -f sort
>- perldoc -q sort
IP's in my mail log don't sort correctly
ie
139.134.6.87
219.91.88.21
38.184.17.254
65.214.61.97
------------------------------
Date: Sat, 07 Jun 2003 03:58:42 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Sorting IP's
Message-Id: <SpdEa.60947$Pb.3019@nwrddc01.gnilink.net>
derek / nul wrote:
> On Sat, 07 Jun 2003 01:52:24 GMT, "Jürgen Exner"
> <jurgenex@hotmail.com> wrote:
>
>> derek / nul wrote:
>>> Can someone point me to any information about sorting IP addresses.
>>
>> Without any further details given:
>> - perldoc -f sort
>> - perldoc -q sort
>
> IP's in my mail log don't sort correctly
>
> ie
>
> 139.134.6.87
> 219.91.88.21
> 38.184.17.254
> 65.214.61.97
What do you mean by "don't sort correctly".
This list looks sorted to me, in a nice alphabetical order.
Please define exactly what you want:
Number A should be before number B if and only if ....
Best to do that part in a Perl function, such that it returns -1 iff A
should come before B, 0 iff they are identical, and +1 iff A should come
after B.
jue
jue
jue
------------------------------
Date: Sat, 07 Jun 2003 08:18:05 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Sorting IP's
Message-Id: <bbs03n$cuqld$1@ID-184292.news.dfncis.de>
derek / nul wrote:
> IP's in my mail log don't sort correctly
>
> ie
>
> 139.134.6.87
> 219.91.88.21
> 38.184.17.254
> 65.214.61.97
Maybe this matches your definition of "sort correctly":
@sorted = map $_->[0], sort {
$a->[1] <=> $b->[1] or
$a->[2] <=> $b->[2] or
$a->[3] <=> $b->[3] or
$a->[4] <=> $b->[4]
} map [ $_, /(\d+)\.(\d+)\.(\d+)\.(\d+)/ ], @unsorted;
/ Gunnar
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 6 Jun 2003 19:16:25 -0700
From: use63net@yahoo.com (Unknown Poster)
Subject: strange case of missing print statement in Windows perl
Message-Id: <c62e93ec.0306061816.613d176@posting.google.com>
X-No-archive: yes
Can anyone explain why the print statement is MIA?
perl v5.6.1 for MSWin32-x86-multi-thread
binary build 631 provided by ActiveState Tool Corp.
---------------------------------------------
use strict;
my (@a, $i);
$| = 1; # or 0
print "seen \n";
while (<STDIN>) # or <>
{
chomp ($a[$i++] = $_);
}
print "unseen \n"; # like it says ....
for $i (0..$#a)
{
print "\$a[$i] is $a[$i]\n";
}
print "seen \n";
---------------------------------------------
STDOUT is:
seen
then, if STDIO is:
zero
one
two
^Z
STDOUT is:
$a[0] is zero
$a[1] is one
$a[2] is two
seen
------------------------------
Date: Sat, 07 Jun 2003 03:00:27 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: strange case of missing print statement in Windows perl
Message-Id: <3EE15503.20300@rochester.rr.com>
Unknown Poster wrote:
> X-No-archive: yes
>
> Can anyone explain why the print statement is MIA?
Yep. It is a bug in the Windoze command interpreter. It happens also
with other programs besides Perl, so it is not a Perl problem. To see
the unseen, make the print:
print "\nunseen \n";
It also masquerades as the infamous "my program doesn't complete
execution" program following a ^Z on STDIN. It does -- one just doesn't
see the print statement which follows unless it starts with a \n .
>
> perl v5.6.1 for MSWin32-x86-multi-thread
> binary build 631 provided by ActiveState Tool Corp.
> ---------------------------------------------
>
> use strict;
>
> my (@a, $i);
>
> $| = 1; # or 0
>
> print "seen \n";
>
> while (<STDIN>) # or <>
> {
> chomp ($a[$i++] = $_);
> }
>
> print "unseen \n"; # like it says ....
>
> for $i (0..$#a)
> {
> print "\$a[$i] is $a[$i]\n";
> }
>
> print "seen \n";
> ---------------------------------------------
> STDOUT is:
> seen
>
> then, if STDIO is:
> zero
> one
> two
> ^Z
>
> STDOUT is:
> $a[0] is zero
> $a[1] is one
> $a[2] is two
> seen
>
HTH.
--
Bob Walton
------------------------------
Date: Sat, 07 Jun 2003 02:06:37 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Strange observation
Message-Id: <3ee1404d.268893486@news.erols.com>
puissant00@yahoo.com (Go Perl) wrote:
: This is working
: elsif ($read[7] == 70) {
: $read[0]=$REAL_VALUE[$i][14]; # save REAL_VALUE[14]..REAL_VALUE[19].
: $read[1]=$REAL_VALUE[$i][15];
[etc.]
: printf TEMP_FILE
: ("%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%20d\n",
: $read[0],$read[1],$read[2],$read[3],
[etc.]
That's awful. Array slicing and the '..' operator will help you
tremendously.
@read[0..6, 15, 8..14] = @{ $REAL_VALUE[$i] }[14..28];
printf TEMP_FILE
"%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%20d\n",
@read[ 0..6, 15, 8..14, 7];
: and this is not how come ??
: elsif ($read[16] == 70) {
: $read[0]=$REAL_VALUE[$i][14]; # save REAL_VALUE[14]..REAL_VALUE[19].
: $read[1]=$REAL_VALUE[$i][15];
[etc.]
: printf TEMP_FILE
: ("%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%20d\n",
: $read[0],$read[1],$read[2],$read[3],
[etc.]
Same thing.
@read[0..14] = @{ $REAL_VALUE[$i] }[14..28];
printf TEMP_FILE
"%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%20d\n",
@read[0..14, 16];
: i am trying to read the following line:
: 12 12 23 34 54 56 67 87 89 90 90 97 12 14 15 7
: 0
Spiffy. What does that mean? Which elements of which array are those
numbers being place in?
: forget about the spaces in the input line
Looks like your newsreader's auto-linewrap wrecked it anway.
: why is this happening
You haven't described what is happening. "Does work" and "doesn't
work" describe nothing about what the code does or does not do.
As a WAG, I'd guess "doesn't work" means you're expecting
the value in $read[16] to be equal to 70, but Perl thinks differently.
Probably because you're counting array elements starting at 1 instead
of 0.
------------------------------
Date: Sat, 7 Jun 2003 11:10:58 +1000
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: Unusual Can't load fail (web only)
Message-Id: <3ee13ccf$0$30693@echo-01.iinet.net.au>
"Mike Bobbitt" <Mike@Army.ca> wrote in message
<snip>
> install_driver(mysql) failed: Can't load
>
'/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mys
ql.so'
> for module DBD::mysql:
>
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysq
l.so:
The error that the '.so' file "can't be loaded" indicates that the '.pm'
file has been found (no problem there) and that the '.so' file was *found*,
but can't be loaded - which must surely be a permissions issue, given that
there's no such problem from the command line. Something to do with
'executability' perhaps ??
Cheers,
Rob
------------------------------
Date: Sat, 7 Jun 2003 01:19:26 -0500
From: "Randy Kobes" <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Unusual Can't load fail (web only)
Message-Id: <NtfEa.32646$NC4.132668@news1.mts.net>
"Mike Bobbitt" <Mike@Army.ca> wrote in message
news:2b6e9805.0306060925.afdbe5@posting.google.com...
> Hi all,
>
> I've got an odd problem, that doesn't seem to be covered by any of the
> exisiting threads. When I run a simple DB perl script through the
> command line, it fetches the info and works fine. However, if I run it
> via the web, I get the following error:
>
> install_driver(mysql) failed: Can't load
> '/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread
> multi/auto/DBD/mysql/mysql.so' for module DBD::mysql:
> /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-
> multi/auto/DBD/mysql/mysql.so:
> undefined symbol: PL_perl_destruct_level at
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229.
>
> I've re-installed DBD::mysql using perl -MCPAN -e shell; and manually,
> and there's no change. The fact that it runs via command line seems to
> indicate permissions, but I ran "chmod -R o+r /usr/lib/perl5" and no
> change.
>
> Any help would be appreciated.
>
> Thanks!
The PL_perl_destruct_level symbol should be coming from
your perl lib. I would have thought though this would have been
picked up in building and testing DBD::mysql, but you say there
was no problem there ... Might there be multiple DBD::mysql
installations, and your web script is picking the wrong one? Does
setting within the web script the environment variable
LD_LIBRARY_PATH, pointing to where libraries live, help?
best regards,
randy kobes
------------------------------
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.
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 5087
***************************************