[23652] in Perl-Users-Digest
Perl-Users Digest, Issue: 5859 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 26 03:05:56 2003
Date: Wed, 26 Nov 2003 00:05:12 -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 Wed, 26 Nov 2003 Volume: 10 Number: 5859
Today's topics:
Re: a simple thread testing program produces some very <l0g0m0tion@earthlink.net>
Array contains too much data <ducott_99@yahoo.com>
Re: Array contains too much data <mb@uq.net.au.invalid>
Re: Array contains too much data <noreply@gunnar.cc>
Re: Array contains too much data <ducott_99@yahoo.com>
Re: Array contains too much data <noreply@gunnar.cc>
Re: Array contains too much data (Tad McClellan)
Re: Array contains too much data <ubl@schaffhausen.de>
Re: perl 5.6 multi byte <nospam_for_jkeen@concentric.net>
Re: Regex matching question <REMOVEsdnCAPS@comcast.net>
Re: Regexp issue . . . <mickyc@NOshaSPAMw.ca>
sorting multiple different entries using Perl (rusneht)
Re: sorting multiple different entries using Perl <davidroe@email.com>
Re: trying to understand fork and wait (Tad McClellan)
Re: trying to understand fork and wait (Tad McClellan)
Re: undif as if it is 0 (Tad McClellan)
Re: unpack query (Jack Penarth)
Re: what does "/usr/bin/perl: relocation error:" mean? (Sara)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 26 Nov 2003 02:45:17 GMT
From: Christopher Shatto <l0g0m0tion@earthlink.net>
Subject: Re: a simple thread testing program produces some very strange results: could you please tell me what the problem is?
Message-Id: <1tUwb.22173$Wy4.3836@newsread2.news.atl.earthlink.net>
>
> What's with the 'Scalars leaked: 1' stuff?
>
From the perldiag man page...
Scalars leaked: %d
(P) Something went wrong in Perl's internal bookkeeping of scalars: not
all scalar variables were deallocated by the time Perl exited. What this
usually indicates is a memory leak, which is of course bad, especially
if the Perl program is intended to be long-running.
------------------------------
Date: Wed, 26 Nov 2003 03:42:21 GMT
From: "Robert TV" <ducott_99@yahoo.com>
Subject: Array contains too much data
Message-Id: <xiVwb.499219$9l5.450897@pd7tw2no>
Hi. I have a small perl script that opens a file, collects and assigns each
line of the file to an array, and then displays the data to the screen. This
script is working just fine, but is starting to get difficult to manage ...
you see, the data file now contains about 1,000 lines of data and it's
taking very long for perl to parse the data, assemble it into html and then
show in my browser (obviously it was very quick when the data file only had
10 enties total) Here is the jist of the script:
###### Start Script Example ######
#!/usr/bin/perl
open (FH, "<$user/datafile.db") or die "Can't open: $!";
@entires=<FH>;
close(FH);
print "Content-type: text/html \n\n";
print <<HTML;
<html>
<head>
<title>Database Results</title>
</head>
<body>
<table>
HTML
# DISPLAY DATABASE TABLES
chomp @entires;
foreach $entry(@entires) {
print <<HTML;
<tr>
<td width="42" height="19">Entry</td>
<td width="279" height="19">$entry</td>
</tr>
PRINTHTML
}
print <<HTML;
</table>
</body>
</html>
HTML
exit;
###### End Script Example ######
The database now at 1000 entires it takes very long to essemble and print to
screen, and it's bogging down my browser because the HTML is too long. Now,
I start to think ... I need a way to only show 20 or 30 results at a time,
and have "next results" or something similair ... kinda like search engines
do. So in an ideal world, I run the script and it only shows the first 30
lines of the array and has links to more results ... like this:
Showing 0-30 ---back 1 2 3 4 5 6 next #something like this.
I'm posting this inquiry because I have no idea how I would approach or
create such a feature, and I'm hoping that maybe a few of you out there
might be able to point me in the right direction, maybe there are some
tutorials, code snippets etc etc. I appriciate you taking time to read my
post! TIA
Robert TV
------------------------------
Date: Wed, 26 Nov 2003 14:13:59 +1000
From: Matthew Braid <mb@uq.net.au.invalid>
Subject: Re: Array contains too much data
Message-Id: <bq19a7$cnn$1@bunyip.cc.uq.edu.au>
Robert TV wrote:
> Hi. I have a small perl script that opens a file, collects and assigns each
> line of the file to an array, and then displays the data to the screen. This
> script is working just fine, but is starting to get difficult to manage ...
> you see, the data file now contains about 1,000 lines of data and it's
> taking very long for perl to parse the data, assemble it into html and then
> show in my browser (obviously it was very quick when the data file only had
> 10 enties total) Here is the jist of the script:
>
> ###### Start Script Example ######
>
> #!/usr/bin/perl
>
> open (FH, "<$user/datafile.db") or die "Can't open: $!";
> @entires=<FH>;
> close(FH);
>
> print "Content-type: text/html \n\n";
> print <<HTML;
> <html>
> <head>
> <title>Database Results</title>
> </head>
> <body>
> <table>
> HTML
>
> # DISPLAY DATABASE TABLES
> chomp @entires;
> foreach $entry(@entires) {
> print <<HTML;
> <tr>
> <td width="42" height="19">Entry</td>
> <td width="279" height="19">$entry</td>
> </tr>
> PRINTHTML
> }
> print <<HTML;
> </table>
> </body>
> </html>
> HTML
> exit;
>
> ###### End Script Example ######
>
> The database now at 1000 entires it takes very long to essemble and print to
> screen, and it's bogging down my browser because the HTML is too long. Now,
> I start to think ... I need a way to only show 20 or 30 results at a time,
> and have "next results" or something similair ... kinda like search engines
> do. So in an ideal world, I run the script and it only shows the first 30
> lines of the array and has links to more results ... like this:
>
> Showing 0-30 ---back 1 2 3 4 5 6 next #something like this.
>
> I'm posting this inquiry because I have no idea how I would approach or
> create such a feature, and I'm hoping that maybe a few of you out there
> might be able to point me in the right direction, maybe there are some
> tutorials, code snippets etc etc. I appriciate you taking time to read my
> post! TIA
>
> Robert TV
>
>
First off - I hope the line above consisting entirely of PRINTHTML was a
typo - it should have been HTML.
Secondly, you're going to have to accept parameters of what the current
display length is (say 30 for 30 items per page) and what offset is
required (30 would mean page 2 for a 30-items-per-page display length,
while 25 would mean someones playing with your URL :) ). You also need
to know how many entries are in your 'database' (although this should
_NOT_ be a parameter - figure it out yourself). This means using CGI
stuff. Read up on the CGI module (perldoc CGI). Your URL (using the GET
method at least) will end up looking something like:
http://www.example.com/show_entries.pl?offset=60&page_size=30
The back and next links should point to offsets that match the previous
and next page (if the current request is for offset 90 with a page_size
of 30, back should be a link to offset 60 with a page_size of 30 and
next should be a link to offset 120 with a page_size of 30 - remember
that there may not be a next or prev page though!). Since CGI is
stateless you can't tell what the _current_ page is unless you add
another parameter, and its easy enough to do without that.
There are a lot of traps to CGI programming since you have no control
over the user possibly typing in their own parameters to try and break
your code.
Of course, there is still one little problem - your 'database' is just a
flat text file. Its always going to be slow for any decent sized file.
Unless the entries are fixed-length you can't just skip the appropriate
part of the file to get entries at a given offset - you have to read
every line in the file up to that offset and count the newlines. You may
want to consider a proper database.
MB
------------------------------
Date: Wed, 26 Nov 2003 06:06:03 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Array contains too much data
Message-Id: <bq1ci6$1trcq8$1@ID-184292.news.uni-berlin.de>
Robert TV wrote:
>
> ###### Start Script Example ######
>
> #!/usr/bin/perl
You should enable strictures and warnings:
use strict;
use warnings;
> I need a way to only show 20 or 30 results at a time, and have
> "next results" or something similair ... kinda like search engines
> do. So in an ideal world, I run the script and it only shows the
> first 30 lines of the array
To give you an idea what can be done, you can add these lines after
the file has been slurped into @entires:
my ($offset) = $ENV{QUERY_STRING} =~ /offset=(\d+)/;
$offset ||= 0;
@entires = splice @entires, $offset, 30;
Now, if you run the script as usual, only the first 30 results are
displayed. To display e.g. the next 30 results, you need to add a
query string to the URL, like this:
http://.../myscript.pl?offset=30
> and has links to more results
You can have the script generate such links by help of the $offset
variable.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 26 Nov 2003 06:13:00 GMT
From: "Robert TV" <ducott_99@yahoo.com>
Subject: Re: Array contains too much data
Message-Id: <MvXwb.496427$6C4.250796@pd7tw1no>
Gunnar Hjalmarsson" wrote
> use strict;
> use warnings;
> To give you an idea what can be done, you can add these lines after
> the file has been slurped into @entires:
>
> my ($offset) = $ENV{QUERY_STRING} =~ /offset=(\d+)/;
> $offset ||= 0;
> @entires = splice @entires, $offset, 30;
>
> Now, if you run the script as usual, only the first 30 results are
> displayed. To display e.g. the next 30 results, you need to add a
> query string to the URL, like this:
>
> http://.../myscript.pl?offset=30
> You can have the script generate such links by help of the $offset
> variable.
Thanx for the reply Gunnar, I will research $offset.
Robert TV
------------------------------
Date: Wed, 26 Nov 2003 07:15:13 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Array contains too much data
Message-Id: <bq1gka$1ot13t$1@ID-184292.news.uni-berlin.de>
Robert TV wrote:
> Thanx for the reply Gunnar, I will research $offset.
Nothing to research... It's just the name I chose to give that variable.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 26 Nov 2003 00:29:56 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Array contains too much data
Message-Id: <slrnbs8i34.4ns.tadmc@magna.augustmail.com>
Robert TV <ducott_99@yahoo.com> wrote:
> Gunnar Hjalmarsson" wrote
>> $offset ||= 0;
>> You can have the script generate such links by help of the $offset
>> variable.
>
> Thanx for the reply Gunnar, I will research $offset.
There is nothing special about the variable named $offset.
Don't go researching the wrong thing, that would be a big
waste of time.
Research the || and ||= operators in perlop.pod.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 26 Nov 2003 09:01:41 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Array contains too much data
Message-Id: <bq1pni$qve$1@news.dtag.de>
Gunnar Hjalmarsson wrote:
> my ($offset) = $ENV{QUERY_STRING} =~ /offset=(\d+)/;
Why would you ever want to do that rather than,
my $q = CGI->new;
<some code>
my $offset = $q->param('offset') || 0;
die "illegal offset" if $offset =~ /\D/;
???
malte
------------------------------
Date: 26 Nov 2003 02:09:40 GMT
From: "James E Keenan" <nospam_for_jkeen@concentric.net>
Subject: Re: perl 5.6 multi byte
Message-Id: <bq1214$s8v@dispatch.concentric.net>
"Sulla" <whopper007007@yahoo.com> wrote in message
news:fa91f49e.0311251542.66298865@posting.google.com...
> [snip] My program
> is exiting early without having read the entire file (at least, it is
> only getting through about 10K of a 20K line file).
Is it possible that $i has reached $g_nMaxFiles and the loop has therefore
been terminated?
I can't comment about your attempts at multi-byte compatibility. But the
code snippet you posted doesn't include assignments for all the variables
you've used, so a reader has to guess as to your intent. It's also evident
that you didn't test your code snippet under 'use strict;' and 'use
warnings;' before posting.
That being said, I'll provide a few comments on the code and then post what
I think is a cleaned-up version of what you intend. You can take it from
there. Note: your code did not entail use of any Perl module. Hence, no
need to post to comp.lang.perl.modules; comp.lang.perl.misc would have
sufficed.
>
> my %g_hMsds;
> keys %g_hMsds = 60160;
What's the purpose of the above? In Perl, you don't need to pre-allocate
the number of keys in a hash.
> open IN, "<$g_strPrimaryFile" or die "Error opening file\n"
> $i = 0;
> while (<IN>) {
>
> my @aSplit = split /\t/, $_;
> my @aTemp = ();
>
> # insert into array
> $aTemp[0] = $aSplit[3];
> $aTemp[1] = $g_hLang{$aSplit[0]};
%g_hLang was not previously declared.
> $aTemp[2] = $aSplit[1];
> $aTemp[3] = $aSplit[4];
> $aTemp[4] = "";
> $aTemp[5] = $aSplit[7];
> $aTemp[6] = $aSplit[8];
>
> #attach the array
> $g_hMsds{$aSplit[3]} = \@aTemp;
You're using @aTemp only to assign to %g_hMsds. See below how to eliminate
it.
>
> $i++;
>
> if ($i >= $g_nMaxFiles) {
> logResult("EXIT LOOP: ".$i." rows run");
sub logResult not provided. See my guess at a substitution below and note
simpler code.
> last;
> }
>
> }
> close IN;
use strict;
use warnings;
use Data::Dumper;
my (%g_hMsds, $i, $g_nMaxFiles);
$i = 0;
$g_nMaxFiles = 3;
while (<DATA>) {
my @aSplit = split /\t/, $_;
$g_hMsds{$aSplit[3]} =
[ $aSplit[3], 'arbitrary', $aSplit[1], $aSplit[4],
'', $aSplit[7], $aSplit[8] ];
$i++;
last if $i >= $g_nMaxFiles;
}
print "EXIT LOOP: $i rows run\n";
print Dumper(\%g_hMsds);
__DATA__
alpha beta gamma delta epsilon zeta eta theta iota
kappa lambda mu nu xi omicron pi rho sigma tau
1 2 3 4 5 6 7 8 9
q w e r t y u i o
a s d f g h j k l
------------------------------
Date: Tue, 25 Nov 2003 21:20:29 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Regex matching question
Message-Id: <Xns943EE35856A2Csdn.comcast@216.196.97.136>
Amir Kadic <zoooz@gmx.de> wrote in news:bq0tk0$1tvfpf$1@ID-142982.news.uni-
berlin.de:
> Alexander Stremitzer wrote:
>
>> I want to be able to break a string into 2 parts. One part should be
>
> ($part1, $part2) = split /\//,$string;
($part1, $part2) = split /\//,$string,2;
--
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
------------------------------
Date: Wed, 26 Nov 2003 03:28:24 GMT
From: "MichaelC" <mickyc@NOshaSPAMw.ca>
Subject: Re: Regexp issue . . .
Message-Id: <s5Vwb.496786$pl3.155625@pd7tw3no>
"Eric J. Roode" <REMOVEsdnCAPS@comcast.net> wrote in message
news:Xns943E4EE1E1E8Dsdn.comcast@216.196.97.136...
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> "MichaelC" <mickyc@NOshaSPAMw.ca> wrote in
> news:d9Dwb.492453$9l5.241927@pd7tw2no:
>
> > Hi all. I am having a particularly difficult time with a perl script
> > that I am writing. The problem area is a place where I need to strip
> > some newlines out of a file.
> >
> > My source data is text which is in paragraph form, but has line breaks
> > within the paragraphs. I need to do as much processing as possible in
> > order to minimise the amount of manual changes that I have to make.
>
> You don't say what you mean by "paragraph form". If you're using that
> term in the usual sense, then you mean that the paragraphs have double
> newlines between them. Is that so? If so, Perl can read paragraph-at-a-
> time for you:
>
> $/ = '';
> $paragraph = <>;
>
Sorry, I thought that I had defined my problem in
enough detail. My problem is that the text that I am
processing does NOT have double line breaks
between paragraphs, and the text has been presented
wrapped to 72 character width. I do not have access
to the original, as it was lost. That is the reason for
my current problem.
That said, statistically, in the text that I am processing,
the vast majority of lines that start with the set [A-Z"]
will start a new paragraph. The converse is als true,
in that lines that start [a-z,.!?] are definitely part of a
logical paragraph. In that sense, I am not using the
term "paragraph" in the way that you normally assume.
As an object example, the explanation above is a reasonable simulation of
the problem that I am facing. Logistically, the manually broken text is two
paragraphs with no extra line breaks between them. I neither require nor do
I desire double line breaks between paragraphs, what I ro need, though, is
each paragraph on a single line with a single line break at the end, and
ONLY there.
For example, I need to strip all but two line breaks out of the example that
I have provided, so that the text is contiguous from "Sorry, I" to "current
problem." and from "That said, " to "normally assume." After some thought,
I found a solution:
#!/usr/bin/perl
open(infl, "<in.txt" );
open(outfl, ">out.txt");
while( <infl> ) {
my $x = $_;
if ( $x =~ m!^[A-Z"]! ) { print outfl "\n"; }
$x =~ s!(^.+)\n!\1 !m;
print outfl $x;
}
close(infl);
close(outfl);
Thanks,
Michael
------------------------------
Date: 25 Nov 2003 20:23:29 -0800
From: ramthen@yahoo.com (rusneht)
Subject: sorting multiple different entries using Perl
Message-Id: <ab96940e.0311252023.6f5d831f@posting.google.com>
Hi All ,
Am not sure which way to go to handle this case; hence am looking for
suggestions.
Data that I need to handle is this:
/vob/dir/file1@@/br1/10
/vob/dir/file1@@/br1/9
/vob/dir/file1@@/br1/8
/vob/dir/file2@@/br1/3
/vob/dir/file4@@/br1/7
I would like to extract from this list, not unique values, but an
output like this :
/vob/dir/file1@@/br1/10
/vob/dir/file1@@/br1/8
/vob/dir/file2@@/br1/3
/vob/dir/file4@@/br1/7
As you can see if a file has multiple entrues I would like to take
most recent and old ones from list; if only one entry for a file only
that needs to be extracted.
Any ideas or suggestions ?
--TIA,
Ramthen
------------------------------
Date: Wed, 26 Nov 2003 05:11:59 GMT
From: Dave Roe <davidroe@email.com>
Subject: Re: sorting multiple different entries using Perl
Message-Id: <zCWwb.15162$n56.1396@newsread1.news.pas.earthlink.net>
rusneht wrote:
> I would like to extract from this list, not unique values, but an
> output like this :
>
> /vob/dir/file1@@/br1/10
> /vob/dir/file1@@/br1/8
> /vob/dir/file2@@/br1/3
> /vob/dir/file4@@/br1/7
something like this.
/dave
#!/usr/bin/perl -w
use strict;
my %filenames;
while (<DATA>) {
my ($filename,$other) = split('@@');
push(@{$filenames{$filename}},$other);
}
foreach (keys %filenames) {
my @others = @{$filenames{$_}};
my $first_other = shift(@others);
print join('@@',$_,$first_other);
if (my $last_other = pop(@others)) {
print join('@@',$_,$last_other);
}
}
__DATA__
/vob/dir/file1@@/br1/10
/vob/dir/file1@@/br1/9
/vob/dir/file1@@/br1/8
/vob/dir/file2@@/br1/3
/vob/dir/file4@@/br1/7
------------------------------
Date: Tue, 25 Nov 2003 17:23:05 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: trying to understand fork and wait
Message-Id: <slrnbs7p2p.42f.tadmc@magna.augustmail.com>
John <jguad98@hotmail.com> wrote:
> tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnbs5di1.2eb.tadmc@magna.augustmail.com>...
>> John <jguad98@hotmail.com> wrote:
>>
>> > I ran it and it failed ... specifically the fork is
>>
>> So did you then read the docs for fork() ?
>>
>
> Yes, and I saw nothing new from when I read the docs before.
> It's
> that whole issue with the doco being farking vague and incomplete
Huh?
The second sentence says:
It returns the child pid to the parent process, C<0> to
the child process, or C<undef> if the fork is unsuccessful.
and that's all you needed to avoid the problem discussed in this thread.
Apply the logic needed to handle all three possibilities, and
there will be no surprises.
It is the whole issue with writing the wrong farking logic.
Docs don't give you what the proper logic is, we have to (get to?)
work that out for ourselves.
> causing confusion which I mentioned (or at least implied) in my
> previous postings in this thread.
I don't think I read the whole thread, and I'm too laz^H^H^Hbusy
to go look them up now, so I cannot comment on that.
> I do not have every last nuance of Perl
> burned into my cerebral cortex
I didn't say that you did, or even that that is desirable.
I've heard Larry Wall say that even he has to "look it up to see
what it does" sometimes.
I surely _did_ imply however that you are not yet making the best
use of the std docs.
The docs for $! in perlvar.pod for instance, describe when the
value of the variable is meaningless.
Good programmers don't need to know everything, they just need to
know where to go to find out anything that they need to know.
The docs that came with the software you are using are pretty
much universally a good first place to try.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 25 Nov 2003 21:59:50 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: trying to understand fork and wait
Message-Id: <slrnbs899m.49s.tadmc@magna.augustmail.com>
Ben Morrow <usenet@morrow.me.uk> wrote:
> jguad98@hotmail.com (John) wrote:
>> tadmc@augustmail.com (Tad McClellan) wrote in message
>> news:<slrnbs5di1.2eb.tadmc@magna.augustmail.com>...
>> > John <jguad98@hotmail.com> wrote:
>> >
>> > > I ran it and it failed ... specifically the fork is
>> >
>> > So did you then read the docs for fork() ?
>>
>> Yes, and I saw nothing new from when I read the docs before. It's
>> that whole issue with the doco being farking vague and incomplete
> The documentation for fork states quite explicitly in the first
> paragraph what fork returns. I take it you realise that 0 is false?
>> I did not know that "$!" could have a "stale" message ...
>
> Again, it says so quite clearly in perlvar under $!.
> you should be aware that
> system() will not return what you expect either.
That might have happened to John _before_ this thread, but I hope
not after, because now he'll be reading the docs for the functions
that he uses. :-)
Using a function without reading its docs is the programming
equivalent of signing a contract without reading it!
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 25 Nov 2003 17:28:51 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: undif as if it is 0
Message-Id: <slrnbs7pdj.42f.tadmc@magna.augustmail.com>
Edo <eddhig22@yahool.com> wrote:
> Chris Mattern wrote:
>> Edo wrote:
>>> Eric J. Roode wrote:
>>>
>>>>
>>>> Yes. Tabs. Tabs don't work well over Usenet. (Imho, they don't
>>>> work well *anywhere*).
>>>
>>> and how to fix that?
>>>
>> Don't use them. Give serious thought to a global replacing of any
>> tabs that may currently be in your source files.
> sorry, can you be more clear, you mean instead of hitting Tab to indent
> my line of code I should do (??) what?
Use actual space characters instead of tabs.
Most programmer's editors can be set to use the appropriate number
of spaces whenever a tab is typed.
Many programmer's editors can automatically detect when you need
indenting, and supply the appropriate number of space characters,
in which case you should do, well, nothing. :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 25 Nov 2003 23:58:14 -0800
From: jackpenarth@aol.com (Jack Penarth)
Subject: Re: unpack query
Message-Id: <f27d1c90.0311252358.17dc3bd8@posting.google.com>
Ben Morrow <usenet@morrow.me.uk> wrote in message news:<bq0cqj$k37$1@wisteria.csv.warwick.ac.uk>...
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
> > What you are using is known as multidimensional hash emulation. It's
> > described in _Programming Perl_ Ch. 2, Section _Hashes_. It's also
> > in the online documentation, but offhand I don't know where.
>
> perlvar, under $;
>
> Ben
Still haven't gotten my PC back so I am having to use vi (I like
it!)under AIX on an IBM box to type the script and then re-type in the
group, sorry about the typo's.
You are right of course. Because of the urgency of the situation I
needed to get the script working - it is called from a complicated
legacy shell script that does lots of other things. With a bit of luck
I will be able to find time to sit down with your comments and the
documentation and understand it more fully.
Thanks again.
John
------------------------------
Date: 25 Nov 2003 20:13:06 -0800
From: genericax@hotmail.com (Sara)
Subject: Re: what does "/usr/bin/perl: relocation error:" mean?
Message-Id: <776e0325.0311252013.2737fb00@posting.google.com>
genericax@hotmail.com (Sara) wrote in message news:<776e0325.0311221027.f807721@posting.google.com>...
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<bpnole$gfn$1@mamenchi.zrz.TU-Berlin.DE>...
> > Sara <genericax@hotmail.com> wrote in comp.lang.perl.misc:
> > > Perl was running fine on this box last night, now I get this error:
> > >
> > > ./user.pl
> > > /usr/bin/perl: relocation error:
> > > /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so:
> > > undefined symbol: Perl_rxres_fr
> > >
> > >
> > > uhhhhh.. OK? I searched news for "Perl_rxres_fr" - is this the first
> > > time this ever happened?
> >
> > It's not a Perl error, your system can't load Perl, or probably something
> > Perl wants to load dynamically. Does perl run by itself (/usr/bin/perl
> > -e '')? What non-core modules does "user.pl" use? Could there be a
> > version mixup?
> >
> > The prefix "Perl_" was introduced to some of the symbols in the perl core
> > rather late in the game, and some XS modules have taken even longer to
> > catch up. There may still be some that haven't.
> >
> > Anno
>
>
>
> Good day and Thank-You Anno:
>
>
> ** Perl sees to run OK here:
>
> [tux@tux perl]$ perl -v
>
> This is perl, v5.8.0 built for i386-linux-thread-multi
>
> Copyright 1987-2002, Larry Wall
>
>
> ** and this little program is OK:
>
> #!/usr/bin/perl -w
>
> print "Hi Anno its me Perl!\n\n";
>
>
> ** But this program which was running FINE last night, and has had no
> changes since then (I compared it with the last EMACS ~ file and the
> only diff is an edit I made). ALso there have been no system installs
> or updates:
>
> #!/usr/bin/perl -wd
>
> use LWP::UserAgent;
> use LWP::Simple;
> use HTTP::Request::Common qw(POST);
> use HTTP::Cookies;
>
> use Net::Nslookup;
>
> use lib qw(sql);
> use SNsql;
> use IPsql;
>
> use DBI;
>
> .
> .
> quite a few more lines.......
>
>
>
>
> Perhaps tonight it will run OK again? Very odd!
>
>
> /usr/bin/perl: relocation error:
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so:
> undefined symbol: Perl_rxres_fr
>
> Perhaps I need to edit libperl.so to investigate the missing symbol?
>
> G
As I suspected, inexpliquably, Perl once again is working like a
champ. Don;t know why it broke, don't know why its working again..
Thanks Anno I guess Time DOES heal all!
G
------------------------------
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 5859
***************************************