[15470] in Perl-Users-Digest
Perl-Users Digest, Issue: 2880 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 27 14:11:40 2000
Date: Thu, 27 Apr 2000 11:10:24 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <956859024-v9-i2880@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 27 Apr 2000 Volume: 9 Number: 2880
Today's topics:
Re: How to pass an array as an argument ? <red_orc@my-deja.com>
Re: How to pass an array as an argument ? nobull@mail.com
Re: I'm about to lose a client!!! SOMEBODY HELP ME!!! <bmb@ginger.libs.uga.edu>
Re: Internal Error? <rootbeer@redcat.com>
Re: Internal Error? <sariq@texas.net>
Re: Is there a way to create a Perl executable. <rootbeer@redcat.com>
Re: Is there a way to create a Perl executable. <rhomberg@ife.ee.ethz.ch>
Re: is there sendmail on Win32 platform <lee@insync.net>
Re: Mail::Sender module problem <eryq@zeegee.com>
Mass email question... <nathan.wright@sdrc.com>
Memory? <sean@industrial.bc.ca>
Re: Memory? <sariq@texas.net>
Re: mixing STDERR and STDOUT <rootbeer@redcat.com>
Re: mixing STDERR and STDOUT <lr@hpl.hp.com>
Re: Net:FTP module not working for me on perl win32... <tye@metronet.com>
newbie q: Reassign STDOUT/ERR in DOS <paul_m_thompson@my-deja.com>
Re: newbie q: Reassign STDOUT/ERR in DOS exhacker@my-deja.com
Perl 5.6.0 test failed <gander@hei.unige.ch>
Perl DLL <sjutmp@msn.com>
Perl help needed on part-time telecommuting basis - NY <recruiter@mulliganservices.com>
Re: Perl help needed on part-time telecommuting basis - <rhomberg@ife.ee.ethz.ch>
Perl OO question! - Deleting element of Hash of objects <bmurch@cfcg.er.usgs.gov>
Re: Perl OO question! - Deleting element of Hash of obj <bmurch@cfcg.er.usgs.gov>
Posting MIME articles from scripts (CUESTA CUESTA)
prob installing DBI / DBD <digiwyrm@linuxnet.net>
Problem FTPing tar file via PERL script kooloholic@my-deja.com
Re: Problem FTPing tar file via PERL script <rootbeer@redcat.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 27 Apr 2000 15:17:48 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: How to pass an array as an argument ?
Message-Id: <8e9lma$3as$1@nnrp1.deja.com>
In article <39084FB6.F84081C@pliant.cams.ehess.fr>,
ybasile@videotron.ca wrote:
> Hi,
>
> I want to make a fonction with the following prototype:
>
> sub printArrayAsI_want (@arrayArg);
>
> Is it possible to pass an Array as an argument in Perl ?
> If it is possible, how we do that?
>
yes, pass them as references:
#!/usr/local/bin/perl -w
use strict;
# Example from Perl Cookbook,
# 10.5. Passing Arrays and Hashes by Reference
my @a = (1,2);
my @b = (5,8);
my @c = add_vecpair(\@a, \@b);
print "@c\n";
sub add_vecpair { #assumes both vectors the same length
my ($x, $y) = @_; # copy in the array references
my @result;
for (my $i=0; $i < @$x; $i++) {
$result[$i] = $x->[$i] + $y->[$i];
}
return @result;
}
> Thanks.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 27 Apr 2000 18:11:34 +0100
From: nobull@mail.com
Subject: Re: How to pass an array as an argument ?
Message-Id: <u9em7rv589.fsf@wcl-l.bham.ac.uk>
Tony Curtis <tony_curtis32@yahoo.com> writes:
> > Is it possible to pass an Array as an argument in Perl ?
> > If it is possible, how we do that?
>
> my @data = (1, 2, 3, 4, 5, 6);
>
> Pass it directly as a list:
> or pass a reference to the array:
or pass a reference to the array implicitly using a prototype:
sub myformat (\@) {
my $arr = shift;
foreach my $a (@$arr) {
print "$a\n";
}
}
myformat(@data);
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 27 Apr 2000 11:17:37 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: I'm about to lose a client!!! SOMEBODY HELP ME!!!
Message-Id: <Pine.A41.4.10.10004271114520.14050-100000@ginger.libs.uga.edu>
On Wed, 26 Apr 2000, Peter Hill wrote:
> Larry Rosler wrote:
> > In article <3904F507.5204@modulus.com.au> on Tue, 25 Apr 2000 11:29:43
> > +1000, Peter Hill <phill@modulus.com.au> says...
> > ...
> > > my @array = <TXT>;
> > > foreach (@array) {
> > For line-at-a-time processing, it is wasteful of memory to slurp the
> > entire file into an array before processing each element of the array.
> > People may take what you wrote here as an acceptable Perl idiom. It
> > isn't!
> Good point. My bad. Deducts points from self.
Wrong again! That should be
$self->{points} -= $deduction;
--
Brad
------------------------------
Date: Thu, 27 Apr 2000 08:12:00 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Internal Error?
Message-Id: <Pine.GSO.4.10.10004270811380.21722-100000@user2.teleport.com>
On Wed, 26 Apr 2000, Marcus Ouimet wrote:
> I am getting an internal server error
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.cpan.org/
http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html
http://www.cpan.org/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 27 Apr 2000 10:16:25 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Internal Error?
Message-Id: <390859C9.1771D5F2@texas.net>
Marcus Ouimet wrote:
>
> I am getting an internal server error when running my script for my web
> browser.
http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html
- Tom
------------------------------
Date: Thu, 27 Apr 2000 08:30:51 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Is there a way to create a Perl executable.
Message-Id: <Pine.GSO.4.10.10004270830070.21722-100000@user2.teleport.com>
On Thu, 27 Apr 2000, Philip Monitor wrote:
> >> As I understand it Perl gets compiled just before each execution. Is there
> >> a way to create Perl object code (i.e. an .exe ) program that does not
> >> need to be compiled every time it is run?
> Perl2exe
Many people say that that's not a compiler. Do you have some evidence to
the contrary?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 27 Apr 2000 18:58:11 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Is there a way to create a Perl executable.
Message-Id: <390871A3.56C3ADAA@ife.ee.ethz.ch>
Antony KING wrote:
>
> I've got a
> similar issue with the amount of time taken to compile the code - takes
> about 5 seconds,which is a pain when it's on a web server; latency like
> that is frowned on by your surfers.
That's why Apache has mod_perl
- Alex
------------------------------
Date: Thu, 27 Apr 2000 10:33:20 -0500
From: "Lee Sharp" <lee@insync.net>
Subject: Re: is there sendmail on Win32 platform
Message-Id: <O4ZN4.227$w6.4606@insync>
netnews wrote in message <8e9af8$lgg@netnews.hinet.net>...
|as title. so that I use it to send mail and receive mail in my perl script
|running on win98.
Amusingly enough, there is a port of sendmail on the microsoft web site.
:-) I downloaded it, but can't bring myself to actually try it. I prefer
NET::SMTP from IO::Libnet myself. Makes for more portable code, as not even
all Unix systems have sendmail.
Lee
--
SCSI is *NOT* magic. There are *fundamental technical reasons* why it is
necessary to sacrifice a young goat to your SCSI chain now and then. * Guns
are no more responsible for killing people than spoons are responsible for
making Rosie O'Donnell and Oprah Winfrey fat - I am speaking as an
individual, not as a representative of any company, organization or other
entity. I am solely responsible for my words.
------------------------------
Date: Thu, 27 Apr 2000 11:35:37 -0400
From: Eryq <eryq@zeegee.com>
To: wolman@hanmail.net
Subject: Re: Mail::Sender module problem
Message-Id: <39085E49.EE3EB107@zeegee.com>
You might want to download MIME::Lite 1.140 and take a look
at the example of sending an HTML document that way.
(MIME::Lite now supports SMTP sending.)
MIME::Lite 1.140 was just made available off:
http://www.zeegee.com/company/perl.html
Docs online at:
http://www.zeegee.com/code/perl/MIME-Lite/docs/
HTH,
Eryq
------------------------------
Date: Thu, 27 Apr 2000 12:57:53 -0400
From: Nathan Wright <nathan.wright@sdrc.com>
Subject: Mass email question...
Message-Id: <39087191.ACEDB2F0@sdrc.com>
Hello all,
Where I work I have constructed this page that my team can track work
on. Recently my boss asked me if we could have the page email whoever
assigned the work when the entry is unchanged after so many days.
So I wrote into the page an if construct that compares todays date to
the date of when the case was assigned. If the difference was greater
than 7 I would call an email subroutine and pass it who to mail, then
increment the date in the data(so it would only email the owner once a
day).
This works great if it only has to email one person, but when it has to
call the subroutine say ten times. It will email the same message over
and over.
I have no idea why it can't handle more than one increment.
So given all this background, here is my question....
Would it be better to iterate through the hash of data and call the
mailer in every iteration(which is what it does now) or send the mailer
the hash and have it iterate through it inside the sub? To me, I
wouldn't think it should matter.
I have attached the relevent code... the check and the sub.
Any and all help would be greatly appreciated. And go easy on me all
you hard core perlers, I know my code is long and drawn out, I like it
the way I can understand it all.
Thanks in advance,
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nathan.Wright@sdrc.com
Americas Support Center
Customer Applications Engineer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Check for case time outs
#
if (-r $DATA){
open(HANDLE,"<$DATA")|| print"<P>Cannot open cases data file
$DATA:$!\n";
while(<HANDLE>){
chop;
($key,@array) = split(/::/);
$HASH{$key} = [@array];
}
close(HANDLE);
}
foreach $key (sort(keys %HASH)){
if ($HASH{$key}[$i]){
($hand1,$more) = split(/:/,$HASH{$key}[$i]);
($hand2,$more) = split(/`/,$more);
($hand3,$more) = split(/~/,$more);
($hand4,$more) = split(/-/,$more);
($hand5,$hand6) = split(/=/,$more);
# $daten is date +%j and $hand2 is a stored date +%j
if (($daten-$hand2) > '7'){
if ($hand3 eq "Doug"){
$RECIPIENT = "nathan.wright\@sdrc.com";
}
if ($hand3 eq "Dwain"){
$RECIPIENT = "nathan.wright\@sdrc.com";
}
if ($hand3 eq "Jill"){
$RECIPIENT = "nathan.wright\@sdrc.com";
}
if ($hand3 eq "Claire"){
$RECIPIENT = "nathan.wright\@sdrc.com";
}
if ($hand3 eq "Annette"){
$RECIPIENT = "nathan.wright\@sdrc.com";
}
if ($hand3 eq "Nate"){
$RECIPIENT = "nathan.wright\@sdrc.com";
}
$hand2 = ($hand2+1);
@array = "$hand1:$hand2`$hand3~$hand4-$hand5=$hand6";
TIMEOUT($RECIPIENT,$BCC,"Reminder...","Case $key has been dormant
for more than 7 days.");
WRITE($key,@array);
}
}
}
sub TIMEOUT{
my $temp1 = $_[0];
my $temp2 = $_[1];
my $temp3 = $_[2];
my $temp4 = $_[3];
my $SUBMITTER = "Drafting.Team\@sdrc.com";
open(MAIL3,">$TMP_MAIL") || die ("Cannot open mail file $TMP_MAIL:
$!\n");
write MAIL3;
close(MAIL3);
system("cat $TMP_MAIL | /usr/lib/sendmail -t");
unlink('$TMP_MAIL');
return;
format MAIL3 =
To:
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$temp1
Cc:
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$temp2
From:
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$SUBMITTER
Subject:
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$temp3
~~
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$temp4
This email is automated... so reply all you want... 'cause no one's
listening.
.
}
------------------------------
Date: Thu, 27 Apr 2000 08:58:42 -0700
From: "Sean" <sean@industrial.bc.ca>
Subject: Memory?
Message-Id: <8e9o5d01nm5@enews1.newsguy.com>
I am writing a CGI script that builds over 30 html pages upon request. The
script is one file.
Last night, I added another scalar variable (string) to hold the location of
a database, and the script began to hang when run. I commented out that
variable and added another with a different name.... same thing. Heck, I
added a new variable to hold just a single number... no luck.
It turns out, that I cannot add ANY new variables into the script. Have I
hit a limit? Is this a memory problem?
Sean
------------------------------
Date: Thu, 27 Apr 2000 12:10:01 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Memory?
Message-Id: <39087469.E69F4B81@texas.net>
Sean wrote:
>
> I am writing a CGI script that builds over 30 html pages upon request. The
> script is one file.
>
> Last night, I added another scalar variable (string) to hold the location of
> a database, and the script began to hang when run. I commented out that
> variable and added another with a different name.... same thing. Heck, I
> added a new variable to hold just a single number... no luck.
>
> It turns out, that I cannot add ANY new variables into the script. Have I
> hit a limit? Is this a memory problem?
>
> Sean
There is a bug on line 17.
Translation: How can we assist in debugging your code if we can't see
it?
Produce the smallest possible example that demonstrates the behavior
you're seeing, and post it.
- Tom
------------------------------
Date: Thu, 27 Apr 2000 08:28:04 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: mixing STDERR and STDOUT
Message-Id: <Pine.GSO.4.10.10004270824060.21722-100000@user2.teleport.com>
On Thu, 27 Apr 2000, Larry R. Waibel wrote:
> I've got the following Perl script. When I run, all the STDOUT is in the
> file before the STDERR output, even though I did the STDERR first. How do I
> make sure that entries get into the file in the same order they happened? I
> thought that's what setting the autoflush ($|=1) would do?
Close, but that sets autoflush on the currently-selected filehandle, not
on all filehandles. (See the docs for the one-arg form of select.)
> open(STDERR, ">>$0.log");
> open(STDOUT, ">>$0.log");
Probably a good idea to check the return value from open. But if they're
both going to the same place, you could simply say so. (Untested.)
open(STDOUT, ">>$0.log")
or die "Can't redirect STDOUT: $!";
unless (open STDERR, ">>&STDOUT") {
print "Can't redirect STDERR: $!";
exit;
}
Enjoy!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 27 Apr 2000 08:34:38 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: mixing STDERR and STDOUT
Message-Id: <MPG.1371fddecd1fe90b98a997@nntp.hpl.hp.com>
In article <VA.00000030.18f9ae2a@cwia.com> on Thu, 27 Apr 2000 06:18:41
PDT, Larry R. Waibel <lwaibel@cwia.com> says...
> I've got the following Perl script. When I run, all the STDOUT is in the
> file before the STDERR output, even though I did the STDERR first. How do I
> make sure that entries get into the file in the same order they happened? I
> thought that's what setting the autoflush ($|=1) would do? Thanks!
>
> $| = 1;
> open(STDERR, ">>$0.log");
> open(STDOUT, ">>$0.log");
> $Time = localtime;
> print STDERR "$Time\n";
> print "$0.log\n";
> system qw(net use);
$| = 1;
sets the autoflush on the currently selected output filehandle, which by
default is STDOUT. You have to do it explicitly for STDERR also.
select STDERR;
$| = 1;
select STDOUT;
There are geekier ways to combine the above statements, but
straightforward will do just fine, thanks.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 27 Apr 2000 12:39:23 -0500
From: Tye McQueen <tye@metronet.com>
Subject: Re: Net:FTP module not working for me on perl win32...
Message-Id: <8e9u0b$pp1@beanix.metronet.com>
[Posted and e-mailed.]
Kourosh A Mojar <kmojar@bmjgroup.com> writes:
) syntax error at C:/Perl/site/lib/Net/Config.pm line 86, near ">"
ActiveState's Net/Config.pm is broken. Simply edit that file
and make the obvious :) change. Sorry, I don't have a broken
one handy to remember the precise change that was required.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: Thu, 27 Apr 2000 16:56:11 GMT
From: pt <paul_m_thompson@my-deja.com>
Subject: newbie q: Reassign STDOUT/ERR in DOS
Message-Id: <8e9rf3$a8r$1@nnrp1.deja.com>
I want to redirect STDERR (or STDOUT) before doing a "system" cmd,
then restore these streams. I'm running a Win98 DOS shell, so I can't
use the usual redirection. I may need to temporarily redirect both
STDOUT and STDERR to different files, or maybe to the same file, I'm
not sure until I can see where the error messages are actually going.
This is ActiveState Perl 5.6.0-613
This code will compile, but is it the "right" way (error handling left
out for simplicity).
----- cut here -----
$OldStdErr = STDERR ;
open(STDERR,">$ErrFile");
system $syscmd ;
close(STDERR) ;
$STDERR = $OldStdErr ;
open(ERRLOG,"$ErrFile") ;
while (<ERRLOG>)
{
blah-blah-blah
}
close(ERRLOG) ;
----- cut here -----
--
* Extra or missing linefeeds free from Deja.
* Obscure what you know.
* Pontificate on what you don't.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 17:27:51 GMT
From: exhacker@my-deja.com
Subject: Re: newbie q: Reassign STDOUT/ERR in DOS
Message-Id: <8e9ta4$cbr$1@nnrp1.deja.com>
In article <8e9rf3$a8r$1@nnrp1.deja.com>,
pt <paul_m_thompson@my-deja.com> wrote:
> I want to redirect STDERR (or STDOUT) before doing a "system" cmd,
> then restore these streams. I'm running a Win98 DOS shell, so I can't
> use the usual redirection. I may need to temporarily redirect both
> STDOUT and STDERR to different files, or maybe to the same file, I'm
> not sure until I can see where the error messages are actually going.
> This is ActiveState Perl 5.6.0-613
>
> This code will compile, but is it the "right" way (error handling left
> out for simplicity).
>
> ----- cut here -----
> $OldStdErr = STDERR ;
> open(STDERR,">$ErrFile");
> system $syscmd ;
> close(STDERR) ;
> $STDERR = $OldStdErr ;
>
> open(ERRLOG,"$ErrFile") ;
> while (<ERRLOG>)
> {
> blah-blah-blah
> }
> close(ERRLOG) ;
To redirect STDERR to the Web page created by a Perl script, you
redirect it to STDOUT, like this:
open (STDERR,">&STDOUT);
You could also keep a log file:
open (STDERR,">error.log");
If you're coding CGI, another option is to use CGI::Carp.
You could use functions such as die, warn, carp, croak, and confess to
handle errors, and you can use them for CGI. However, it's standard to
replace all of them with the corresponding functions in the CGI::Carp
module because this module produces messages more useful for CGI
scripts.
use CGI::Carp;
warn "This is a warning.";
die "A serious error occurred, so quitting.";
You can also redirect error messages from die, warn, and so on to a
file instead of STDERR by passing a file handle to the carpout function:
use CGI::Carp;
open(FILEHANDLE,">error.log");
carpout(\*FILEHANDLE);
And, you can even require that fatal error messages get sent to the
browser by using fatalsToBrowser :
use CGI::Carp qw(fatalsToBrowser);
die "A serious error occurred, so quitting.";
If you've absolutely lost your mind....
you could use Tie::STDERR
This module redirects the standard error output to email, file or
process. The advantage is that the module catches all output, warnings
coming from -w, dies, explicit prints to STDERR. You do not need any
special treating of error conditions, just use the module at the start
of your scripts. Also, it only sends the email if there actually is
something to send, like cron does, so you do not get email for each run
of the script, only for those when something went wrong.
Let me know if any of this helps.
exhacker
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 17:15:46 +0200
From: Wilfred Gander <gander@hei.unige.ch>
Subject: Perl 5.6.0 test failed
Message-Id: <390859A2.250B6C51@hei.unige.ch>
Hi,
Trying to compile Perl 5.6.0 on a SPARC Solaris 7 box. Compilation is
ok, but "make test" fails.
lib/db-btree.........FAILED at test 0
lib/db-hash..........FAILED at test 0
lib/db-recno.........FAILED at test 0
A "./perl harness" in the directory ./t. gives
lib/db-btree........dubious
Test returned status 0 (wstat 10, 0xa)
lib/db-hash.........dubious
Test returned status 0 (wstat 10, 0xa)
lib/db-recno........dubious
Test returned status 0 (wstat 10, 0xa)
lib/db-btree.t 0 10 ?? ?? % ??
lib/db-hash.t 0 10 ?? ?? % ??
lib/db-recno.t 0 10 ?? ?? % ??
When I try the following:
./perl lib/db-btree.t
1..155
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11
ok 12
ok 13
ok 14
ok 15
ok 16
ok 17
ok 18
Bus error
./perl lib/db-hash.t
1..109
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11
ok 12
ok 13
ok 14
Bus error
./perl lib/db-recno.t
1..126
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11
ok 12
ok 13
ok 14
ok 15
ok 16
Bus error
Any ideas ?
--
The Graduate Institute of International Studies
Wilfred Gander
Rue de Lausanne 132, 1202 Geneva, Switzerland
Phone : ++41 22 731 17 30 Fax : ++41 22 738 43 06
E-mail : gander *at* hei.unige.ch
WWW : http://heiwww.unige.ch/gander/
PGP : 1261 82EB 0190 B865 029E 4969 F408 3919 D707 7863
------------------------------
Date: Thu, 27 Apr 2000 12:20:36 -0400
From: "Steven Ulbrich" <sjutmp@msn.com>
Subject: Perl DLL
Message-Id: <sggpo12uqtj101@news.supernews.com>
What issues have found in using a compiled Perl DLL in a asp application.
Thans for the Feed Back
Steven Ulbrich
------------------------------
Date: Thu, 27 Apr 2000 11:05:03 -0400
From: "Mulligan Services" <recruiter@mulliganservices.com>
Subject: Perl help needed on part-time telecommuting basis - NY - Tarrytown
Message-Id: <sggmomi0qtj97@corp.supernews.com>
We are seeking a Perl, CGI developer for off-site, part-time contract work
in Tarrytown, NY. Development is on a Unix platform. Occasional visits to
client site as needed. Approximately 10 hours (+ or -) / week initially.
Send resume or correspondence to:
recruiter@mulliganservices.com
954-741-2106 fax
IT7049755
------------------------------
Date: Thu, 27 Apr 2000 19:04:05 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Perl help needed on part-time telecommuting basis - NY - Tarrytown
Message-Id: <39087305.5D46D9F1@ife.ee.ethz.ch>
Mulligan Services wrote:
>
> We are seeking a Perl, CGI developer
To me it looks like you are seeking flames for posting inappropriate job
ads
- Alex
------------------------------
Date: Thu, 27 Apr 2000 11:08:30 -0400
From: Brock Murch <bmurch@cfcg.er.usgs.gov>
Subject: Perl OO question! - Deleting element of Hash of objects...
Message-Id: <390857EE.9CBD34FC@cfcg.er.usgs.gov>
I have a flat file that is parsed into a anon hash $emp. This parse
takes the values and passes them to a package Employee.pm . The hash
element $emp->{$employee} is the container for the blessed object (a
hash of objects). I start out with about 80 objects. I have a `sub
reply' that:
1. can call a sub delete the $emp->{$employee};
2. calls a sub to re-write the flat file; and,
3. returns the output to a web page.
The gremlins are driving me nuts. I have asked two perl programmers but
no luck.
When I first tried to do it 'delete $emp->{$employee}' for some reason I
had a blank line print out in the flat file. Then something changed
somewhere, but I'm not sure where, and now it doesn't!
Now after I 'delete $emp->{$employee}' and do a test such as: print
"Here is the ref: ", $emp->{$employee} if ($emp->{$employee});
# or if (defined($emp->{$employee}));
# or if (exists$emp->{$employee}));
The line does not print, however,
if I put the if statement into block format
if ($emp->{$employee})
{
print "Inside the if\n";
}
It goes into the block as thought it exists and gets stuck on the
foreach in the following code;
So, at first when the blank line was showing up in the output file, I
thought, well I am deleting the anon hash element containing the
reference but not the the actual object itself... so I created the
"$emps->{$mod_emp}->delete_me()" method to delete the object first
inside the class.
Here is some of the code and response:
sub delete
{
print "Was completed for ", $emps->{$mod_emp}->full_name(), ".<p>\n";
print "Here is the ref '", ref($emps->{$mod_emp}), "'<p>";
print "Current values for ", $emps->{$mod_emp}->{'_full_name'}, ",
should be empty in the following list:<p>\n";
print "The $emps->{$mod_emp} exists<P>\n" if exists ($emps->{$mod_emp});
$emps->{$mod_emp}->delete_me(); # #### see below for this method
code...
print "After the delete method call $emps->{$mod_emp} exists<P>\n" if
exists ($emps->{$mod_emp});
delete $emps->{$mod_emp};
print "After delete the $emps->{$mod_emp} exists<P>\n" if exists
($emps->{$mod_emp});
print "After delete the $emps->{$mod_emp} exists<P>\n" if
($emps->{$mod_emp});
print "Second call to if (emps->$mod_emp) causes it to exist again<p>\n"
if ($emps->{$mod_emp});
print "Third call to if (emps->$mod_emp) causes it to exist again<p>\n"
if exists ($emps->{$mod_emp});;
print "After third call the (emps->$mod_emp) val:", $emps->{$mod_emp}, "
ref: ", ref($emps->{$mod_emp}), "<P>\n";
print "Ref: ", ref($emps->{$mod_emp}), "<P>\n";
if ($emps-{$mod_emp})
{
my $new_emp_val;
print "Inside the if statement<ul>\n";
print "Ref again: ", ref($emps->{$mod_emp}), " Alone: ",
$emps-{$mod_emp};
foreach $new_emp_val (sort keys %{$emps-{$mod_emp}})
{
# print "<li> $new_emp_val Value
is #
$emps->{$new_emp_val}->{_line}\n";
}
print "</ul><p>\n";
}
print "Ouch... <br>\n";
return $emps;
}
Here is the Employee class method called above:
sub delete_me
{
my ($self) = shift @_;
print "<p>Inside Employee class:<br>";
print "The value of self,", $self, "<br>\n";
$self = ();
print "The second value of self,", $self, "<p>\n";
return $self;
}
Here is the Web output:
The following action: Delete
Was completed for Sandy Coffman.
Here is the ref 'Employee'
Current values for Sandy Coffman, should be empty in the following list:
The Employee=HASH(0x1b3750) exists
Inside Employee class:
The value of self,Employee=HASH(0x1b3750)
The second value of self,
After the delete method call Employee=HASH(0x1b3750) exists
After third call the (emps->CoffmanSandy) val: ref:
Ref:
Inside the if statement
Ref again: Alone: -228
NOW....
So I am lost. I have done a couple of work arounds:
1. Remove the foreach loop to get past it and print the whole content of
the web page. (ie closing html tags).
2. Test for a a value in the $emps->{$new_emp_val}->{_line}, and if not
don't print it. The actual ' print DATA $emps->{$employee}->{_line},
"\n"; ' looked like this and thus the blank line printing!!!
But this isn't good programming....
Any suggestions?
Brock Murch
Web Programmer
http://coastal.er.usgs.gov
US Geological Survey
Center for Coastal Geology
600 4th Street South
St. Petersburg, FL 33701
ph: (727) 803-8747 x3089 fax: (727) 803-2032
email: bmurch@cfcg.er.usgs.gov
------------------------------
Date: Thu, 27 Apr 2000 12:11:25 -0400
From: Brock Murch <bmurch@cfcg.er.usgs.gov>
Subject: Re: Perl OO question! - Deleting element of Hash of objects...
Message-Id: <390866AD.5A0FD0FE@cfcg.er.usgs.gov>
--------------3A9E600A5473A0C70B7E68B7
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Brock Murch wrote:
> I have a flat file
Yada Yada Yada...
oops! Notice the missing -> operator here!
> if ($emps-{$mod_emp})
> {
> my $new_emp_val;
> print "Inside the if statement<ul>\n";
> print "Ref again: ", ref($emps->{$mod_emp}), " Alone: ",
> $emps-{$mod_emp};
Sorry!!!
--
Brock Murch
Web Programmer
http://coastal.er.usgs.gov
US Geological Survey
Center for Coastal Geology
600 4th Street South
St. Petersburg, FL 33701
ph: (727) 803-8747 x3089 fax: (727) 803-2032
email: bmurch@cfcg.er.usgs.gov
--------------3A9E600A5473A0C70B7E68B7
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Brock Murch wrote:
<blockquote TYPE=CITE>I have a flat file</blockquote>
Yada Yada Yada...
<p>oops! Notice the missing -> operator here!
<blockquote TYPE=CITE>if ($emps-{$mod_emp})
<br> {
<br> my $new_emp_val;
<br> print "Inside the if statement<ul>\n";
<br> print "Ref again: ", ref($emps->{$mod_emp}),
" Alone: ",
<br>$emps-{$mod_emp};</blockquote>
<p><br>Sorry!!!
<pre></pre>
<pre>--
Brock Murch
Web Programmer
<A HREF="http://coastal.er.usgs.gov">http://coastal.er.usgs.gov</A>
US Geological Survey
Center for Coastal Geology
600 4th Street South
St. Petersburg, FL 33701
ph: (727) 803-8747 x3089 fax: (727) 803-2032
email: bmurch@cfcg.er.usgs.gov</pre>
</html>
--------------3A9E600A5473A0C70B7E68B7--
------------------------------
Date: 27 Apr 2000 17:00:44 GMT
From: jcuesta@tid.es (CUESTA CUESTA)
Subject: Posting MIME articles from scripts
Message-Id: <8e9rns$9dl7@tid.tid.es>
I only want to write an article using several formats at a same time. I don't
know what news reader use most of you. I'm using an old version of tin (1.2)
and it supports mime. I've posted articles with netscape messenger and tin
detects that it has mime format and show me the text part. Thats all I want to
do, post an article with two parts: text and html.
--
------------------------------
Date: Thu, 27 Apr 2000 10:34:19 -0500
From: Digiwyrm <digiwyrm@linuxnet.net>
Subject: prob installing DBI / DBD
Message-Id: <39085DFB.F509DEC7@linuxnet.net>
I am using the automatic CPAN process to install the informix DBD driver
& DBI. I get the following error message. Please advise how ot fix.
Thanks,
-------------------------------------------------------------------------------------
CPAN.pm: Going to build JOHNL/DBD-Informix-1.00.PC1.tar.gz
Can't locate loadable object for module DBI in @INC (@INC contains:
/usr/lib/per
l5/5.00503/i386-linux /usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386
-linux /usr/lib/perl5/site_perl/5.005 .) at
/usr/lib/perl5/5.00503/DBI.pm line 1
58
BEGIN failed--compilation aborted at /usr/lib/perl5/5.00503/DBI.pm line
158.
BEGIN failed--compilation aborted at Makefile.PL line 23.
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install
----------------------------------------------------------------------------------
------------------------------
Date: Thu, 27 Apr 2000 16:02:48 GMT
From: kooloholic@my-deja.com
Subject: Problem FTPing tar file via PERL script
Message-Id: <8e9oas$6mr$1@nnrp1.deja.com>
I have a script (running on Unix/Linux) which creates a tar file and
then uses the Net::FTP module to send it to a remote machine. Depending
on which machine I send it to, the tar file loses a byte during the
transfer. This happens for some destinations, but not others. This
doesn't through any errors, but of course completely corrupts the tar
file.
Has anyone encountered this before?
Does anyone have any sort of explaination and/or work-around?
Thanks.
Cheers, Christopher
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 09:33:03 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Problem FTPing tar file via PERL script
Message-Id: <Pine.GSO.4.10.10004270928330.21722-100000@user2.teleport.com>
On Thu, 27 Apr 2000 kooloholic@my-deja.com wrote:
> Depending on which machine I send it to, the tar file loses a byte
> during the transfer. This happens for some destinations, but not
> others.
Sounds like a serious bug, probably(?) in those sites' FTP daemons. Just
to be certain, though, are you sure you're sending it in binary mode? Can
you send the same file to those sites without problems when you use
another client than Net::FTP?
> This doesn't through any errors, but of course completely corrupts the
> tar file.
Your spelling 'through' me for a moment there. :-) You are checking for
errors during the transfer, right?
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 2880
**************************************