[10774] in Perl-Users-Digest
Perl-Users Digest, Issue: 4375 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 7 18:07:17 1998
Date: Mon, 7 Dec 98 15:00:22 -0800
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, 7 Dec 1998 Volume: 8 Number: 4375
Today's topics:
Re: $ENV{'REMOTE_HOST'} Problem on NT (Larry Rosler)
Re: CGI Redirection (brian d foy)
Checking on NT printers... (Rob Greenbank)
Re: Code Bash: File Include (Larry Rosler)
Re: Code Bash: File Include (Sam Curren)
Re: Code Bash: File Include (Sam Holden)
Conditional statements in control structures <jeffbremovethis@mcguckin.com>
Re: Conditional statements in control structures (Greg Bacon)
Re: Conditional statements in control structures (Andrew M. Langmead)
Re: file creation in Perl (Martien Verbruggen)
Re: Help clearing hash index from memory (Charles DeRykus)
Re: How to open a background process in Perl and CGI/Pe (Martien Verbruggen)
Re: I hate to ask, but i'm stuck on my logic :-( <daniel.vesma@thewebtree.com>
Re: I hate to ask, but i'm stuck on my logic :-( <daniel.vesma@thewebtree.com>
Re: I hate to ask, but i'm stuck on my logic :-( (Andrew M. Langmead)
JPL (Java/Perl Lingo) Released? <jdmadea@boneyard.millersv.edu>
Re: JPL (Java/Perl Lingo) Released? (Ilya Zakharevich)
Re: MySQL or PostGresSQL or ??? (follow-up question) mchunziker@us.fortis.com
Re: Need Help on code! <schuette@umr.edu>
Re: Net::FTP get problem (Charles DeRykus)
Not a subroutine reference <ayoung@sigg.com>
Re: Not a subroutine reference <ayoung@sigg.com>
Re: Perl and Btrieve Support ishulz@my-dejanews.com
Re: perl zip <fichou@clubintnet.fr>
Re: POSIX not found (Ilya Zakharevich)
SFPUG Pizza SIG; Tuesday, Dec. 15 (Rich Morin)
Socket.pm vs. socket.ph (Kenneth Herron)
SSI from Perl on IIS <mpolakow@emergemarketing.com>
Re: Uploading files with Perl? (Martien Verbruggen)
Re: usage of $_ within nested loops (Bart Lateur)
Re: usage of $_ within nested loops (Greg Bacon)
Where is CGI group? <bamboosource@earthlink.net>
Re: Where is CGI group? (Matthew Bafford)
Re: Which modules to use <mimo@interdata.com.pl>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 7 Dec 1998 12:08:51 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: $ENV{'REMOTE_HOST'} Problem on NT
Message-Id: <MPG.10d5d5b1dd119b389898ab@nntp.hpl.hp.com>
In article <366C2AB1.446B@eai.com> on Mon, 07 Dec 1998 13:21:21 -0600,
Bryan Hart <bryan@eai.com> says...
> Bill wrote:
> > Does anybody know why, when I run $ENV{'REMOTE_HOST'}, do I always come up
> > with an IP address instead of user123.blah.com or whatever?
>
> This is provided by the webserver, so you're at it's mercy. If the
> webserver is configured to return resolved hostnames, that's what you
> get. If name resolution isn't available (or enabled) then you will get
> IP addresses.
If name resolution isn't available (which is very unlikely!), there is
nothing you can do. But if it isn't enabled (which is very likely!),
you can do it yourself, rather easily.
There are several resources: the docs in Socket.pm, the gethostbyaddr()
function, and, for example, Recipe 17.7 in The Perl Cookbook,
"Identifying the Other End of a Socket".
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 07 Dec 1998 17:44:55 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: CGI Redirection
Message-Id: <comdog-ya02408000R0712981744550001@news.panix.com>
In article <74cduh$4a4$1@nnrp1.dejanews.com>, fairbairn_97@yahoo.com posted:
> I was enquiring whether any body knows where I can get a CGI script that
> redirects URLs to another place automatically... I was planning on doing
> something like ML.ORG where they redirect TEST.HOME.ML.ORG to
> www.mydomain.com/test/test/test/go.html
> He who gives me the correct answer will be placed on the front page of my web
> site.......
how would you recognize a correct answer? if you want to do this,
forget about Perl or CGI and configure the server to do it automatically.
that is, unless you want to use a Perl trans handler or the like.
there are about 15 different ways to do this, and those are only
the ones i know off the top of my head. still, i don't want to be
on your webpage ;)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 07 Dec 1998 22:48:17 GMT
From: rob@frii.com (Rob Greenbank)
Subject: Checking on NT printers...
Message-Id: <366c5a61.255998781@news.frii.com>
I need to implement a printer monitor to keep an eye on quite a few
network printers. If there is a handy perl module to help me out, it
would be a great solution. Even if it's not that handy, I'd be
interested in any solution.
I've searched DejaNews (both perl and NT newsgroups) and didn't come
up with anything. I also looked through the modules that seemed to be
the most likely candidate. Came up with nothing.
Anyone?
Thanks,
Rob Greenbank (rob.greenbank@janus.com)
------------------------------
Date: Mon, 7 Dec 1998 12:54:34 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Code Bash: File Include
Message-Id: <MPG.10d5e05fe184c8c39898ac@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <MPG.10d5ce9a542391609896b0@news.sonic.net> on Mon, 7 Dec
1998 11:38:43 -0800, Sam Curren <samc@empirewest.com> says...
> Here is a subroutine I wrote to include other files in output, mostly for
> preformatted html, but also for non-cgi purposes. Rip it to shreds, that
> I might learn better coding practices. Thanks!
>
> calling method:
>
> ifile("include.txt");
>
> subroutine:
>
> sub ifile {
> foreach $file (@_) {
Get into the habit of using '-w' on the first line of the program, and
'use strict;' as the second line. It is unlikely you will ever regret
it. Then you will have to declare $file:
foreach my $file (@_) {
> unless(open IFILE, $file) { print("Can't open $file: $!\n"); return;
> }
This is a praiseworth diagnostic. It might be written more
conventionally as:
open IFILE, $file or die "Can't open '$file': $!\n";
> while($line = <IFILE>) { print $line; }
I prefer to use the default $_; either:
print while <IFILE>;
or (if the files are small enough to fit comfortably in memory):
print <IFILE>;
> close IFILE;
> }
> }
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 7 Dec 1998 14:34:47 -0800
From: samc@empirewest.com (Sam Curren)
Subject: Re: Code Bash: File Include
Message-Id: <MPG.10d5f7dfaab9a0a39896b1@news.sonic.net>
Thanks for the comments Larry. Exactly what I needed.
One question:
> > unless(open IFILE, $file) { print("Can't open $file: $!\n"); return;
> > }
>
> This is a praiseworth diagnostic. It might be written more
> conventionally as:
>
> open IFILE, $file or die "Can't open '$file': $!\n";
I was using the print statement so that it would be printed to STDOUT,
making debugging easy. Is there a better way to do this? Perhaps
redirecting the output of die() to STDOUT?
Thanks again. -Sam
------------------------------
Date: 7 Dec 1998 22:58:34 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Code Bash: File Include
Message-Id: <slrn76oncq.drj.sholden@pgrad.cs.usyd.edu.au>
On Mon, 7 Dec 1998 14:34:47 -0800, Sam Curren <samc@empirewest.com> wrote:
>Thanks for the comments Larry. Exactly what I needed.
>
>One question:
>
>> > unless(open IFILE, $file) { print("Can't open $file: $!\n"); return;
>> > }
>>
>> This is a praiseworth diagnostic. It might be written more
>> conventionally as:
>>
>> open IFILE, $file or die "Can't open '$file': $!\n";
>
>I was using the print statement so that it would be printed to STDOUT,
>making debugging easy. Is there a better way to do this? Perhaps
>redirecting the output of die() to STDOUT?
It would probably be better to turn of buffering (OK so technically there is
still buffering) on STDOUT. Assumming of course that the problem you were
fixing is that the error messages get printed before the print statements
that executed before them (wow - I don't think I could have made less sense
if I tried then).
'$|=1;' will cause output to STDOUT to be printed when you probably
expect it to.
Of course having skipped over the original post I probably have no idea
what I'm talking about and am completely off the mark.
--
Sam
Simple rule: include files should never include include files.
--Rob Pike
------------------------------
Date: Mon, 07 Dec 1998 14:18:17 -0700
From: Jeff Beard <jeffbremovethis@mcguckin.com>
Subject: Conditional statements in control structures
Message-Id: <366C4619.D34E7000@mcguckin.com>
Hello,
I've got an array that I want to loop through and when I am at the first
value (regardless of the value) I want to do one thing but for the rest
do something different. What I have is:
my @array = qw(apples oranges pears);
my $i = @array1[0];
foreach (@array) {
if ($_ = $i) {
print "$_\n";
} else {
print "$_\n";
}
This, of course, doesn't work. I've also tried something similar with a
while loop. Could you help please?
Thanks much,
Jeff
--
Jeff Beard
Systems Administrator
McGuckin Hardware
Boulder, CO
------------------------------
Date: 7 Dec 1998 22:23:05 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Conditional statements in control structures
Message-Id: <74hkg9$q7g$2@info.uah.edu>
In article <366C4619.D34E7000@mcguckin.com>,
Jeff Beard <jeffbremovethis@mcguckin.com> writes:
: I've got an array that I want to loop through and when I am at the first
: value (regardless of the value) I want to do one thing but for the rest
: do something different. What I have is:
:
: my @array = qw(apples oranges pears);
:
: my $i = @array1[0];
Should be
my $i = $array1[0];
: foreach (@array) {
: if ($_ = $i) {
Should be
if ($_ == $i) {
[snip]
In fewer characters:
my $i = $array1[0];
print join "\n", grep { $_ == $i } @array1, "";
Greg
--
Artifical insemination is when the farmer does it to the cow instead of the
bull.
-- Funny Answers to Science Test Questions
------------------------------
Date: Mon, 7 Dec 1998 22:58:51 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Conditional statements in control structures
Message-Id: <F3MAI3.FsM@world.std.com>
Jeff Beard <jeffbremovethis@mcguckin.com> writes:
>I've got an array that I want to loop through and when I am at the first
>value (regardless of the value) I want to do one thing but for the rest
>do something different. What I have is:
Do you want to perform this different action for the first element of
the array? Or for every element that matches the first element. (What
do you want to do for "qw(apples oranges pears apples)"?)
If you want to do something for the very first element, you might be
better off handling the first element specially, then dealing with the
rest of the loop.
print "$array[0]\n";
foreach ( @array[ 1 .. $#array ] ) {
print "$_\n";
}
If you want to do something for every element that matches the first
element, you almost have it right. It would look like this:
#!/usr/bin/perl -w
my @array = qw(apples oranges pears);
my $match = $array[0];
foreach $current (@array) {
if($current eq $match) {
print "$current\n";
}
else {
print "$current\n";
}
}
Here it is again with some running commentary:
#!/usr/bin/perl -w
This will print diagnosting messages when perl sees some sort of
construct that it thinks might not be what you expect.
my @array = qw(apples oranges pears);
my $match = $array[0];
Notice that when you retrieve a single element form an array
you precde the array with a dollar sign, not an at-sign. The
special marker describes the type of data you want to get
back, not the data type itself. This is one of the potential
mistakes that the "-w" flag catches.
I also took the liberty of changing the name of the variable "$i" to
"$match" to give a better idea of its purpose.
foreach $current (@array) {
I took another liberty here. Personally I dislike using an implict
assignment to "$_" if the rest of the code has to explictly refer
to it. I try to only use "for(@whatver)" if the body of the loop
uses things like the regular expression operators, grep, or map.
if($current eq $match) {
Here is the heart of your problem. Since you want to compare to
strings to see if they contain the same sequence of characters,
you want the "eq" operator. What you had in "$_ = $i" was the
assingment operator which set the currently looped on element of
@array to the string you wanted to match against.
The "-w" flag checks for this mistake too.
print "$current\n";
}
else {
print "$current\n";
}
}
--
Andrew Langmead
------------------------------
Date: Mon, 07 Dec 1998 22:08:41 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: file creation in Perl
Message-Id: <JlYa2.84$884.194@nsw.nnrp.telstra.net>
In article <74gcjv$8f1$1@nnrp1.dejanews.com>,
iron_fist@my-dejanews.com writes:
> if (-e "filename")
> {
> open (handle, "filename");
Always check the return value of open.
> }
> else
> {
> CREATE FILE NAME
> }
> what is the missing command ("CREATE FILE NAME") to create the file?
> if it is possible?
open will create the file if it doesn't exist. There is no need to test.
# perldoc -f open
Please read the documentation.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I think I think, therefore I think I
Commercial Dynamics Pty. Ltd. | am.
NSW, Australia |
------------------------------
Date: Mon, 7 Dec 1998 22:30:02 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Help clearing hash index from memory
Message-Id: <F3M962.DJE@news.boeing.com>
In article <366C1ADC.73FDBAAB@cybersource.com>,
Pete Cion <pcion@cybersource.com> wrote:
>
>I am working with a rather large associative array (about 100,000
>name/value pairs) that I need to keep in memory. The problem isn't the
>array itself, but that once the array is undef'd, the memory is not
>released. I assume that this memory is for the index to the associative
>array rather than for the array itself.
>
>Any thoughts as to how to clear the index out of memory once the array
>itself has been undef'd?
>
The memory footprint of the perl program won't shrink; the
memory will be re-used internally though.
Search for 'perl' AND 'sbrk' on DejaNews for more info.
hth,
--
Charles DeRykus
------------------------------
Date: Mon, 07 Dec 1998 22:22:14 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How to open a background process in Perl and CGI/Perl?
Message-Id: <qyYa2.87$884.194@nsw.nnrp.telstra.net>
In article <01be21f8$5074f200$5d68b9a3@wtang-sgl.sugar-land.geco-prakla.slb.com>,
"William Tang" <wtang@flash.net> writes:
> Hello, I have trouble on opening a background process in my Perl CGI
> program.
What are your troubles? Does the fork succeed? Does the browser not
identify that the page is done?
If you have a problem, and you need help, the first thing you do is
explain what the problem is. 'I have trouble' does not mean a thing.
In this case: perl is obviously fine, so your 'problem' is probably
related to CGI. So you need to find out why CGI is special.
You can find hints in perlfaq8
# perldoc perlfaq8
How do I start a process in the background?
You may also want to have a look at:
http://www.stonehenge.com/merlyn/WebTechniques/
Some of the examples there fork, and do it correctly for a CGI
process, especially loook at column 20.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Advertising: The science of arresting
Commercial Dynamics Pty. Ltd. | the human intelligence long enough to
NSW, Australia | get money from it.
------------------------------
Date: Mon, 7 Dec 1998 20:07:43 -0000
From: "Daniel Vesma" <daniel.vesma@thewebtree.com>
Subject: Re: I hate to ask, but i'm stuck on my logic :-(
Message-Id: <366c3570.0@news.thefree.net>
>Do you want
>to print together all of the lines that the ID's match? (If so, why
>not just match the subject lines?)
Good point, no reason why not to.
>Assuming that is what you are trying to do, how large will the file
>become (small enough to fit the entire file into memory?) If so, then
>you might want to build a hash of hashes keyed by ID number.
the file is hoing to stay nice and little.
>while(<ChatRoomFile>) {
> ($ID, $N, $Name, $email, $subject, $Message) = split(/\|/, $_);
> $threads{$ID} = { N => $N, Name => $Name,
> email => $email, subject => $subject, Message => $Message };
>}
>
>for my $thread (sort { $a <=> $b } keys %threads) {
> for my $message (@$thread) {
> print "\n$message->{Name} talks about $message->{subject}"
> }
>}
I added the open() line, but it gave me the error missing $ on loop variable
at hash.pl line 9
Thanks for your help.
Daniel Vesma
www.thewebtree.com
www.thewebtree.com/daniel-vesma
------------------------------
Date: Mon, 7 Dec 1998 20:47:34 -0000
From: "Daniel Vesma" <daniel.vesma@thewebtree.com>
Subject: Re: I hate to ask, but i'm stuck on my logic :-(
Message-Id: <366c3ee7.0@news.thefree.net>
Thanks, but all sorted now. I changed the way I did it.
Daniel Vesma
www.thewebtree.com
www.thewebtree.com/daniel-vesma
------------------------------
Date: Mon, 7 Dec 1998 21:13:30 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: I hate to ask, but i'm stuck on my logic :-(
Message-Id: <F3M5MJ.7qu@world.std.com>
"Daniel Vesma" <daniel.vesma@thewebtree.com> writes:
>Thanks for your help.
If you could call it that.
I'm very sorry. I had something that was pretty much working, pasted
into my message, and then started messing with it some more. What you
got was an unworkable mess. (Although not for the problem that you
pointed out.)
Let me try it again:
#!/usr/bin/perl -w
use strict;
my ($ID, $N, $Name, $email, $subject, $Message);
my (%threads, $thread, $message);
open(ChatRoomFile, 'chat.txt') or die("can't find it");
while(<ChatRoomFile>) {
($ID, $N, $Name, $email, $subject, $Message) = split(/\|/, $_);
push @{$threads{$ID}}, { N => $N, Name => $Name,
email => $email, subject => $subject, Message => $Message };
}
for $thread (@threads{ sort { $threads{$a} <=> $threads{$b} }
keys %threads}) {
for $message (@$thread) {
print "\n$message->{Name} talks about $message->{subject}"
}
}
As for the error messages that you saw. you seemt be using a version
of perl earlier than 5.004 New versions allow the construct
"for my $var(@list)" to create loop variables that are local to the
loop. In this case, you can just move the declaration earlier in the
file without any real difference.
--
Andrew Langmead
------------------------------
Date: Mon, 07 Dec 1998 17:26:17 -0500
From: Jeremy Madea <jdmadea@boneyard.millersv.edu>
Subject: JPL (Java/Perl Lingo) Released?
Message-Id: <366C5609.7F4B91B8@boneyard.millersv.edu>
A friend of mine sent me a copy of "WebPromote Weekly - December 1998:
Volume 1" in which there was a claim that JPL (which they said stood for
"Java/Perl Lingo") was being made freely available at www.perl.com. I
know JPL comes with the Perl Resource Kit, and, of course, I wanted to
check it out. After failing to find it on perl.com, I found a post on
internetnews.com that said it came packaged with perl5.005_54, but the
latest development version on perl.com is, as far as I can tell,
5.005_53.
Is this a hoax? Has JPL been made freely available?
-j
------------------------------
Date: 7 Dec 1998 22:38:50 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: JPL (Java/Perl Lingo) Released?
Message-Id: <74hldq$ppf$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Jeremy Madea
<jdmadea@cs.millersv.edu>],
who wrote in article <366C5609.7F4B91B8@boneyard.millersv.edu>:
> check it out. After failing to find it on perl.com, I found a post on
> internetnews.com that said it came packaged with perl5.005_54, but the
> latest development version on perl.com is, as far as I can tell,
> 5.005_53.
Did you check on CPAN? in authors/id/GSAR?
Ilya
------------------------------
Date: Mon, 07 Dec 1998 20:53:41 GMT
From: mchunziker@us.fortis.com
Subject: Re: MySQL or PostGresSQL or ??? (follow-up question)
Message-Id: <74hf8k$7hv$1@nnrp1.dejanews.com>
I downloaded the postgresql-v6.4 source and was able to compile it
and the perl Pg.pm module. I have apache running and was able to do web based
queries using perl without too much work. I'm very new to databases and
postgresql is the first I've used so I really can't comment on the security
features and such of either database.
>In article <366B8A07.26901E47@mindspring.com>,
> Peter Smith <psmith01@mindspring.com> wrote:
> Peter Smith wrote:
> >
> > I'm about to write a web-to-database ecommerce application. I plan on
> > using Apache web server with Perl to access the database. Which
> > database is better, MySQL or PostGresSQL?? Are there others I missed??
> > The cheaper the database, the better!
> >
>
> Also, should I use the RPM-based MySQL since I'm running RedHat, or
> should I just grab the latest binary??
>
> --
> --Peter--
> psmith01@mindspring.com
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 07 Dec 1998 16:20:36 -0600
From: Matt Schuette <schuette@umr.edu>
Subject: Re: Need Help on code!
Message-Id: <366C54B3.490A2F33@umr.edu>
If you do
/^Customer: /
Then the variable $' (or $POSTMATCH) holds everything after the match,
in this case the match would be "Customer: " at the beginning of a
line. Hope that helps!
Matt
------------------------------
Date: Mon, 7 Dec 1998 22:12:06 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Net::FTP get problem
Message-Id: <F3M8C7.CIr@news.boeing.com>
In article <746fjg$67n$1@nnrp1.dejanews.com>,
<harkal@rainbow.cs.unipi.gr> wrote:
> Hi, i have a little problem with the "get" of the Net::FTP.
>If the link fails while the file transfer the "get" is not timeing out.
>How can I make it time out, or to inform me about the situation...
you could roll your own timeout and use the C<abort> method
to stop the transfer, e.g.,
eval {
local $SIG{ALRM} = sub {die "timed out"};
alarm 20;
$ftp->get("/path/to/file");
alarm 0 ;
};
if ($@ =~ /^timed out/) {
warn "ftp timed out\n";
$ftp->abort;
} elsif ($@) {
die "unexpected error: $@";
}
$ftp->quit;
hth,
--
Charles DeRykus
------------------------------
Date: Mon, 07 Dec 1998 14:22:22 -0600
From: Aaron Young <ayoung@sigg.com>
Subject: Not a subroutine reference
Message-Id: <366C38FE.9362AF9F@sigg.com>
Perl People,
I'm writing this app (in Perl) and I am suddenly getting this error Not
a Subroutine Reference.
I have found some information about it, but not much.
What I have seen is that this is me trying to use a reference to a
non-function as a function.
the only thing is, I can't seem to find where I'm making the mistake.
What types of things should i be looking for? Is there a known
suspicious construct?
by the way, the error shows up in MIME::Lite (which works beautifully
otherwise, except when I call it from my program in a certain spot)
------------------------------
Date: Mon, 07 Dec 1998 15:38:28 -0600
From: Aaron Young <ayoung@sigg.com>
Subject: Re: Not a subroutine reference
Message-Id: <366C4AD4.77357CB6@sigg.com>
More information
I went ahead and rolled a small module to send mail off (much simpler than
Mime::Lite) and got the same error which confirms my suspicions that it
wasn't the module (though I never really thought it was)
it seems I get the error on the
close(M) line in my program and the close(SENDMAIL) line in MIME::Lite
I could include the code here but it is quite a bit
I'm just wondering what type of things to LOOK for
Aaron Young wrote:
> Perl People,
>
> I'm writing this app (in Perl) and I am suddenly getting this error Not
> a Subroutine Reference.
>
> I have found some information about it, but not much.
>
> What I have seen is that this is me trying to use a reference to a
> non-function as a function.
>
> the only thing is, I can't seem to find where I'm making the mistake.
>
> What types of things should i be looking for? Is there a known
> suspicious construct?
>
> by the way, the error shows up in MIME::Lite (which works beautifully
> otherwise, except when I call it from my program in a certain spot)
------------------------------
Date: Mon, 07 Dec 1998 20:13:54 GMT
From: ishulz@my-dejanews.com
Subject: Re: Perl and Btrieve Support
Message-Id: <74hctv$5d0$1@nnrp1.dejanews.com>
In article <364bd3a0.238259569@news.mmc.org>,
drummj@mail.mmc.org wrote:
> On Wed, 11 Nov 1998 08:26:28 -0800, Lee Rouman <lrouman@definity.com> wrote:
>
> [ rewrapped *AGAIN* - Although Communicator doesn't come close to being a
> 'good' news reader, it DOES let you configure line length. PLEASE fix at 72
> columns. ]
>
> >Jeffery, thanx for your response. I am aware and have used the ODBC
> >functionality with Btrieve and other ODBC-compliant data structures.
> >
> >I was hoping for a more direct solution ala Db::Ctree or DBD::XBase.
> >Anyone out there working on this type of module?
> >
> >Lee.
>
> Not that I know of. Pervasive discussed the creation of such a module amongst
> their development team members, but round-filed the idea when the ODBC
support
> for Perl appeared.
>
pardon me for stupid question, but is it possible (with or without DBD::ODBC)
to connect to Btrieve DB on Netware server by perl from Linux box?
Thank
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 7 Dec 1998 21:16:03 +0100
From: "Patrick Fichou" <fichou@clubintnet.fr>
Subject: Re: perl zip
Message-Id: <74hd4l$p9n$1@front4.grolier.fr>
Mary,
There are site dedicated to Perl for that... Take a look at them !
Patrick
------------------------------
Date: 7 Dec 1998 20:20:55 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: POSIX not found
Message-Id: <74hdb7$i7b$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Bbirthisel
<bbirthisel@aol.com>],
who wrote in article <19981207094245.21584.00003054@ng122.aol.com>:
> Hi J.C.:
>
> >I've installed PERL 5.004 but when I try use POSIX the POSIX.PM
> > isn't found. I work with WINDOWS 95, and I can't find the module.
>
> Finding it would be the least of your problems. Win95 is not POSIX
> compatible
Nonsense. POSIX compatibility is a property of CRTL, not of the OS.
If you use OS/2 port of Perl on WIn*, POSIX.pm works.
Ilya
------------------------------
Date: Mon, 07 Dec 1998 14:13:05 -0800
From: rdm@cfcl.com (Rich Morin)
Subject: SFPUG Pizza SIG; Tuesday, Dec. 15
Message-Id: <rdm-0712981413050001@ip42-30.cfcl.com>
FYI, SFPUG is the San Francisco Perl User Group. Dunno how many
of you Perlies live in the area, but come on over if you can!
Vicki Brown and I are co-hosting a meeting of the newly chartered
SFPUG Pizza and Beer SIG on Tuesday, Dec. 15; here are the details:
Date: Tuesday, 12/15
Time: 7:00 pm PST
Place: Pasquale's Pizzeria
8th Avenue @ Irving St.
San Francisco
Access: Pasquale's is right on the N Judah line. If you can take
Muni, do it!
19th Avenue works fairly well if you're driving in from
the North or South. Go East on Lincoln or Irving, just
below GG park (Southbound drivers turn right on Lincoln,
then make two lefts to get onto Eastbound Irving Ave.).
The really cool way to get there from the South, BTW, is to
take 280N to the San Jose Avenue exit, then loop around (2
immediate right turns) onto Bosworth. This passes the Glen
Park BART station, then heads up the hill, turning into O'
Shaughnessy and then (as it crosses Portola Drive) Woodside
Avenue. At the Laguna Honda "tee" intersection, turn right.
Laguna Honda becomes 7th Avenue as it straightens out.
(Don't try this without a map, kiddies! :-)
East Bay drivers will have to fight their way over to the
South side of GG park (i.e., 80 to 101 to Fell St.; bear
left through the park onto Lincoln, then left on 7th...)
Rules: We show up, eat pizza, drink beer (pitchers of both root and
real beer will be ordered) and talk a lot. We then split up
the tab (should be under $15 each) and depart. RSVP to Rich
Morin <rdm@cfcl.com> if you want to be sure of a seat!
-r
P.S. Folks who want to come, but don't like pizza or beer, will be
accepted on a case-by-case basis (TMTOWTDI, after all :-). Call
Rich (650-873-7841) if you have any really unusual requirements
to discuss...
--
Canta Forda Computer Laboratory | Prime Time Freeware - quality
UNIX consulting, training, & writing | freeware at affordable prices
+1 650-873-7841 | +1 408-433-9662 -0727 (Fax)
Rich Morin, rdm@cfcl.com | www.ptf.com, info@ptf.com
------------------------------
Date: 7 Dec 1998 20:37:39 GMT
From: kherron@sgum.mci.com (Kenneth Herron)
Subject: Socket.pm vs. socket.ph
Message-Id: <74heaj$3me$1@news.campus.mci.net>
Solaris 2.5.1, perl 5.005_02 (also happens with earlier versions).
After running h2ph, a command like:
perl -MSocket -e "require 'sys/socket.ph'"
produces:
Prototype mismatch: sub main::SOCK_STREAM vs () at (eval 39) line 1.
Prototype mismatch: sub main::SOCK_DGRAM vs () at (eval 40) line 1.
Prototype mismatch: sub main::SOCK_RAW vs () at (eval 41) line 1.
Prototype mismatch: sub main::SOCK_RDM vs () at (eval 42) line 1.
[...]
Prototype mismatch: sub main::MSG_PEEK vs () at (eval 116) line 1.
Prototype mismatch: sub main::MSG_DONTROUTE vs () at (eval 117) line 1.
Prototype mismatch: sub main::MSG_MAXIOVLEN vs () at (eval 118) line 1.
for about fifty symbols that are exported by Socket.pm.
Adding "-w" yields the added lines for each symbol:
Subroutine MSG_MAXIOVLEN redefined at (eval 118) line 1.
The socket.ph line for each of these symbols looks like:
eval 'sub SO_SNDBUF () {0x1001;}' unless defined(&SO_SNDBUF);
and further testing shows that the problem symbols aren't defined()
until they're actually called.
I'm a little lost with symbol table innards. Can someone tell me the
proper way to fix socket.ph?
--
Kenneth Herron -- kherron@sgum.mci.com
"Subversion has always been our best tactic...It leaves the competition
confused, and they don't know what to shoot at anymore."
-- John Ludwig, Vice president, Microsoft
------------------------------
Date: Mon, 7 Dec 1998 17:17:02 -0500
From: "Mark Polakow" <mpolakow@emergemarketing.com>
Subject: SSI from Perl on IIS
Message-Id: <74hkgp$unn$1@ligarius.ultra.net>
DOntcha love acronyms?
My question is for Win32 Perl Users:
I am running Perl on win32 on MS IIS and generally it runs great. However I
am trying to do SSI calls from inside Perl scripts and am not able to do
this because IIS is interpreting the pl files with Perl and not the SSI .dll
that it needs to process it. Has anyone out there done ssi from withion a
perl with IIS or even at all????
Thanks ahead of time for any clues!
------------------------------
Date: Mon, 07 Dec 1998 22:12:24 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Uploading files with Perl?
Message-Id: <cpYa2.85$884.194@nsw.nnrp.telstra.net>
In article <74gobi$amm$1@plug.news.pipex.net>,
"Artoo" <r2-d2@REMOVEbigfoot.com> writes:
> What is required in the Perl script to upload the file?
If you use CGI.pm, all you need to do is follow the instructions in
its documentation (which should, like CGI,pm, be installed with any
recent version of perl):
# perldoc CGI
[snip]
CREATING A FILE UPLOAD FIELD
[snip]
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Advertising: The science of arresting
Commercial Dynamics Pty. Ltd. | the human intelligence long enough to
NSW, Australia | get money from it.
------------------------------
Date: Mon, 07 Dec 1998 20:48:06 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: usage of $_ within nested loops
Message-Id: <366c3cdb.9105136@news.skynet.be>
Tom Christiansen wrote:
>:Yup. $_ got clobbered.
>
>That's what "no underscore" is for.
That's silly.
That's like saying, "Ooh, you better program in Assembler, without ever
using any registers, because registers tend to be cluttered." Sure
registers can get cluttered. That's what they're for.
Always treat $_ as a temporary variable. You should never depend on it
retaining it's value after a long piece of code. Sure, it might work
NOW, but if the code ever gets updated, maybe by somebody else, that
might break.
Bart.
------------------------------
Date: 7 Dec 1998 22:18:58 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: usage of $_ within nested loops
Message-Id: <74hk8i$q7g$1@info.uah.edu>
In article <366c3cdb.9105136@news.skynet.be>,
bart.lateur@skynet.be (Bart Lateur) writes:
: Always treat $_ as a temporary variable. You should never depend on it
: retaining it's value after a long piece of code. Sure, it might work
: NOW, but if the code ever gets updated, maybe by somebody else, that
: might break.
If I worked in a place where people rudely trashed others' variables
unannounced, I'd find somewhere else to work. If a subroutine is
going to temporarily modify $_ or any other global variable, it should
politely C<local $_;>.
Greg
--
The ability to quote is a serviceable substitute for wit.
-- Maugham
------------------------------
Date: Mon, 07 Dec 1998 12:35:51 -0800
From: Bamboo Sourcery <bamboosource@earthlink.net>
Subject: Where is CGI group?
Message-Id: <366C3C27.F1EB105@earthlink.net>
Is there a newsgroup specifically for CGI programming? Some posters to
this group have mentioned comp.programming.www.cgi but I can't seem to
find that in the list of groups. TIA
Sincerely,
Robert Westcott Tel: 707-823-5866 Fax: 707-829-8106
Bamboo Sourcery 666 Wagnon Road, Sebastopol, CA 95472
bambam@bamboo.nu http://www.bamboo.nu
------------------------------
Date: Mon, 7 Dec 1998 17:06:11 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Where is CGI group?
Message-Id: <MPG.10d61b5a325fc4a6989751@news.scescape.net>
In article <366C3C27.F1EB105@earthlink.net>, bamboosource@earthlink.net
says...
=> Is there a newsgroup specifically for CGI programming? Some posters to
=> this group have mentioned comp.programming.www.cgi but I can't seem to
=> find that in the list of groups. TIA
comp.infosystems.www.authoring.cgi
=> Sincerely,
HTH!
=> Robert Westcott
--Matthew
--
PS: Please us a sigline like the one above (ie: two
dashes and a space on a line by it's self). Thanks!
------------------------------
Date: Mon, 07 Dec 1998 20:48:26 +0100
From: Michal Mosiewicz <mimo@interdata.com.pl>
Subject: Re: Which modules to use
Message-Id: <366C310A.5CF69592@interdata.com.pl>
John Hankey wrote:
>
> Which are the best Perl modules for
>
> (1) Multi Threading
Thread.pm - is a part of Perl 5.005 and above. Not a separate module.
> (2) Reading in HTML pages
IO::File? :-) Of course it depends on what does it actually mean to read
in a HTML page.
Mike
--
WWW: http://www.lodz.pdi.net/~mimo tel: Int. Acc. Code + 48 42 2148340
add: Michal Mosiewicz * Bugaj 66 m.54 * 95-200 Pabianice * POLAND
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4375
**************************************