[6275] in Perl-Users-Digest
Perl-Users Digest, Issue: 897 Volume: 7
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 5 03:18:20 1997
Date: Wed, 5 Feb 97 00:00:27 -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 Wed, 5 Feb 1997 Volume: 7 Number: 897
Today's topics:
???Passing args to OLE methods which don't use parens (Patrick Duff)
[help] 501 not implemented <tyahn@ix.netcom.com>
[Q] Perl 4 -> Perl 5 installation <jon@atwww.com.au>
building perl on linux (Jeff Bland)
Re: dropping trailing zeroes when "write (FA).... (John Stanley)
Re: Every 60th character - code needs inproving! (brian d foy)
Re: Frivilous request for new Perl function (Jonathan King)
Re: Grabbing Html via perl from the web (Jeffrey)
Hints for calling OLE methods (Patrick Duff)
Re: How do I update @INC so I can use my module? <tchrist@mox.perl.com>
HTML-->PostScript, PDF, pure ASCII via HP-UX cgi <adige@xnet.com>
Notorious problem with sockets and POP3 - please give m (Gary)
Re: Notorious problem with sockets and POP3 - please gi (Shishir Gundavaram)
Perl and method not implemented <rockhead@camalott.com>
Perl Script <ezarrabi@direct.ca>
QUESTION : how to write a mailer ? (Flavio Bosco (http://www.infcom.it/genetic))
Question regarding reading input (Icculus)
Re: Question regarding reading input (Icculus)
Re: Script does not work under NT/Netscape Enterprise S (Nathan V. Patwardhan)
system question (Casey Coltrin)
Re: system question (Nathan V. Patwardhan)
Re: system question (Nathan V. Patwardhan)
Re: Tell me how to quick access to Perl (Nathan V. Patwardhan)
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 05 Feb 1997 05:08:04 GMT
From: pduff@airmail.net (Patrick Duff)
Subject: ???Passing args to OLE methods which don't use parens
Message-Id: <32fb15af.5099270@news.airmail.net>
I'm trying to build a Win NT build 302 PERL 5.003 library which
executes MS Access methods via OLE.
Access Visual Basic methods such as "Fields()" and "OpenDatabase()"
work fine when called in PERL; all of the following work just as
described in the blue PERL 5 camel book:
$Access_Table -> Fields(0)
Fields $Access_Table 0
$Access -> OpenDatabase($Filename)
OpenDatabase $Access $Filename
However, I cannot figure out how to call methods which don't use
parens around their arguments. Access Visual Basic has a method
which is called as in
Seek "=", 123
and another which is called as in
FindNext "Year = '1996' "
Note that the method name is followed by a space then a list of
arguments, NOT by a list of arguments in parentheses. All of the
following fail to execute properly when called from PERL:
$Access_Table -> Seek('=', 123)
Seek $Access_Table '=', 123
$Access_Table -> FindNext("Year = '1996'")
FindNext $Access_Table "Year = '1996'"
I've tried many different versions of the above, but nothing I've
thought of works in PERL5.
Oh PERL gods, please help!
regards, Patrick Duff (pduff@airmail.net)
------------------------------
Date: Tue, 04 Feb 1997 22:21:03 -0800
From: tyahn <tyahn@ix.netcom.com>
Subject: [help] 501 not implemented
Message-Id: <32F826CF.8@ix.netcom.com>
Hi!
I'm working on Website 1.1 with windows 95
But I'm in trouble.. Please help me.
How can I solve this problem....
501 Not Implemented
Cannot do POST is supported via CGI programs only. with this URL
/~ljh/booksrc/chap5/l5-10.cgi.
Most likely, this was an attempt to execute a CGI program located in an
area not configured to hold executable
CGI programs. Please contact the server administrator at
webmaster@localhost to correct the problem. Please
save this error message. Also, please return to the referring document
and note the hypertext link that led you
here.
Thanks
------------------------------
Date: Wed, 05 Feb 1997 17:26:26 +1100
From: Jon Hall <jon@atwww.com.au>
Subject: [Q] Perl 4 -> Perl 5 installation
Message-Id: <32F82812.231C@atwww.com.au>
G'day,
I've got perl 4 running perfectly smoothly on an SGI IRIX 5.3 box, and
I've finally decided to upgrade to Perl 5. I don't want to disrupt my
perl 4 installation because there are quite a few scripts relying on it,
but I need a little help installing perl 5.
I've got the perl 5 binary working, but referencing libraries seems to
be creating a bit of trouble.
I've tried:-
use CGI;
and had the CGI.pm file sitting in the same directory as the perl
script,
I've also tried:-
use lib '/directory/to/libraries/';
use CGI;
but still no joy.
Any ideas most welcome.
Please cc replies to my email address.
Regards,
Jon
------------------------------
Date: 5 Feb 1997 07:54:36 GMT
From: jbland@.ccia.com (Jeff Bland)
Subject: building perl on linux
Message-Id: <5d9ebs$ngl@tofu.alt.net>
--
I have just spent the last 6 hours trying to build perl on my linux box.
Obviously, since I am writing this, it didn't work.
its a standard slackware build, 3.1 i think. I haven't changed anything
that would affect the system (installed things but not much else).
it dies saying ld can't find the -ldl lib.
now dammit, the config script finds it, I explicity say -L/lib and
-L/usr/lib and it just won't friggin work.
I *need* this to work, please.....
Jeff
*---------------------------------------------------------------------------*
| Jeffrey Bland | Some are born to move the world - |
| | To live their fantasies |
| System Administrator CCIA.COM | But most of us just dream about |
| Internetworking Consultant | The things we'd like to be |
| Perpetual College Student | |
| | Sadder still to watch it die |
| jbland@ccia.com | Than never to have known it |
*----------------------------------* For you - the blind who once could see |
| The bell tolls for thee... RUSH |
*----------------------------------------*
------------------------------
Date: 5 Feb 1997 04:19:45 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: dropping trailing zeroes when "write (FA)....
Message-Id: <5d91p1$pqh@news.orst.edu>
In article <32F60DE3.538@gel.com>, John Ulmer <jru@gel.com> wrote:
>I'm having trouble finding an easy way to write numeric
>values to a file and keeping the trailing zeroes needed for
>a correct number of significant figures. The number of
...
>writes "2" into the output file. How can I make it keep
>the trailing zero and thus keep the correct number of
>significant figures?
I note that the other answers did not catch that you were interested in
significant digits, not just a fixed number of decimal places.
As others have pointed out, perl is like a handy pocket calculator in
that is does not have any concept of significance when doing
calculations.
You did not include the code that called your output routine, but I
would bet that you have done something to your input before passing
it to the output routine. You have used it in some numerical context,
which caused perl to convert it from the string it read as input to the
floating point value. I say that because the simple test program I used
to check how my copy of perl works did just fine keeping the right
number of significant digits -- as long as the variable I was writing
was assigned as a string and not as a number. I.e., $a="2.00" works,
$a=2.00 does not.
You will probably be required to keep track of significance on your own,
and then use an sprintf to convert the number back to a string with the
correct significance. Here is a sample that you can use as a starting
point. It doesn't consider the total number of significant digits, it
just returns the same number of decimal places as the pattern it is
given. Yes, it is ugly.
#!/usr/local/bin/perl5
format LINE=
@<<<<<<<<<<< @<<<<<<<<<< @<<<<<
$a, $b, $c
A_SINGLE_DOT
$~ = LINE;
# a "string", the number in the string plus one, a number
$a="2.00"; $b=$a+1; $c=2.0; write;
$a = &huh($a); $b = &huh($b,$a); $c = &huh($c,$c); write;
sub huh {
local( $input ) = shift;
local( $format ) = shift || $input;
local( $left );
($left) = $format =~ /\.(\d*)/;
$left = length($left);
return sprintf "%.${left}f", $input;
}
skyking 146: ./dd
2.00 3 2
2.00 3.00 2
------------------------------
Date: Mon, 03 Feb 1997 23:03:08 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Every 60th character - code needs inproving!
Message-Id: <comdog-0302972303080001@nntp.netcruiser>
In article <5d8hu2$8li@Holly.aa.net>, geoff.cox@dial.pipex.com wrote:
[redirected to comp.lang.perl.misc, where it belongs]
: 'have got stuck with parsing every 60th character in a line...can you
: help? The code below works OK for a while but after the last complete
: line of 60 characters it goes wrong and just puts up a few of the
: remaining characters........This is needed to format free text coming
: from a form and being delivered as an email message by sendmail.
still doesn't make it a CGI question...
: $FORM[26] contains the free text, so....
:
: $text = $FORM[26];
: while ($text =~ /./g) {
why the g modifier? why not just ($text != '') ?
: $text =~ /.{60}/;
1. are you sure that you want to do this? you don't care if you put
one part of a word on one line and the other on the next? whatever
happened to using Text::Wrap which I suggested earlier when you asked the
first time? is there some reason the you want to reinvent the wheel?
2. what happens if there aren't 60 characters to match? do they just
get left out in the cold?
: $final .= $& . "\n";
: $text = $';
: .
:
: $FORM[26] = $final;
--
brian d foy
<URL:http://computerdog.com>
unsolicited commercial email is not appreciated
--
brian d foy <URL:http://computerdog.com>
unsolicited commercial email is not appreciated
------------------------------
Date: 5 Feb 1997 07:21:28 GMT
From: king@cogsci.ucsd.edu (Jonathan King)
Subject: Re: Frivilous request for new Perl function
Message-Id: <5d9cdo$i7s@news1.ucsd.edu>
In article <32F7C182.3C51@ixlabs.com> chris@ixlabs.com writes:
>It would be great, and a little more Perlish, if there were a chop that
>returned the truncated string, rather than what was chopped off. It
>could be called chew, or perhaps masticate.
I'm glad that *somebody* else besides me is willing to whine for a
more functional chop or chomp. :-) Personally, though, I'd lobby for
beefing up "chomp" (rather than "chop"), since that's more often
what you really want, and you could do stuff like:
print SOMEWHERE unchomp func_returning_an_array chomp scalar <WHATEVER>;
And turn your whatever into a bunch of records that you could print
somewhere. But I have to say that I seemed to be the only person on
the net willing to carry a torch for "unchomp"...and I'm over that
now.
>That way you could plop the chew call right in the print LIST. No Perl
>programmer wants a sorry line like plain 'ol:
>chop $scaler;
But that's not as annoying as what you get when you do this by mistake:
$foo = chomp $bar;
I fear that I'm getting to old for side-effects these days.
jking
------------------------------
Date: 03 Feb 1997 14:53:14 GMT
From: jfriedl@tubby.nff.ncl.omron.co.jp (Jeffrey)
To: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Grabbing Html via perl from the web
Message-Id: <JFRIEDL.97Feb3235314@tubby.nff.ncl.omron.co.jp>
[mail and post]
Nathan V Patwardhan <nvp@shore.net> wrote:
|> Paul Timperio (ptimperio@uscs.com) wrote:
|> : Yeah simple right? Just wondering before I reinvent the wheel, has
|> : someone- somewhere done this before. If not *any* suggestions on how to
|> : do this?
|>
|> I've used the LWP modules and redirected STDOUT to a file.
My 'webget' program seems to be popular.
See http://enterprise.ic.cg.ca/~jfriedl/perl/
Jeffrey
----------------------------------------------------------------------------
Jeffrey Friedl <jfriedl@omron.co.jp> Omron Corp, Nagaokakyo, Kyoto 617 Japan
O'Reilly & Associates' _Mastering Regular Expressions_
http://enterprise.ic.gc.ca/~jfriedl/regex/
------------------------------
Date: Wed, 05 Feb 1997 05:35:35 GMT
From: pduff@airmail.net (Patrick Duff)
Subject: Hints for calling OLE methods
Message-Id: <32fc187e.5818984@news.airmail.net>
As long as I'm asking for help, let me give something back.
I can't explain why the following work, but if you're having trouble
calling OLE methods from PERL try the following.
(1) Suppose " Method_Name($Arg) " is expecting a numerical
argument. I've found cases where I've had to do " $Arg += 0 "
before executing " Method_Name($Arg) ". PERL is supposed to
automatically convert things like "123" into 123, but this doesn't
seem to work right when passing an argument to an OLE method.
(2) According to the PERL manual, "{asdf}" and "{'asdf'}" are
identical because the single quotes are assumed inside curly braces.
Most of the time this is true; however, I've found cases where
something like " Method_Name -> {asdf} " fails and
" Method_Name -> {'asdf'} " succeeds.
(3) Also, I've found cases where something like
" Method_Name ("asdf") " fails, but something like
"$Arg = "asdf"; Method_Name ($Arg) " succeeds.
I don't know if these qualify as bugs or not. I just know that they
caused me lots of trouble until I stumbled upon the above
work-arounds. If anyone can explain what's really going on, please do
so!
regards, Patrick Duff (pduff@airmail.net)
------------------------------
Date: 5 Feb 1997 04:20:27 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How do I update @INC so I can use my module?
Message-Id: <5d91qb$dtp$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
websites@erols.com (Website Construction Company) writes:
:Or if you want to make sure that the module is used before anything
:else with similar names of subroutines, you can "unshift" the
:directory name to the @INC array.
You really think so, eh? Please don't propagate this myth, which
causes too much head-scratching when
unshift("mylib", @INC);
use Whatever;
happens to fail. I'm tired of explaining it.
--tom
--
Tom Christiansen Perl Consultant, Gamer, Hiker tchrist@mox.perl.com
"Do we define evil as the absence of goodness? It seems only logical
that shit happens--we discover this by the process of elimination."
--Larry Wall
------------------------------
Date: Tue, 04 Feb 1997 23:00:38 -0600
From: Vik Adige <adige@xnet.com>
Subject: HTML-->PostScript, PDF, pure ASCII via HP-UX cgi
Message-Id: <32F813F6.4754@xnet.com>
Hi,
I'm using a Netscape client Java applet to initiate a call to a c-shell
CGI script on an Apache web server (on HP-UX 9000 10.20). This CGI
script then creates a base HTML report. At this point, I would like to
have the option of converting this HTML formatted file to:
(1) a formatted ASCII file (with no HTML tags) which can be fed to the
printer (using the 'lp' unix command) or saved for future data
extraction purposes,
(2) a PDF formatted file which can then be viewed/searched/printed from
within an Adobe Acrobat Reader Netscape plug-in provided to the user.
>From what I've gathered, there are some utilities out there that convert
HTML-->ACSII, HTML-->PostScript, and PostScript-->PDF. Some names that
seemed to pop up were the perl 'html2ps', 'Ghostscript', and 'Adobe
Distiller'.
My final need is that the utilities be for the HP-UX (or otherwise unix
compatible), and runnable from the command line.
I would very much appreciate any feedback!!
Thank you,
Vik.
Vik Adige
---------------------
U.S.Robotics, Inc.
Morton Grove, IL, USA.
(847)583-2655 -Work
vadige@usr.com -Email
------------------------------
Date: Wed, 05 Feb 1997 05:35:47 GMT
From: gniemcew@dti.net (Gary)
Subject: Notorious problem with sockets and POP3 - please give me a clue
Message-Id: <32fa17ca.21597826@news.alt.net>
Hi !
Greetings to all perl guys/gals ! Please bear with my newbie idiocy.
I am writing this very simple script to access POP3 server on 110.
Specs: /NT4SP1 perl5.0001. No .pm's since I want to get to the bottom
of the client-server technology :-). Let's cut to the chase, here it
is:
# ---begin script
$PF_INET = 2;
$SOCK_STREAM = 1;
# 110 for pop3
$port = 110;
# Pattern used to pack Internet address
$pattern = 'S n C4 x8';
#
# Create an address using 0.0.0.0 for here.
# Note: port number is 0, too.
# I got this from a book, it should be OK ?
#
$this_addr = pack($pattern,$PF_INET, 0, 0,0,0,0);
# Generate network address of server.
$serv_addr = pack($pattern, $PF_INET, $port,
xxx,xxx,xxx,xxx);
# xxx,xxx,xxx,xxx is my smtp/pop server
# The protocol is TCP.
$proto = getprotobyname("tcp");
# Create socket.
socket(SOCKET, $PF_INET, $SOCK_STREAM, $proto)
|| die "Can't create socket: $!";
# Bind socket to port.
bind(SOCKET, $this_addr)
|| die "Can't bind: $!";
# Connect to server.
connect(SOCKET, $serv_addr)
|| die "Can't connect: $!";
print "\nConnected.\n\n";
# Test+print all data coming from the server.
# get welcome message
$line = <SOCKET>; chomp($line); print $line;
# send user login req
print SOCKET "USER <my username>\r\n";
# get that OK+ and passwd request
$line2 = <SOCKET>; chomp($line2); print $line2;
print "\n\nClosing socket...\n\n";
close (SOCKET);
#----end script---
The problem is that no matter what I do - the script connects just
fine, I am getting the OK+ welcome line, debug tols me I got through
the print SOCKET all right, but after that - the script just hangs,
socket expires or I interrupt it because it's the 100th run tonight
already.
I did my homework: read perl FAQ and many posts around here during the
last few days concerning sockets and/or stream redirection. I tried
using @arrays to store input, while ( $data = <SOCKET>) loop,
read(SOCKET, $data,1), etc., but still the same thing is happening -
after I give POP server my username I can't get my beloved OK+ and
password request.
The only thing that comes to my mind is the fact that the server might
be forking another POP server process on another port to release the
standard 110, but I don't know if checking that is up to socket/tcp
mechanism or me.
Don't give up on me, I bought a gun yesterday :-) :-) !
Greatly appreciate the help in my quest for knowledge,
Gary
gniemcew@dti.net
------------------------------
Date: 5 Feb 1997 05:45:34 GMT
From: shishir@ruby.ora.com (Shishir Gundavaram)
To: shishir@ora.com
Subject: Re: Notorious problem with sockets and POP3 - please give me a clue
Message-Id: <5d96pv$ghc@amber.ora.com>
Gary (gniemcew@dti.net) wrote:
: # Connect to server.
: connect(SOCKET, $serv_addr)
: || die "Can't connect: $!";
Try unbuffering SOCKET here:
$handle = select (SOCKET);
$| = 1;
select ($handle);
: print "\nConnected.\n\n";
[rest deleted]
--Shishir
------------------------------
Date: 5 Feb 1997 01:49:46 GMT
From: "Darrell LaRock" <rockhead@camalott.com>
Subject: Perl and method not implemented
Message-Id: <01bc1300$daf2bc40$e08c53c6@rockhead.camalott.com>
Is anyone familar with a method not implemeted error. When using cgi
scripts with a webpage. I am using the action "POST". Also, is there
another way to send results to a script file. I believe my ISP is not
setup correctly, and I was wondering if there are any files that I can
check to see if this is so.
My ISP is running Linux red hat Release 4.0 (Colgate) Kernal 2.0.18 on an
i586. Any help would be appreciated.
Also could I reinstall perl off my directory and place perl in my path in
my .profile? And get scripts to execute or does my ISP cutoff the
information too soon.
Darrell
------------------------------
Date: Tue, 04 Feb 1997 21:12:48 -0800
From: ehsan zarrabi <ezarrabi@direct.ca>
Subject: Perl Script
Message-Id: <32F816D0.33B0@direct.ca>
This is a multi-part message in MIME format.
--------------7D6C491D30B7
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I have this perl script and I was wondering how to run it on my web
page. My web page is at: http://www.tarantulainc.com/sepehr
--------------7D6C491D30B7
Content-Type: application/x-perl; name="ssi_rand_image.pl"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="ssi_rand_image.pl"
IyEvdXNyL2Jpbi9wZXJsDQojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj
IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMNCiMgU1NJIFJhbmRv
bSBJbWFnZSBEaXNwbGF5ZXIgICAgVmVyc2lvbiAxLjIgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIyANCiMgQ29weXJpZ2h0IDE5OTYgTWF0dCBXcmlnaHQgICAgbWF0dHdA
d29ybGR3aWRlbWFydC5jb20gICAgICAgICAgICAgICAgICAgICAgIw0KIyBDcmVhdGVkIDcv
MS85NSAgICAgICAgICAgICAgICBMYXN0IE1vZGlmaWVkIDExLzQvOTUgICAgICAgICAgICAg
ICAgICAgICAgICAjDQojIFNjcmlwdHMgQXJjaGl2ZSBhdDogICAgICAgICAgIGh0dHA6Ly93
d3cud29ybGR3aWRlbWFydC5jb20vc2NyaXB0cy8gICAgICAgICMNCiMjIyMjIyMjIyMjIyMj
IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj
IyMjIyMjIyMjIw0KIyBDT1BZUklHSFQgTk9USUNFICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjDQojIENvcHlyaWdodCAxOTk2
IE1hdHRoZXcgTS4gV3JpZ2h0ICBBbGwgUmlnaHRzIFJlc2VydmVkLiAgICAgICAgICAgICAg
ICAgICAgICMNCiMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIw0KIyBTU0kgUmFuZG9tIEltYWdl
IG1heSBiZSB1c2VkIGFuZCBtb2RpZmllZCBmcmVlIG9mIGNoYXJnZSBieSBhbnlvbmUgc28g
ICAgICAjDQojIGxvbmcgYXMgdGhpcyBjb3B5cmlnaHQgbm90aWNlIGFuZCB0aGUgY29tbWVu
dHMgYWJvdmUgcmVtYWluIGludGFjdC4gIEJ5ICAgICMNCiMgdXNpbmcgdGhpcyB0aGlzIGNv
ZGUgeW91IGFncmVlIHRvIGluZGVtbmlmeSBNYXR0aGV3IE0uIFdyaWdodCBmcm9tIGFueSAg
ICAgIw0KIyBsaWFiaWxpdHkgdGhhdCBtaWdodCBhcmlzZSBmcm9tIGl0J3MgdXNlLiAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjICANCiMgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIw0KIyBTZWxsaW5nIHRoZSBjb2RlIGZvciB0aGlzIHByb2dyYW0gd2l0aG91dCBwcmlv
ciB3cml0dGVuIGNvbnNlbnQgaXMgICAgICAgICAjDQojIGV4cHJlc3NseSBmb3JiaWRkZW4u
ICBJbiBvdGhlciB3b3JkcywgcGxlYXNlIGFzayBmaXJzdCBiZWZvcmUgeW91IHRyeSBhbmQg
ICMNCiMgbWFrZSBtb25leSBvZmYgb2YgbXkgcHJvZ3JhbS4gICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIw0KIyAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAj
DQojIE9idGFpbiBwZXJtaXNzaW9uIGJlZm9yZSByZWRpc3RyaWJ1dGluZyB0aGl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bihMT0csICI+PiRsb2dmaWxlIik7DQogICBwcmludCBMT0cgIiRpbWFnZXNbJG51bV0gLSAk
ZGF0ZSAtICRFTlZ7J1JFTU9URV9IT1NUJ31cbiI7DQogICBjbG9zZShMT0cpOw0KfQ0K
--------------7D6C491D30B7--
------------------------------
Date: Wed, 05 Feb 1997 06:32:49 GMT
From: genetic@mbox.vol.it (Flavio Bosco (http://www.infcom.it/genetic))
Subject: QUESTION : how to write a mailer ?
Message-Id: <32f8279c.1227565@news.it.net>
hi all.
I'm trying to write a mailer in Perl, as part of a mailing list
program.
Until now i've used Blat 1.5 ( it's ok, but it's not mine).
I know it is not too difficult, but I have no idea how to use sockets
with perl... It seems very easy in Java.
Thanks for any help.
--Flavio
------------------------------
Date: 5 Feb 1997 04:23:47 GMT
From: agcowan@euler.uncg.edu (Icculus)
Subject: Question regarding reading input
Message-Id: <5d920j$bse@newton.uncg.edu>
Keywords: reading input question
There is probably a simple answer to this, I just haven't found one
yet:
Suppose I have a filehandle which I want to use only for reading.
For simplicity sake assume it is STDIN.
Is there a way to test the filehandle for input without having to
try to read that input? The problem I am having is the '$in = <STDIN>'
statement is locking up the program until there is input, when I really
just want it to read when the filehandle is ready, and do other stuff
in the meantime. Is this possible?
Example situation:
while(1){
if (filehandle is ready to be read){
do something
}else{
do something
continue in loop
}
}
How can I test this filehandle without locking up the program?
I would appreciate any help offered, if you could please email me
at gmd@netmcr.com or agcowan@hamlet.uncg.edu, or just reply
here.
Again, thanks!
Andy
------------------------------
Date: 5 Feb 1997 06:56:30 GMT
From: agcowan@euler.uncg.edu (Icculus)
Subject: Re: Question regarding reading input
Message-Id: <5d9auu$d26@newton.uncg.edu>
Icculus (agcowan@euler.uncg.edu) wrote:
: There is probably a simple answer to this, I just haven't found one
: yet:
: Suppose I have a filehandle which I want to use only for reading.
: For simplicity sake assume it is STDIN.
: Is there a way to test the filehandle for input without having to
: try to read that input? The problem I am having is the '$in = <STDIN>'
: statement is locking up the program until there is input, when I really
: just want it to read when the filehandle is ready, and do other stuff
: in the meantime. Is this possible?
: Example situation:
: while(1){
: if (filehandle is ready to be read){
: do something
: }else{
: do something
: continue in loop
: }
: }
: How can I test this filehandle without locking up the program?
: I would appreciate any help offered, if you could please email me
: at gmd@netmcr.com or agcowan@hamlet.uncg.edu, or just reply
: here.
: Again, thanks!
: Andy
A very BIG thanks goes out to Hal Pomeranz for pointing me in the right
direction. Thank you Hal!
For the benefit of anyone else wondering the same thing, check out
page 211 of the new Camel book, or lookup the 4 argument select in
the perlfunc manpages...
-Andy
------------------------------
Date: 5 Feb 1997 03:40:25 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Script does not work under NT/Netscape Enterprise Server
Message-Id: <5d8vf9$sq@fridge-nf0.shore.net>
Kumar Kashyap (Kumar_Kashyap@gecmc.ge.com) wrote:
MIME-schmime.
: I am having problems with the attached script running under
: winnt/Netscape Enterprise Server. No problems executing it on Unix. The
: script runs fine from the perl command line.
This is a server-specific question that might be better addressed in
comp.infosystems.www.servers.misc, as it seems to involve the way your
server is configured.
--
N Patwardhan
nvp@shore.net
send me mail
--Jamie Zawinski
------------------------------
Date: 5 Feb 1997 03:54:25 GMT
From: colt9201@cs.uidaho.edu (Casey Coltrin)
Subject: system question
Message-Id: <5d909h$psu$1@newshound.csrv.uidaho.edu>
I am trying to make a system call.
If I run the program from the command line it gives me a success or
failure message. I need to be able to get these messages in my script.
This is the command I've been using.
$check1=`$path/shuser $input{10} $ENV{'NSAUTHDB'}`;
There is absolutly nothing in the $check1 variable.
What is wrong with this code, and do how can I get the output?
Please e-mail since my news server blows.
--
Casey Coltrin colt9201@cs.uidaho.edu
Computer Science caseyc@uidaho.edu
University of Idaho http://www.uidaho.edu/~colt9201
---------------------------------------------------------------------
That's one of the remarkable things about life.
It's never so bad that it can't get worse.
-Calvin
---------------------------------------------------------------------
------------------------------
Date: 5 Feb 1997 04:20:01 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: system question
Message-Id: <5d91ph$3se@fridge-nf0.shore.net>
Casey Coltrin (colt9201@cs.uidaho.edu) wrote:
: $check1=`$path/shuser $input{10} $ENV{'NSAUTHDB'}`;
: There is absolutly nothing in the $check1 variable.
You might try:
$check1=`$path/shuser $input{10} $ENV{'NSAUTHDB'}`;
open(PROC, "$check1 2>&1 |")
|| print("Hey you: $!\n");
@responses = <PROC>;
close(PROC);
foreach $response (@responses) {
print("Program responded: $response.\n")
}
HTH!
--
Nathan V. Patwardhan
nvp@shore.net
"A stitch in time saves nine."
------------------------------
Date: 5 Feb 1997 04:22:00 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: system question
Message-Id: <5d91t8$3se@fridge-nf0.shore.net>
Nathan V. Patwardhan (nvp@shore.net) wrote:
: You might try:
: $check1=`$path/shuser $input{10} $ENV{'NSAUTHDB'}`;
Dammit, a correction! Sorry. Don't use the backticks as mistakenly
shown in the last posting. The rest stands.
$check1 = "$path/shuser $input{10} $ENV{'NSAUTHDB'}";
open(PROC, "$check1 2>&1 |")
|| print("Hey you$!\n");
@responses = <PROC>;
close(PROC);
foreach $response (@responses) {
print("Program responded: $response.\n")
}
HTH!
--
Nathan V. Patwardhan
nvp@shore.net
"A stitch in time saves nine."
------------------------------
Date: 5 Feb 1997 03:42:16 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Tell me how to quick access to Perl
Message-Id: <5d8vio$sq@fridge-nf0.shore.net>
Topo (topo@pacific.net.sg) wrote:
: i am newer for Perl, and now i want to learn it for my business.
: can you tell me where i can get Perl resource on the internet.
http://www.perl.com/perl for starters. It has some nice references to
books and other materials you might want to check out. _Learning Perl_
written by Randal Schwartz (published by O'Reilly and Associates) is
also a great beginner's guide.
--
N Patwardhan
nvp@shore.net
send me mail
--Jamie Zawinski
------------------------------
Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Jan 97)
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.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.
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 V7 Issue 897
*************************************