[10390] in Perl-Users-Digest
Perl-Users Digest, Issue: 3984 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 15 15:07:19 1998
Date: Thu, 15 Oct 98 12:01:33 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 15 Oct 1998 Volume: 8 Number: 3984
Today's topics:
Re: Perl sendmail and binary files (Andre L.)
Perl source compile error <mattalford@hotmail.com>
Re: perl.newbie <jdporter@min.net>
Re: Perl5 on Solaris reading MS Access Database scott@softbase.com
Re: problem with "use lib" <tchrist@mox.perl.com>
Re: problem with "use lib" <merlyn@stonehenge.com>
Re: problem with "use lib" (Pete Ratzlaff)
QUESTION - Where Can I find the Latest MSQLPERL librar <mike@test.com>
QUESTION: How do I create a library in C to be called f <mike@test.com>
Re: QUESTION: How do I create a library in C to be call (Mark Leighton Fisher)
Re: Remote Script w/in a Script <rootbeer@teleport.com>
Re: Sorry (Michael J Gebis)
Re: Sorry <wcoarseyREMOVETHIS@gate.net>
Re: sorting file entries by time <jdporter@min.net>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 15 Oct 1998 13:18:14 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Perl sendmail and binary files
Message-Id: <alecler-1510981318140001@dialup-491.hip.cam.org>
In article <36262077.0@diana.idirect.com>, "Edgar Sigal"
<edgarnospam@insidewire.com> wrote:
[...]
>
> print MAIL "--=====================_$TimeStamp==_\n";
> print MAIL "Content-Type: application/bin;\n";
> print MAIL "Content-Disposition: attachment; filename=\"$upfile\"\n\n";
>
> $File_Handle = "$resumetemp/$upfile";
> binmode(TFILE3);
> open (TFILE3,"$File_Handle")||print "couldn't open the data file";
> while ($Bytes = read(TFILE3,$Buffer,1024)) {
> print MAIL $Buffer;
> }
> close (TFILE3);
>
> print MAIL "\n--=====================_$TimeStamp==_--\n";
> close MAIL;
Maybe it would work better if you used binmode() _after_ opening the file!
Andre
------------------------------
Date: 15 Oct 1998 16:34:02 GMT
From: "Matt Alford" <mattalford@hotmail.com>
Subject: Perl source compile error
Message-Id: <908469238.472208@ridge.spiritone.com>
I'm a newbie to Linux as well as Perl. I've tried compiling Perl 4.x and
5.x with g++ and both generate the same error during the make. The final
three lines look like this:
cc -L/usr/local/lib -o miniperl miniperlmain.o
libperl.a -lgdbm -ldb -ldl -lm -lc -lbsd
ld: cannot open -ldl: No such file or directory
make ***[miniperl] Error 1
I left all of the defaults during the configure and my guess is that one of
them isn't correct for my Linux box, but I don't know which one. If you
have any idea what -ldl is for or where I might search for answers, please
forward.
TIA,
MATT :)
------------------------------
Date: Thu, 15 Oct 1998 14:06:48 -0400
From: John Porter <jdporter@min.net>
Subject: Re: perl.newbie
Message-Id: <362639B8.625E2AE3@min.net>
David Barnard wrote:
>
> This is one of the weirdest newsgroups I have ever seen.
Thank you!
> I am a newbie. I intend to learn Perl as a second language. My first is
> Pascal: you can't get more structured than Pascal.
Somehow I think Wirth would disagree with you.
--
John "Many Jars" Porter
"A fugitive and lurid gleam
Obliquely gilds the gliding stream." -- EG
------------------------------
Date: 15 Oct 1998 17:57:12 GMT
From: scott@softbase.com
Subject: Re: Perl5 on Solaris reading MS Access Database
Message-Id: <36263778.0@news.new-era.net>
Stephen Palmer (slpalmer@NOSPAM.flex.net) wrote:
> After a careful search of DejaNews, and CPAN, I'm still at a loss as to
> how to read from a MS Access Database using perl 5.04. I would
> appreciate responses from anyone who has succeded in doing this (from
> Perl on UNIX). I saw through DejaNews that several others have asked
> this, and some succeded (under Win32) but I have not seen a summary of
> how to do it from a UNIX host. I will be glad to post such a summary if
> I manage to do this. :-)
There is no good way to do this, because Access doesn't work in a
networked environment. Access is also not a multiuser database like
Oracle or DB2 and can't support multiple users on the same database. It
has some primitive multiuser capabilities that work only with
NetBEUI-style Microsoft networking.
The only way I know that you could possibly do this is to write a
TCP/IP server which reads SQL text over the network, and runs it
against the database, and sends the results back. I've never heard of
anyone writing this.
The general problems are:
1) Access is not designed to do what you want to do, and
any solution will be less than optimal. It'll be an
ugly hack. For example, even if you paid a lot of money
for an ODBC implementation on UNIX, Access has no
networking capabilities, so it wouldn't do you any
good. The only thing you can do is write your own
middleware layer and duplicate things like
DB2 connect. Access has nothing like this itself, because
it is not networkable. Even if you got it to work, the
solution would be highly limited because concurrent
access to databases would be lacking.
2) You're trying to go from a server to a client, which
is bassackwards. There's no good support for this, because
it is unnatural. Going from a client to a server is the
way 99.44% of people do it, and the other .56% of the time
the solution is either unsolved because not enough people
do it to make it worth doing, not able to be solved as in
the case of Access, or so expensive it wouldn't matter.
Scott
------------------------------
Date: 15 Oct 1998 16:57:20 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: problem with "use lib"
Message-Id: <7059hg$d05$1@csnews.cs.colorado.edu>
In comp.lang.perl.misc, Randal Schwartz <merlyn@stonehenge.com> writes:
: use constant MY_LIB => /u/lib/perl;
I think not.
--tom
--
"Software engineering phase plans are something you make so your manager
can explain to his manager how things are going"
--Rob Pike (On the subject of managerial "bullshit")
------------------------------
Date: Thu, 15 Oct 1998 18:06:30 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: problem with "use lib"
Message-Id: <8cr9w98ztq.fsf@gadget.cscaper.com>
>>>>> "Tom" == Tom Christiansen <tchrist@mox.perl.com> writes:
Tom> In comp.lang.perl.misc, Randal Schwartz <merlyn@stonehenge.com> writes:
Tom> : use constant MY_LIB => /u/lib/perl;
Tom> I think not.
Oops, never post early in the morning. Of course that should be
use constant MY_LIB => "/u/lib/perl";
use lib MY_LIB;
That's why my ORA bio says "occasionally incorrect spatterings on
Usenet". :)
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 15 Oct 98 18:29:55 GMT
From: rpete@ascda3.harvard.edu (Pete Ratzlaff)
Subject: Re: problem with "use lib"
Message-Id: <36263f23.0@cfanews.harvard.edu>
Dmitri Levitin (dmitri@sw-systemekarlhickl.de) wrote:
> I have a problem with pragma use lib.
> I want to make my own module library in /u/lib/perl but i would like to
> have it in my script rather so:
> my $MY_LIB = "/u/lib/perl";
> use lib $MY_LIB;
> than so:
> use lib "/u/lib/perl";
> In case 1 the new path don't appears in @INC and thus my module library
> can not be found!
The 'use lib' is actually being executed before $MY_LIB is set.
> How can I use variables at that place?
Try adding to @INC inside a BEGIN block:
BEGIN {
my $lib = '/home/rpete/local/perlmods';
unshift @INC, $lib;
}
> Thanks.
Welcome,
-Pete Ratzlaff
------------------------------
Date: Thu, 15 Oct 1998 11:51:07 -0700
From: "Mike Esposito" <mike@test.com>
Subject: QUESTION - Where Can I find the Latest MSQLPERL library?
Message-Id: <705gdd$k0a$1@news-1.news.gte.net>
Hi,
Where can I find the latest MSQLPERL Library.
I am running mSQL 2.0.4.1 and Perl 5.0051 and would like to access the
MSQL in Perl. It seems that MsqlPerl is the way to do this. Is this the best
method? The other options I see are as follows:
1.) Use MSQL Lite scripting
2.) Do the whole Project in C or C++ and use the calls to MSQL directly
3.) Write my own layer between C and Perl to allow Perl to use MSQL.
Thanks in advance for your help and advice.
Mike Esposito
------------------------------
Date: Thu, 15 Oct 1998 11:08:46 -0700
From: "Mike Esposito" <mike@test.com>
Subject: QUESTION: How do I create a library in C to be called from a Perl Script?
Message-Id: <705dtv$dnp$1@news-1.news.gte.net>
I would like to create a library in C of functions that I can use in my Perl
Scripts.
My Platform is as follows:
Solaris 5.6
Perl 5.0051
GCC 2.8.1
Are there any special compile and links flags I must use so Perl can
recognize my C module?
Do I have to wrap up my methods in C with anything special?
How does parameter passing work?
Is the only to do this with XSUBS?
Thanks in advance
Mike Esposito
------------------------------
Date: Thu, 15 Oct 1998 13:21:12 -0500
From: fisherm@tce.com (Mark Leighton Fisher)
Subject: Re: QUESTION: How do I create a library in C to be called from a Perl Script?
Message-Id: <MPG.10900727577de12098969e@news-indy.indy.tce.com>
In article <705dtv$dnp$1@news-1.news.gte.net>, mike@test.com says...
> I would like to create a library in C of functions that I can use in my Perl
> Scripts.
The easiest ways to do this are with XS or SWIG. Try 'perldoc perlxs'
for XS information.
==========================================================
Mark Leighton Fisher Thomson Consumer Electronics
fisherm@indy.tce.com Indianapolis, IN
"Browser Torture Specialist, First Class"
------------------------------
Date: Thu, 15 Oct 1998 18:07:20 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Remote Script w/in a Script
Message-Id: <Pine.GSO.4.02A.9810151105480.26848-100000@user2.teleport.com>
On Thu, 15 Oct 1998 shawn_paige@hotmail.com wrote:
> I have a script which submits from a form, then I want to send that
> data to a script on another website. Can this be done? If so, show me
> the way...
Use the LWP module from CPAN. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 15 Oct 1998 17:21:21 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Sorry
Message-Id: <705auh$pof@mozo.cc.purdue.edu>
fl_aggie@thepentagon.com (I R A Aggie) writes:
}In article <rlb-1510980825150001@204.112.166.151>, rlb@intrinsix.ca (Lee
}Brandson) wrote:
}+ Q: Why do universities have both libraries and instructors?
}+ A: Because it is not always sufficient that a given piece of information
}+ be archived somewhere.
}Because both are storehouses of information. The instructor simply
}hasn't formalized their information enough to be placed in the library.
}But one does not go to one's instructor with a homework problem and
}ask them to solve it.
Sure you do. And it's the instructor's job to solve the problem
_with_ the student, instead of _for_ the student. This is a subtle
difference that often gets missed in this group, by both students and
teachers.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Thu, 15 Oct 1998 14:08:06 -0400
From: "Will" <wcoarseyREMOVETHIS@gate.net>
Subject: Re: Sorry
Message-Id: <705due$15fq$1@news.gate.net>
Lee Brandson wrote in message ...
>In article <ona207.tnf.ln@flash.net>, tadmc@flash.net (Tad McClellan)
wrote:
>
>As an occasional watcher of this ng and its predecessor for some two years
>now, I would like to ask whether it is strictly necessary to be as rude as
>possible when answering (or not answering, as the case may be) a question?
>Is this what it takes to be "in the club?" Do you enjoy the unending long
>threads of justifications for such rudeness?
Bravo! My recent post was met with this type of rudeness and sarcasm. Just
because I'm having trouble with my transition from one language to another,
some people assume that I haven't read the documentation, or I'm just
stupid. These people felt compelled to reply to my post with rude sarcastic
answers that basically said RTFM. These people are obviously "in the club".
-- Will
wcoarseyNOSPAM@gate.net
(Please remove the NOSPAM)
------------------------------
Date: Thu, 15 Oct 1998 13:54:41 -0400
From: John Porter <jdporter@min.net>
Subject: Re: sorting file entries by time
Message-Id: <362636E1.71CA6FB7@min.net>
Lee Musgrave wrote:
>
> I have a file which contains entries timestamped in the form
> HH:MM:SS ... each line looks roughly like this:
>
> BUND DEC 98 BUY 19981014 08:07:02 259 238412992 30 114.56 ...
>
> ... sort ... chronological order.
> i've had a look at the built in sort function, but i don't think
> that will work without splitting the entire file into an array...
Sure it will. It just might not be the best way to do it.
> speed is essential.
Of course it is.
That's why the sort should use the built-in sort routine,
rather than an explicitly defined one.
Something like this will do nicely:
@sorted_lines =
map { substr($_,8) }
sort
map { substr($_,25,8).$_ }
@unsorted _lines;
The substring to be sorted by begins at offset 25 (from 0),
and has a length of 8.
--
John "Many Jars" Porter
"A fugitive and lurid gleam
Obliquely gilds the gliding stream." -- EG
------------------------------
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 3984
**************************************