[8202] in Perl-Users-Digest
Perl-Users Digest, Issue: 1820 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 6 01:07:57 1998
Date: Thu, 5 Feb 98 22: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 Thu, 5 Feb 1998 Volume: 8 Number: 1820
Today's topics:
Re: >> CGI QUESTIONS? READ THIS <<< (Martien Verbruggen)
Re: A Question (Martien Verbruggen)
Re: Advice needed. (Martien Verbruggen)
Re: Array and Split? (Martin Vorlaender)
Re: best way of doing sort|uniq (sort -u) in perl (Andrew M. Langmead)
Re: Can't log on to Active Messaging Library in NT time <lutz@muc.de>
Re: Filtering Problem (Chip Salzenberg)
Re: Filtering Problem (Martien Verbruggen)
Re: HELP - Proxy Authentication store0@hotmail.com
Re: Help with SORT <ray@icix.net>
Re: HELP! (Martien Verbruggen)
Re: How do you search an array for a string? (Craig Berry)
Re: Is Perl 5 year 2000 compliant? (Martien Verbruggen)
lib files not being found - perl 5.004_02\NT4 (jim)
Making Submit buttons into Images (David Walford)
Re: Making Submit buttons into Images (Martien Verbruggen)
Re: NAWK to PERL conversion (Martien Verbruggen)
Re: non-regex for potentially RFC-compliant email addre (Abigail)
Re: Passing Javascript variables to Perl CGI? (Martien Verbruggen)
Perl screwed by IIS4 upgrade <changhsu@csua.berkeley.edu>
Perl, Tcl and Expect? <stop@spamming.me>
Re: PERL2EXE <rjk@coos.dartmouth.edu>
Re: Redirecting STDIN/STDOUT to socket <jay@rgrs.com>
Re: The perl institute still alive ? (Martien Verbruggen)
Win32::ODBC and MSSQL Stored Procedures <jbourne@nibupls1.telstra.comdotau>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 6 Feb 1998 04:09:49 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: >> CGI QUESTIONS? READ THIS <<<
Message-Id: <6be2ed$n7m$5@comdyn.comdyn.com.au>
In article <34D9A8C2.2F24C723@5sigma.com>,
"Joseph N. Hall" <joseph@5sigma.com> writes:
> You could make it even more convenient, and put news: in front,
> so it will only be a mouse-click away. :-)
Dang. I just tried it. It won't work. No mouse-clicking. Can someone
tell me how to write a CGI script in JavaScript that will talk to the
news web for me, so I don't have to do anything?
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: 6 Feb 1998 03:48:01 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: A Question
Message-Id: <6be15h$n7m$1@comdyn.comdyn.com.au>
[Subject: Re: A Question]
Please read the following helpful information on how to choose a good
subject line:
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd. | excuse - Lazarus Long
NSW, Australia |
------------------------------
Date: 6 Feb 1998 03:56:34 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Advice needed.
Message-Id: <6be1li$n7m$2@comdyn.comdyn.com.au>
In article <6bacg9$mvv@sidney.chubb.com>,
"Sergio Loscialo" <nospam_sloscialo@chubb.com_nospam> writes:
> I really could have done without your condescending
Not condescending, helpful.
> post. I don't see you going around posting that message
> to everyone who writes simple subject lines. If an
He does it all the time. I do it all the time. Other people do it all
the time. How many threads have you actually read?
Look at the ones with subjects like 'newbie needs help', 'I am female,
dumb and blonde', 'Question!!!!!', 'HELP ME!!!'. I bet that in at
least 90% of those threads, at least one of the followups refers to
the article you were referred to.
> individual is inclined to give advice, they'd look. If not,
> I'll make do.
Sure. If that's your attitude. Just be prepared to be pointed to that
same article as a first followup to your posts all the time then.
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I'm just very selective about what I
Commercial Dynamics Pty. Ltd. | accept as reality - Calvin
NSW, Australia |
------------------------------
Date: Fri, 06 Feb 1998 03:56:31 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
To: keefner@kinetic.com (Craig A. Keefner)
Subject: Re: Array and Split?
Message-Id: <34da7bdf.524144494f47414741@radiogaga.harz.de>
[posted and emailed]
Craig A. Keefner (keefner@kinetic.com) wrote:
: --------------C6AD81FF1AB64B84C309FC46
: Content-Type: text/plain; charset=us-ascii
: Content-Transfer-Encoding: 7bit
Please configure your newsreader to _not_ output MIME multipart messages.
Thanks.
: But from the webserver, the radio_group comes out as 1 long line with 1
: radio button.
: I've been experimenting with values and have been reading the cgi.pm doc
: but I haven't solved it yet.
: from the command line it comes out as
: perl z.pl
: <INPUT TYPE="radio" NAME="group_name" VALUE="510-602R
: ">84-89 100mm B.C........... <BR><INPUT TYPE="radio" NAME="group_name"
This is where (at least one of) your problems are: see the line break after
VALUE="510-602R ?
Use the chomp() function to get rid of trailing newlines when reading your
data; else the substr( .., -9) will chop off the wrong part (and the
s/\.*\s*$// will not work).
: print "<input type=submit name=OK value=\"The part is correct\">";
: print $query2->endform;
: print "</PRE>";
: print "</form></body></html>\n";
Tss tss... I thought you were using CGI.pm?!
(And you've got an unnecessary </form> tag in there...)
print $query2->submit('OK', 'The part is correct');
print $query2->endform;
print "</PRE>";
print $query2->end_html:
: it's weird. But it turns everything past the initial value into on long
: text string.
It works for me, if I take the code you posted and the example data from
your first post. Seems that your reading of the data needs reworking.
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
Ceterum censeo | work: mv@pdv-systeme.de
Redmondem delendam esse. | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: Fri, 6 Feb 1998 02:23:29 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: best way of doing sort|uniq (sort -u) in perl
Message-Id: <Enxqn5.G10@world.std.com>
Keywords: perl programming sort uniq
Tony Nugent <T.Nugent@sct.gu.edu.au> writes:
>I have a perl array, @RAWDATA.
>It's easy to grep() it, but I really need to do a "sort | uniq" to sort
>the array and delete any duplicated lines.
>What's the best/easiest way to do this with perl?
undef %seen;
@sorted = sort grep { ! $seen{$_}++ } @RAWDATA;
The hash will filter out additional copies of duplicate data. (but
unsort them in the process) and the sort will rearrange the data in
dictionary order.
>(PS: the only perl FAQ I could find was the one for tcl. Where is the
>actual perl FAQ now kept?)
It is included with the perl distribution's documentation as of
5.004. Otherwise look at <URL:http://www.perl.com/perl/faq/>
--
Andrew Langmead
------------------------------
Date: Thu, 05 Feb 1998 07:59:19 +0100
From: Lutz Albers <lutz@muc.de>
To: Markus Laker <sneezy@contax.co.uk>
Subject: Re: Can't log on to Active Messaging Library in NT timed job
Message-Id: <34D96346.19066389@muc.de>
Markus Laker wrote:
> The script works if I'm logged on as myself, SOUTH\MSL. It works if I
> use 'su' to to run it as an administrator. It works if I run while
> logged on as an administrator. But if I try to send mail from a timed
> job, the script fails to log on to MAPI. (My schedule service logs on
> as an administrator, using the same logon ID as I tried in the
> previous steps.)
This is a guess, but I think that timed jobs are not running under your
account, but as LocalService or something else. The point is that these
accounts might not have a profile.
BTW, you don't need a profile if you have the name of a exchange server
and a valid username/password pair
--
Lutz Albers, lutz@muc.de
Do not take life too seriously, you will never get out of it alive.
------------------------------
Date: Fri, 06 Feb 1998 02:03:13 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Filtering Problem
Message-Id: <6bdr39$23m$1@cyprus.atlantic.net>
According to jdf@pobox.com (Jonathan Feinberg):
>chip@mail.atlantic.net said...
>> According to Joergen.Lang@schwaben.de:
>> >"date";"town";"venue";"time";"artist"\n
>[snip]
>
>> @dates = sort { ($a->[4] <=> $b[4]) || ($a->[0] cmp $b->[0]) } @dates;
>
>Chip: please don't bite my head off if I'm delusional, but I think you've
>reversed your use of "cmp" and "<=>" (assuming that the artist is alphabetic
>and that the date is numeric).
Well, the date probably contains delimiters, so I should have used
"cmp" in *both* places. Good catch on the bug, though.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Nice shooting, Zanthar!" "Thanks, Denise." // MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: 6 Feb 1998 04:13:34 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Filtering Problem
Message-Id: <6be2le$n7m$7@comdyn.comdyn.com.au>
[ I spent time yesterday typing a long answer, only to find out that the bloody news server fell over. Even though it's slightly late, I'll repost. If only because I hate to do that work for nothing ]
In article <34D8877A.586E@schwaben.de>,
Joergen Lang <Joergen.Lang@schwaben.de> writes:
#!/usr/local/bin/perl5 -w
use strict;
my %Artists = ();
# First, read in the data, and store the first four fields in an arrayref
# in a array in a hash, keyed on the artist's name
while (<DATA>)
{
chomp;
my @fields = split(';');
# You might use Text::ParseWords or so. I'll just clean up
# the quotes myself
foreach (@fields) { s/^"//; s/"$// }
my $artist = pop @fields;
push @{$Artists{$artist}}, \@fields;
}
foreach (sort keys %Artists)
{
print uc($_), "\n";
# For all lines, for this artist
# You could specify a sorting routine for the following
foreach( @{$Artists{$_}} )
{
# $_ is a reference to an array (one line above) here
print join(' - ', @{$_}), "\n";
}
print "\n";
}
__DATA__
"12 Jan 1998";"Paint Town";"Red Blob Hall";"8:00 PM";"Djengis Khan"
"13 Jan 1998";"Sculpt City";"Concrete Slab Mall";"7:00 PM";"Djengis Khan"
"14 Jan 1998";"Music Town";"D Flat Plaza";"9:15 PM Sharp";"Djengis Khan"
"12 Jan 1998";"Brie County";"Cheese Street";"4:00 PM";"Gorgonzola the Great"
"16 Jan 1998";"Camembert City";"Mustard Place";"6:00 AM";"Gorgonzola the Great"
"17 Jan 1998";"Gargle Town";"Throaty Mall";"8:00 PM";"Borble the Magnificent"
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd. | you come to the end; then stop.
NSW, Australia |
------------------------------
Date: Thu, 05 Feb 1998 20:01:27 -0600
From: store0@hotmail.com
To: sullivan.gill@twice.icl.co.uk
Subject: Re: HELP - Proxy Authentication
Message-Id: <886730237.717160459@dejanews.com>
In article <886688334.659292161@dejanews.com>,
Sull <sullivan.gill@twice.icl.co.uk> wrote:
>
> From Web Client Programming with Perl :
>
> $ua->proxy('http', 'http://proxy.ora.com:8080/');
> $ua->no_proxy('ora.com');
>
> What syntax do you have to use to the above code to enable the use of a
> username and password for proxy authentication ?
>
> Please help because I am at the end of my tether !!
I had to do this today as well-- here is the working example I came up
with. I'm sure (in the finest perl tradition) that there are other,
probably better ways to do it. This works, though.
-- Steve Bonds
PS: Sometimes dejanews mangles code posted through it. Let the semicolons
be your guide... ;->
-----------EXAMPLE CODE----------------------
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
use MIME::Base64;
$PROXY_USERNAME = "your_username";
$PROXY_PASSWORD = "your_password";
my $useragent = new LWP::UserAgent;
$useragent->proxy('http', 'http://proxy.ora.com:8080');
# Build this BASIC authentication field, simply base-64 encoded
# username:password pair.
$encoded = encode_base64("$PROXY_USERNAME:$PROXY_PASSWORD");
$URL = "http://www.ora.com";
my $request = new HTTP::Request('GET', $URL);
# Explicitly sets the BASIC method of authorization, which many proxies
# use. If you're using the "Digest" method, you'll need to check
# the HTTP spec at www.w3.org for details on that one... I think it uses
# a challenge-response method, so you'll need to read the challenge and
# do an appropriate MD5 digest.
$request->header('Proxy-Authorization' => "Basic $encoded");
# The rest is straightforward...
my $response = $useragent->request($request);
if ($response->is_success) {
print $response->content;
}
else {
print $response->error_as_HTML;
}
---------------END OF INCLUDED CODE---------------------
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Thu, 05 Feb 1998 12:02:33 -0500
From: Ramon Castillo <ray@icix.net>
To: Dave Downin <downin@smarty.smart.net>
Subject: Re: Help with SORT
Message-Id: <34D9F0A9.554B@icix.net>
Your best source about sort:
http://www.perl.com/CPAN-local/doc/FMTEYEWTK/sort.html
I hope this help
--
#!/usr/local/bin/perl
use Heart::WithBrain;
while ($god->bless == $Internet && $Perl == $Cool){
$Be = "Happy";
$Live = "Love";
$Hack = "Fun";
} # RC ray@icix.net
------------------------------
Date: 6 Feb 1998 04:06:52 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: HELP!
Message-Id: <6be28s$n7m$4@comdyn.comdyn.com.au>
[Subject: Re: HELP!]
Please read the following article on how to choose a good subject line:
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
In article <34D7BCDF.C777D099@eatel.net>,
"Glen O. Watts" <glowatts@eatel.net> writes:
> I am trying to use a cut-and-paste script for verifying authorization
cut-and-paste script? What's that?
> codes. The user (subscriber) enters his authorization code into a form
> and it is then matched against a list of valid authorization codes. The
> script works just fine until it attempts to open the file that contains
> the valid codes ($webfile) as shown below:
>
> unless (open (WEB, "+<$webfile")) { &system_error ("Could
> not open web data file $webfile.\n"); exit;} (there is
> more, of course...)
yikes.. What caused that odd formatting? Cut and paste? *grin*
Most likely this is caused by a standard CGI problem: You're not
running a CGI the same way and in the same environment as from the
command line. Lots of servers restrict the file systems you can
actually get to. You're running as a different user. Check out the CGI
FAQs at:
http://www.perl.com/CPAN/doc/FAQs/cgi/perl-cgi-faq.html
http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
Martien
PS. Do you really need to open your file for both write and read? You
might not have permissions to _write_ to the file as the user that is
running the CGI.
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd. | excuse - Lazarus Long
NSW, Australia |
------------------------------
Date: 6 Feb 1998 04:24:47 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How do you search an array for a string?
Message-Id: <6be3af$n2k$1@marina.cinenet.net>
Craig Manley (Craig@skybound.demon.nl) wrote:
: I need to search an array for a case-insensitive and full match of a
: search string. I'm new to Perl, so I haven't been able to figure out how
: that works.
:
: Does anybody have a solution?
First, you need to be a bit more specific about your requirements. Do
you merely need to determine whether your search string equals (ignoring
case) some string in the array, or do you need to find out the index of
the match?
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 6 Feb 1998 03:59:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Is Perl 5 year 2000 compliant?
Message-Id: <6be1r4$n7m$3@comdyn.comdyn.com.au>
[My news server, thankfully, doesn't carry the newsgroup
comp.software.year-2000, so I removed it]
In article <34D918CE.EDDCF23C@nzsupport.nzdb.com>,
Cliff Pratt <cpratt@nzsupport.nzdb.com> writes:
> David Lee Lambert wrote:
>>
>> > ++ > Does anyone know of any problems with Perl 5 and Y2K?
>>
> Is this the same thread that was going at least a year ago?
Nope. A new one. Just like about 40 other subjects, this one seems to
be one that keeps coming back, and that people feel they should debate
every time.
Hmm.. Maybe there is a difference. This one pops up on several news
groups. But so does the 'Which editor should I use' and the 'Which
language is better' thread. Oh well.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | A Freudian slip is when you say one
Commercial Dynamics Pty. Ltd. | thing but mean your mother.
NSW, Australia |
------------------------------
Date: 5 Feb 1998 22:41:42 GMT
From: jshea@jpl.nasa.gov (jim)
Subject: lib files not being found - perl 5.004_02\NT4
Message-Id: <6bdf76$1m1@netline.jpl.nasa.gov>
I'm trying to run the CGI.pm samples which have the
following code:
#!/usr/local/bin/perl
use CGI;
use CGI::Carp qw/fatalsToBrowser/;
[snip]
and I'm getting the following error message:
Can't locate CGI.pm in @INC at D:\Web\boss\cgi-bin\mycgi.pl
line 3.
The following:
perl -e "print \"@INC\n\""
Gives me:
C:\Perl\lib\site C:\Perl\lib c:\perl\lib c:\perl\lib\site
c:\perl\lib\site
Which is correct (well, these are the correct paths). Why
is CGI.pm not being found?
------------------------------
Date: 6 Feb 1998 03:07:19 GMT
From: davewal@echo.engr.sgi.com (David Walford)
Subject: Making Submit buttons into Images
Message-Id: <6bdup7$922m@fido.asd.sgi.com>
I have a form full of variable that need to be passed to a perl script.
On that form I have 5 different submit buttons with variables that will tell a
single script specifically what to do depending on with submit button is
pressed.
Is there a way to turn the submit buttons into images, but still pass along the
variable assigned to the button?
Any graceful way?
Thanks
David
--
\ David M. Walford | email: davewal@engr.sgi.com /
/ Applied Engineering, Mktg. | m/s: 14L-915 \
\ Silicon Graphics, Inc. | voice: 650-933-6451 /
/ Desktop Systems Division | fax: 650-932-0274 \
------------------------------
Date: 6 Feb 1998 05:06:41 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Making Submit buttons into Images
Message-Id: <6be5p1$nlf$3@comdyn.comdyn.com.au>
In article <6bdup7$922m@fido.asd.sgi.com>,
davewal@echo.engr.sgi.com (David Walford) writes:
> Is there a way to turn the submit buttons into images, but still
> pass along the variable assigned to the button?
Several. None of them have anything at all to do with perl. You should
ask this question on one of the comp.infosystems.www.* newsgroups.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd. | cynical. It's perfectly easy to be
NSW, Australia | cynical.
------------------------------
Date: 6 Feb 1998 05:03:57 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: NAWK to PERL conversion
Message-Id: <6be5jt$nlf$2@comdyn.comdyn.com.au>
In article <19980205.222904.1P7.rnr.w164w@locutus.ofb.org>,
Russell Schulz <Russell_Schulz@locutus.ofB.ORG> writes:
>>> I have a nawk script that I am trying to convert to perl. The script
>> You might try the a2p translator that comes with perl (awk to perl).
>
> unfortunately, that's not true -- the original script used output
> redirection, and a2p doesn't handle that (no known workaround).
Ah, good thing I was cautious in my answer then, and used the words
'you', 'might' and 'try' :) That still stands *grin*
Actually, I ran a2p on that awk script, and it didn't complain about
anything. Now, I just don't know enough about awk to compare the two,
but I'll take your word for it :)
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: 6 Feb 1998 05:33:33 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: non-regex for potentially RFC-compliant email address (was Re: Quickie: regexp for valid e-mail addresses)
Message-Id: <6be7bd$75s$2@client2.news.psi.net>
Russell Schulz (Russell_Schulz@locutus.ofB.ORG) wrote on 1619 September
1993 in <URL: news:19980205.221520.6B9.rnr.w164w_-_@locutus.ofB.ORG>:
++ abigail@fnx.com (Abigail) writes:
++
++ > There isn't any symbol from ASCII set that is *not* allowed in an
++ > email address. Read RFC822 for details.
++
++ this is not true, for the domain-part.
The domain part is allowed to have comments.
Abigail
--
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT
------------------------------
Date: 6 Feb 1998 04:11:11 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Passing Javascript variables to Perl CGI?
Message-Id: <6be2gv$n7m$6@comdyn.comdyn.com.au>
In article <886603945.855572489@dejanews.com>,
Jonathan Higbee <petcrows@bigfoot.com> writes:
> access my site as well as the user's host name. The HTTP_REFERER
> variable is not available in Perl CGI on my ISPs server, but the
Seriously broken HTTPD server. Warn your ISP that they're using crap.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd. | excuse - Lazarus Long
NSW, Australia |
------------------------------
Date: Thu, 05 Feb 1998 20:51:18 -0800
From: "Hsu, Chang Cheng" <changhsu@csua.berkeley.edu>
Subject: Perl screwed by IIS4 upgrade
Message-Id: <34DA96C6.1447@csua.berkeley.edu>
Hi,
1) my perlscripts stopped working after upgrade. i get the error:
Can't open perl script "_private": Permission denied.
"_private" is a directory used by Interdev or Frontpage.
2) IIS4 upgrade nuked my all my script maps in registry. i put the ".pl"
script map back, but still get same error.
3) maybe IIS4 doesn't need those script maps. its got this "Application
settings" feature in MMC that i can use to associate Perl interpreter
with ".pl", but still get smae error.
i did remember to restart the server each time.
i appreciate all the nice new features, but now my mission-critical site
is useless no matter how many new features i get.
help!
thanks
chang
------------------------------
Date: Thu, 05 Feb 1998 16:53:13 +0000
From: Cerebus <stop@spamming.me>
Subject: Perl, Tcl and Expect?
Message-Id: <34D9EE79.C9788F18@spamming.me>
Hi,
Can anyone point me in the direction of any information on Expect
for Perl? I'd like to use Perl, but I need to use Expect and from what
I can gather that would necessitate my using Tcl (something I'd like
to avoid if possible).
Thanks in advance.....
Cerebus (smahon@REMOVE_TO_EMAIL.accuris.ie)
------------------------------
Date: Fri, 06 Feb 1998 00:39:04 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: Lakshmanan Suryanarayanan <Lakshmanan.Suryanarayanan@MCI.COM>
Subject: Re: PERL2EXE
Message-Id: <34DAA1F9.5B5D45FB@coos.dartmouth.edu>
Lakshmanan Suryanarayanan wrote:
>
> If you are talking about the double headers, it is you who has a
> attitude and a sight problem. Get both of them checked.
Nope, I got double headers on your message too. Fix your newsreader.
To answer your question, try looking on CPAN.
<http://www.perl.com/CPAN/>
Chipmunk
------------------------------
Date: 05 Feb 1998 23:37:28 -0500
From: Jay Rogers <jay@rgrs.com>
To: "Anders Mathisen" <andersma@idt.ntnu.no>
Subject: Re: Redirecting STDIN/STDOUT to socket
Message-Id: <827m79tkl3.fsf@shell2.shore.net>
"Anders Mathisen" <andersma@idt.ntnu.no> writes:
> I am trying to write a simple client/server system where the client is a
> java applet, and the server is a perl script. The server shall excecute a
> console application redirecting the input/output streams of the application
> so it communicates with the client and not the console.
This example associates the server's socket with cat's stdin and
stdout. Try it out on your machine, then you can mold it into your
own image.
use FileHandle qw(autoflush);
use Socket qw(AF_INET INADDR_ANY SOCK_STREAM SOL_SOCKET
SO_REUSEADDR sockaddr_in);
my($fd, $fh, $pid, $socket);
my $port = 6060;
## Start listening for client connections.
$socket = new FileHandle;
socket $socket, AF_INET, SOCK_STREAM, 0
or die "socket: $!";
setsockopt $socket, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)
or die "setsockopt: $!";
bind $socket, sockaddr_in($port, INADDR_ANY)
or die "bind: $!";
listen $socket, 5
or die "listen: $!";
## Accept the next connection.
$fh = new FileHandle;
accept $fh, $socket
or die "accept: $!";
autoflush $fh;
unless ($pid = fork) { # child process
die $! unless defined $pid;
$fd = fileno $fh;
open STDIN, "<&$fd" or die $!;
open STDOUT, ">&$fd" or die $!;
open STDERR, ">&STDOUT" or die $!;
exec "cat -u"
or die $!;
}
wait;
exit;
--
Jay Rogers
jay@rgrs.com
------------------------------
Date: 6 Feb 1998 04:58:28 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: The perl institute still alive ?
Message-Id: <6be59k$nlf$1@comdyn.comdyn.com.au>
In article <6bcdu9$9e6@ascomax.hasler.ascom.ch>,
periat@ens.ascom.ch (Periat Henri) writes:
> Does any body know if the perl institute is still alive ?
> since a long time i haven't heard anything from it. Months a go i
> send mails and got no response. And when ever i try to have a look
> at their home page, the browser keeps telling me: "server not reachable".
You mean www.perl.org? No problem from here, hasn't been a problem either.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: Fri, 6 Feb 1998 13:13:38 +1100
From: James Bourne <jbourne@nibupls1.telstra.comdotau>
Subject: Win32::ODBC and MSSQL Stored Procedures
Message-Id: <Pine.HPP.3.96.980206131146.12461A-100000@nuh600.tm.com.au>
All,
I can successfully, connect to an MSSQL database and execute a stored
procedure from within Perl5/Win32::ODBC on NT. I am stumped about how to
get OUTPUT values back from the stored procedure (SP). Viz:
-- Very simple MSSQL SP
CREATE PROCEDURE PerlTestUpdate
(
@P1 VARCHAR(255),
@P2 INT OUTPUT
)
AS
BEGIN
INSERT INTO UserWeb..PerlTest
VALUES
(
@P1,
@P2
)
IF (@@ERROR = 0)
BEGIN
SELECT @P2 = @P2 + 1
RETURN 0
END
RETURN 1
END
I would normally call this as (in another SP):
EXEC @RV = UserWeb.dbo.PerlTestUpdate @P1, @P2 OUTPUT
A Perl script that attempts to do the same thing:
#!/bin/perl
require 5.003;
use strict;
use Carp;
use Win32::ODBC;
MAIN:
{
my $connection;
my $sql;
my $p1;
my $p2;
my $rc;
$connection = new Win32::ODBC("DSN=UserWeb;UID=Guttenberg;PWD=");
Carp::croak("Oops the connection failed...")
if (! defined $connection);
$p1 = "Insert from Perl";
$p2 = 1;
# Fire the SP
##### WHAT DO I NEED TO DO HERE??? ######
$sql = "EXEC UserWeb..PerlTestUpdate '$p1', $p2 OUTPUT";
print $sql;
$rc = $connection->Sql($sql);
Carp::carp($connection->DumpError())
if ($rc != 0);
$connection->Close();
exit 0;
}
1;
If anyone has successfully captured the return value or the OUTPUT
parameters, please let me know how to do it!
Many thanks,
---------------------------------------------
James Bourne
Webhosting
Telstra Multimedia
Phone: 02 9903 3110
EMail: jbourne@nibupls1.telstra.comdotau
(pls. replace dot with . to email me)
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 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.
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 1820
**************************************