[6776] in Perl-Users-Digest
Perl-Users Digest, Issue: 401 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 30 20:07:29 1997
Date: Wed, 30 Apr 97 17:00:20 -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 Wed, 30 Apr 1997 Volume: 8 Number: 401
Today's topics:
Avoid writing a temp file <schapal@jonesctr.org>
Built in Perl func to expand env vars??? <keesh@cs.cmu.edu>
Re: Built in Perl func to expand env vars??? (brian d foy)
Re: Built in Perl func to expand env vars??? (Matthew Cravit)
Deadlock handler in Sybperl 2.0x <pauls@spry.com>
Re: handling runtime errors <rra@stanford.edu>
Re: How to join 2 different files togheter <spammers_suck@[127.0.0.1]>
Re: Input pipes and STDERR (Bob)
need help with simple perl CGI form yourke@earthlink.net
Re: Notice to antispammers <rsi@lucent.com>
Re: Notice to antispammers <rsi@lucent.com>
Re: Notice to antispammers <rra@stanford.edu>
Re: Notice to antispammers (Nathan V. Patwardhan)
Re: Notice to antispammers (Tung-chiang Yang)
Re: Notice to antispammers (Kent Perrier)
NT port of Perl 5 (Kevin Posen)
Re: Perl 5.003 bug??? (brian d foy)
Re: Perl auto-replier (Andy Wardley)
Re: Perl using Microsoft Personal Web Server <petri.backstrom@icl.fi>
Re: program for perl? <dsonak@us.oracle.com>
Re: Reading this will take seconds! (Craig Berry)
Re: References in foreach loop variable (David Alan Black)
Undefined subroutine &main::AF_INET <cmullendore@spyglass.com>
Re: Undefined subroutine &main::AF_INET <rra@stanford.edu>
Re: Undefined subroutine &main::AF_INET (Matthew Cravit)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 30 Apr 1997 16:06:02 -0400
From: Scott Chapal <schapal@jonesctr.org>
Subject: Avoid writing a temp file
Message-Id: <3367A62A.4F5A@jonesctr.org>
In the example below, I created the subroutine with find2perl.
I then concatanate the 100's of small files found with:
print OUTFILE <IN>,"\n";
to a temporary file.
Later, $rec is created by an ugly sequence of piped UNIX
programs from the temporary file.
How do I circumvent the need to write that temporary file
and do all the filtering (dos2unix, tr, sed, grep) to get
the data into an array, in a more elegant way?
Thanks for any insights.
--
Scott E. Chapal____________________________________________________
Database & Network Manager 912.734.4706
J.W. Jones Ecological Research Center FAX:912.734.6650
Rt. 2. Box. 2324. Newton, GA 31770 schapal@jonesctr.org
#!/usr/local/bin/perl
# SEC Thu Apr 17 10:24:43 EDT 1997
# /net/hal/export/research/prod/soil/programs/filter.esd.files
eval 'exec perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
require "find.pl";
#Write temp file
open(OUTFILE, ">> ./temp.out");
# Traverse desired filesystems using subroutine defined below
&find('.');
close(OUTFILE);
open(OUTFILE2, "> ./all/data.unx");
# Enable paragraph mode ie. Empty lines separate "Paragraphs".
$/ = "";
# dos2unix; then replace tabs with semicolons;
# then remove extraneous lines
# This should be done in Perl proper.
$rec =`dos2unix temp.out | tr '\t' ';' | sed '/^\$/d' | \
grep -v Report | grep -v Pkno | \
grep -v Total `;
@srec=split(/\n/,$rec);
$number_of_elements = scalar(@srec);
#print("$number_of_elements\n");
print OUTFILE2 "OBS SAMPLE SAMPLEID TOT\n";
$i = 0;
while ($i < $number_of_elements) {
foreach (@srec[$i]){
if ($i%2 == 0) {
@split_srec = split(/;/,@srec[$i]);
@ssplit_srec = split(/\./,@split_srec[6]);
#Use pattern binding operator on filepath to extract sampdate
#Remove directory, i modifier used for case insensitive matching
$sampdate = ($ssplit_srec[0]);
$sampdate =~ s#c:\\ezchrom\\chrom\\.*\\##i;
#filenem is the number of files processed.
$filenum=($i+2)/2;
}
else {
@total_srec = split(/;/,@srec[$i]);
$total = @total_srec[3];
write OUTFILE2;
}
}
$i++;
}
#Format data.out
close OUTFILE2;
format OUTFILE2 =
@<< @<<<<<<<<<<< @<<<<<<< @<<<<<<<<<<<
$filenum $split_srec[5] $sampdate $total
.
print " \n Output is in the file 'data.unx'
located in ../all .\n\n";
#Remove temporary file
system("/usr/bin/rm -f temp.out");
exit;
# sub-routine outline created by:
# find2perl .. \( ! -name "????00[1-6]a.esd" \) \
# \( ! -name "????025a.esd" \) \( ! -name "????044a.esd" \) \
# \( -name "*.esd" \) -print
#
# These requirements were for C.Wilsons project
# Data file naming convention is MMDDSSSa.esd
# Where MM - Month DD - Day SSS - 3 digit sample no.
# and all files end in 'a.esd'.
sub wanted {
(
(($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
/^.*\.esd$/
) &&
(
! /^.?.?.?.?025a\.esd$/
) &&
(
! /^.?.?.?.?044a\.esd$/
) &&
(
! /^.?.?.?.?00[1-6]a\.esd$/
) &&
#print("$name\n");
#Use 'open' here within 'find' syntax to capture
# appropriate files and send to 'IN' filehandle
open(IN, $_);
#open(IN, $_) || die "Cannot open $_ for reading";
#Append IN file to OUTFILE
print OUTFILE <IN>,"\n";
close(IN);
}
--
Scott E. Chapal____________________________________________________
Database & Network Manager 912.734.4706
J.W. Jones Ecological Research Center FAX:912.734.6650
Rt. 2. Box. 2324. Newton, GA 31770 schapal@jonesctr.org
------------------------------
Date: Wed, 30 Apr 1997 17:23:33 -0400
From: Eric Kischell <keesh@cs.cmu.edu>
Subject: Built in Perl func to expand env vars???
Message-Id: <3367B855.167E@cs.cmu.edu>
Hello,
I am currently learning Perl from the Camel book.
Is there any built-in Perl functionality(non system calls) to expand
environmental variables?
ex parsed from file.)
CT header file: $(PATIENT_DIR)/ct/hdr.I20886_3.001
$(PATIENT_DIR) would be expanded to what it is set to in the user's
current environment.
thx in adv
e.-
------------------------------
Date: Wed, 30 Apr 1997 18:51:49 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Built in Perl func to expand env vars???
Message-Id: <comdog-3004971851490001@nntp.netcruiser>
In article <3367B855.167E@cs.cmu.edu>, Eric Kischell <keesh@cs.cmu.edu> wrote:
> Hello,
>
> I am currently learning Perl from the Camel book.
> Is there any built-in Perl functionality(non system calls) to expand
> environmental variables?
>
> ex parsed from file.)
> CT header file: $(PATIENT_DIR)/ct/hdr.I20886_3.001
>
> $(PATIENT_DIR) would be expanded to what it is set to in the user's
> current environment.
you can use the %ENV hash, like
$ENV{'PATIENT_DIR'}
to get the value of that environment variable.
--
brian d foy <URL:http://computerdog.com>
unsolicited commercial email is not appreciated
------------------------------
Date: 30 Apr 1997 16:25:41 -0700
From: mcravit@shell3.ba.best.com (Matthew Cravit)
Subject: Re: Built in Perl func to expand env vars???
Message-Id: <5k8kdl$9j5@shell3.ba.best.com>
In article <3367B855.167E@cs.cmu.edu>, Eric Kischell <keesh@cs.cmu.edu> wrote:
>Hello,
>
>I am currently learning Perl from the Camel book.
>Is there any built-in Perl functionality(non system calls) to expand
>environmental variables?
Well, you can do two things, depending on where the strings with the
environment variables are coming from. If they're coming from somewhere
where they are formatted in shell script form, you could do something like
$string = q($HOME/foo/bar); # The string to expand
$foo = `echo $string`;
and $foo will contain the expanded string. The downside of this approach
is that it spawns off a shell to handle the expansion. A more efficient way
would be to go through the string and do the expansions yourself. You have
access to the environment of the user running the script via the %ENV hash,
to facilitate this.
Hope this helps.
/MC
--
--
Matthew Cravit, N9VWG | Experience is what allows you to
E-mail: mcravit@best.com (home) | recognize a mistake the second
mcravit@taos.com (work) | time you make it.
------------------------------
Date: 30 Apr 1997 21:39:39 GMT
From: "Paul Steward" <pauls@spry.com>
Subject: Deadlock handler in Sybperl 2.0x
Message-Id: <01bc55ae$e65bd620$a501b9c6@freedom>
Has anyone written a deadlock handler for Sybperl that is freely available?
Paul Steward
------------------------------
Date: 30 Apr 1997 14:59:18 -0700
From: Russ Allbery <rra@stanford.edu>
To: stephen farrell <stephen+usenet@farrell.org>
Subject: Re: handling runtime errors
Message-Id: <qumhggoi349.fsf@cyclone.stanford.edu>
[ Posted and mailed. ]
stephen farrell <stephen+usenet@farrell.org> writes:
> is there a more universal way of handling all perl show-stopper errors?
See man perlfunc under eval. If you use the block form of eval, such as:
eval { problematic_statement };
then the errors, if any, will be placed in $@ rather than stopping
execution and you can check $@ and do whatever you wish with them.
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: 30 Apr 1997 16:11:49 -0700
From: zeadeATstanford.edu <spammers_suck@[127.0.0.1]>
Subject: Re: How to join 2 different files togheter
Message-Id: <5k8jjl$sie@epic16.Stanford.EDU>
In comp.lang.perl.misc, Marco Giardini (marco@tecnogi.mdnet.it) blibbers...
> I have 2 differnet files with the same number of rows and I want to
> join them togheter in order to get only one file that will have for each
> row the "sum" of the rows of the single file.
>
> I.E.
> file1
> a
> b
> c
> d
> e
>
> file2
> 1
> 2
> 3
> 4
> 5
>
> the result i need is something like:
> file RESULT
> a 1
> b 2
> c 3
> d 4
> e 5
>
> How can i get the combined file using Perl?
> What is the right sintax to produce a third file (RESULT) so combined as
> mentioned above?
Here is a quick hack (tested just to make sure it worked):
-- begin script --
#!/usr/local/bin/perl
$file1 = 'foo';
$file2 = 'bar';
$results = 'foobar';
open(FILE, $file1) or die;
@lines = <FILE>;
@lines = map { chop; $_; } @lines; # chop off the newlines
open(FILE, $file2) or die;
open(RESULTS, ">$results") or die;
while (<FILE>) {
print RESULTS shift(@lines) . ' ' . $_;
}
-- end script --
This script assumes you have the same number of lines in each file,
and all the data is ordered the way you want it as it is read in.
This is just an example of the process; it handles no exceptions and
is pretty Dumb. And of course your file names are 'foo' and 'bar' :)
> Thanks to everybody will give ma an help mailing me to
> marco@tecnogi.com or giardini@telnetwork.it
You can wade through this newsgroup like everyone else ;)
huzzah,
Micah
(note: lame-o spam block in effect, e-mail address is zeade...)
--
`which perl` -e 's;^;siC%by:n19%o>o2z4on19%`"t2z`fn3o.%.2o.z.2o.g4og.5o.g.;;\
s;$;4o.4%f%.2o.n`fP"Y2>bP"Y2>bz`fzd2>t%`"Y>%`Pz)2>bgfP"Y2>bn%p#f8%.oP"#n%p;;\
s;$;#p.o>%d>(z#n____`Y>bod>Pt%`Yf2">o%__n;;s;#;ppfz;g;s;p;fg;g;s;_;ofo%;g;;;\
s;z;2%;g;s;g;3%;g;s;f;3>;g;s;(\d+)(.);$2x$1;eg;y;t>%nC;\x278 \ng;;print;'
------------------------------
Date: Wed, 30 Apr 1997 21:13:34 GMT
From: xxbbell@voicenet.com (Bob)
Subject: Re: Input pipes and STDERR
Message-Id: <5k8cin$1ub$1@news3.voicenet.com>
Yes, I believe that there is a way. You would redirect STDERR
and STDOUT. I think I saw it mention in an HTMLed man page somewhere.
However, if you do not care about that line, how about just using
"traceroute irc.netcom.com 2> /dev/null", which will redirect the
STDERR to null at the command line.
reidm@shell4.ba.best.com (Reid Miller) wrote:
>I am trying to use traceroute in an input pie but run into an interesting
>idiosyncracy of the traceroute command... The first lie of it's output is sent
>to STDERR and not to STDOUT. i.e.
>
>Instead of getting this output as the first line in my pipe, this gets
>dumped out to the terminal.
>
>traceroute to irc.netcom.com (206.217.29.1), 30 hops max, 40 byte packets
>
>I really don't care what happens to the line, I just don't want it coming out
>to the terminal. Is there a way to have both STDERR and STDIN come in the input
>pipe? SHould this be done with shell redirection or something?
>
>Thanks.
>
>Reid
- Bob
xxbbell@voicenet.comxx
remove x's to reply
------------------------------
Date: Wed, 30 Apr 1997 17:33:23 -0600
From: yourke@earthlink.net
Subject: need help with simple perl CGI form
Message-Id: <862404027.16742@dejanews.com>
I need help with this cgi - someone who knows perl should probably have no
trouble seeing what I have been struggling with for 2 days.
The HTML page displays, but input to it is not captured and processed. Why
not? This is due for my class on Thursday 5/1, so a quick hint is
appreciated!
#!/usr/local/bin/perl
#if this is the first time through
if (!defined $ENV{'CONTENT_LENGTH'} || $ENV{'CONTENT_LENGTH'} eq ''){
#set "beenhere" flag to "no"
$beenhere="no";
#make sure "VALUE=" for operand1 will not be filled in HTML page
$operand1value="";
#print the HTML page
&HTMLdisplay;
#and exit
exit(0);}
#if values have been submitted, parse out STDIN into operand1, operation,
and operand2
else{&ParseSTDIN;
#define operands
$operand1 = $input{'operand1'};
$operand2 = $input{'operand2'};
#send error message if operands are not numbers (couldn't find proper
command)
#unless ($operand1 || $operand2 isdigit)
# {die "<H2>Since when does a calculator add characters??
# <P>Click your Back button, please, and use numbers!</H2>";
#perform selected operation on operands
if ($input{'operation'} eq "add")
{$input=$operand1+$operand2;}
elsif ($input{'operation'} eq "subtract")
{$result=$operand1-$operand2;}
elsif ($input{'operation'} eq "multiply")
{$result=$operand1*$operand2;}
elsif ($input{'operation'} eq "divide" && ($operand2 ne 0))
{$result=$operand1/$operand2;}
#send error message if a radio button was not checked
#or a divide by zero was attempted
else {die "<H2>Either you didn't select an operation
or you attempted to divide by zero.
<P>Click your Back button, please, and try again!</H2>";
#set result to operand1 by changing HTML document
$usethis=$result;
if(defined $result){$operand1value=(qq/VALUE="$usethis"/);}
#set "beenhere" flag
$beenhere="yes";
#display virtual HTML document with operand1 value set to the result
&HTMLdisplay;
exit(0);}}
#note variable after "operand1"
sub HTMLdisplay{
print "Content-type: text/html", "\n\n";
print <<EndOfHTML;
<HTML>
<HEAD>
<TITLE>Calculator</TITLE>
</HEAD>
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FFFF00"
VLINK="#C0C0C0" ALINK="#C0FFC0">
<CENTER><FONT COLOR="#FEF801"><FONT SIZE=+4>Simple Calculator
<P>
<FORM METHOD="post" ACTION="http://www.lab.sce.nyu.edu/cgi-bin/yourke/
calculator.pl">
<INPUT TYPE="text" NAME="operand1" $operand1value MAXLENGTH=20>
<BR>
<INPUT TYPE="radio" NAME="operation" VALUE="add">+
<INPUT TYPE="radio" NAME="operation" VALUE="subtract">-
<INPUT TYPE="radio" NAME="operation" VALUE="multiply">x
<INPUT TYPE="radio" NAME="operation" VALUE="divide">w
<BR>
<INPUT TYPE="text" NAME="operand2" MAXLENGTH=20>
<BR>
<INPUT TYPE="submit" VALUE="Get Result"><INPUT TYPE="reset" VALUE="Clear">
</FORM></FONT></CENTER>
<PRE>
Result = $result
Beenhere = $beenhere
Operand1value = $operand1value
Operand1 = $operand1
Operand2 = $operand2
Content Length = $ENV{'CONTENT_LENGTH'}
</PRE>
</BODY>
</HTML>
EndOfHTML
}
#This subroutine was adapted from Troy Downing's book
sub ParseSTDIN{
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@namevalue = split(/&/,$buffer);
foreach $pair (@namevalue){
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([A-Fa-f0-9][A-Fa-f0-9])/pack("C",hex($1))/eg;
if ($value ne ""){$input{$name}=$value;}
}
return %input;}
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 30 Apr 1997 16:59:42 -0400
From: Rajappa Iyer <rsi@lucent.com>
Subject: Re: Notice to antispammers
Message-Id: <xnyg1w8fcqp.fsf@placebo.hr.lucent.com>
nvp@shore.net (Nathan V. Patwardhan) writes:
> Rajappa Iyer (rsi@lucent.com) wrote:
>
> : It is relevant because an email address in and of itself is
> : useless.
>
> Fair enough. Therefore Tom is putting useless content on a webpage,
> and it shouldn't mean anything to you unless someone sends you spam.
And what do you suggest I do when that happens? Note that I said when
and not if.
> : When Tom hands my address on a platter to spambots, he's essentially saying
> : "use this computer's resource."
>
> Ha! This is the best line of reasoning I've heard yet.
Any particular reason for the admiration or am I to take your disdain
as a convincing counter argument?
> : Is it legal? Yes. Is it ethical? No way in hell.
>
> Ok. Just because of your fantastic, logical arguments, I'm going to
> remove all the HREF mailto(s) from my webpages, as I'm truly enlightened.
Barring the tone, you're probably not too far off the mark. :-)
--
Rajappa Iyer <rsi@lucent.com> #include <std_disclaimer.h>
They also surf who only stand on the waves.
------------------------------
Date: 30 Apr 1997 17:06:49 -0400
From: Rajappa Iyer <rsi@lucent.com>
Subject: Re: Notice to antispammers
Message-Id: <xnyenbsfceu.fsf@placebo.hr.lucent.com>
tcyang@netcom.com (Tung-chiang Yang) writes:
> I don't see any significant difference between Tom putting your
> address in a page of his, and you put your address in From: shown in
> this post. You might argue that you own your address and Tom did not
> for yours, but note that news servers all over the world do not own
> your address and they show yours, just like what Tom plans to do.
The issue was about putting up the addresses of people who have
altered their addresses... since I haven't there is is no call for Tom
to show my address and it doesn't matter in my case. But if I did
munge my address, as many do, then Tom has no grounds except
childish petulance for putting up my real address on a web page for
spambots to harvest.
> Just like someone who said along this thread (Matt?), Tom has no right
> to forbid you using an altered address, and you would have no right to
> forbid him to create that page.
No right and nowhere have I forbidden him to do so. I do, however,
have a right to disapprove... wouldn't you agree? Just to forestall
the obvious... note that the expression of my disapproval in no way or
form affects the usage of Tom's resources, whereas his method of
disapproval does affect people's resources. I haven't encouraged (no
matter how indirectly) spammers to spam him. He has encouraged
spammers to spam people who do not wish to be spammed.
--
Rajappa Iyer <rsi@lucent.com> #include <std_disclaimer.h>
They also surf who only stand on the waves.
------------------------------
Date: 30 Apr 1997 14:47:04 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Notice to antispammers
Message-Id: <qumk9lki3on.fsf@cyclone.stanford.edu>
Rajappa Iyer <rsi@lucent.com> writes:
> Why? As far as I can see, nowhere does RFC 1036 specify that the From:
> header *must* reflect the real email address of the user.
2.1.1. From
The "From" line contains the electronic mailing address of the
person who sent the message, in the Internet syntax.
Sounds pretty clear to me.
> In any case, why exactly does a new server maintainer need real
> addresses?
To contact people in the event of abuse. So that moderators can properly
reject submissions (this is a fairly major one of late). So that messages
in general have a return path. So that under some robomoderation schemes
you can post at all.
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: 30 Apr 1997 22:13:30 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Notice to antispammers
Message-Id: <5k8g6a$q0d@fridge-nf0.shore.net>
Rajappa Iyer (rsi@lucent.com) wrote:
: > Fair enough. Therefore Tom is putting useless content on a webpage,
: > and it shouldn't mean anything to you unless someone sends you spam.
: And what do you suggest I do when that happens? Note that I said when
: and not if.
Tolerate. Don't munge your address ... filter instead. In fact, I enjoy
filtering 200x as much as I might enjoy screwing with my mail header.
: Any particular reason for the admiration or am I to take your disdain
: as a convincing counter argument?
Because you seem to be the most vehement (and sometimes downright hostile)
of the bunch, so you get the dubious honor of my heckling.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Wed, 30 Apr 1997 22:23:29 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Notice to antispammers
Message-Id: <tcyangE9H276.D3q@netcom.com>
Rajappa Iyer (rsi@lucent.com) wrote:
: The issue was about putting up the addresses of people who have
: altered their addresses... since I haven't there is is no call for Tom
: to show my address and it doesn't matter in my case. But if I did
: munge my address, as many do, then Tom has no grounds except
: childish petulance for putting up my real address on a web page for
: spambots to harvest.
Maybe he has no grounds, but can you penalize him with legal or moral
means? No. Write to your senators in New Jersey if you want to sue
Tom for doing this, please.
: No right and nowhere have I forbidden him to do so. I do, however,
: have a right to disapprove... wouldn't you agree? Just to forestall
: the obvious... note that the expression of my disapproval in no way or
: form affects the usage of Tom's resources, whereas his method of
: disapproval does affect people's resources. I haven't encouraged (no
: matter how indirectly) spammers to spam him. He has encouraged
: spammers to spam people who do not wish to be spammed.
You do have a right to disapprove -- but you have nothing to do when
he actually does that. It is like today if you are a US citizen you
have full right, 100% of the right, to object Mr. Clinton to serve as
US President. However, you cannot stop that fact.
Today if Tom did set up that page, you can flame him, criticize him,
condemn him or slander him, but if he insists to put that page with
your real address, I am afraid only his ISP can order him to remove it.
If you follow up this post of mine, I will directly post it to NANAP
and continue the discussions there, if you enjoy so much about discussing
address issues in this Perl group.
--
Tung-chiang Yang tcyang@netcom.com
soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
http://www.clever.net/tcyang/Taiwan_faq.shtml, China_faq.shtml
------------------------------
Date: 30 Apr 1997 18:25:34 -0500
From: kperrier@Starbase.NeoSoft.COM (Kent Perrier)
Subject: Re: Notice to antispammers
Message-Id: <cswwpk3xg1.fsf@Starbase.NeoSoft.COM>
In article <xnyohaxh8zn.fsf@placebo.hr.lucent.com>
Rajappa Iyer <rsi@lucent.com> writes:
>Maybe... OTOH, it does not reflect too well on Tom either that he did
>not respond to single substantial point in any of the replies to his
>post.
Well, the fact that he doesn't read this newsgroup anymore might have something
to do with it.
Kent
--
Kent Perrier If Bill Clinton is the answer, then it must
kperrier@neosoft.com have been a really stupid question.
Corporations don't have opinions, people do. These are mine.
PGP 2.6 Public Key available by request and on key servers
PGP encrypted mail preferred!
------------------------------
Date: Wed, 30 Apr 1997 22:30:29 GMT
From: posenj@lancet.co.za (Kevin Posen)
Subject: NT port of Perl 5
Message-Id: <3367c6f0.11178900@news.saix.net>
Hi.
I'm looking for the Windows NT 3.51 Resource kit containing an NT port of
Perl 5. I need the later version which works on Windows 95 as well.
Anyone know of such a thing?
Thanks,
Kevin Posen
------------------------------
Date: Wed, 30 Apr 1997 18:48:27 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl 5.003 bug???
Message-Id: <comdog-3004971848270001@nntp.netcruiser>
In article <5k07lm$eo2@cri.ens-lyon.fr>, vlefevre@ens-lyon.fr wrote:
> Consider the following script:
>
> foreach ("a 0","b 0")
> {
> print "1 $_\n";
> substr($_,0,1) =~ // or die;
> print "2 $_\n";
> / /;
> }
>
> It prints:
> 1 a 0
> 2 a 0
> 1 b 0
> and dies...
>
> Why??? Is it a bug?
>
> Note: if I remove the line "/ /;", it doesn't die.
what are you expecting it to do? let's go through it step by step
(perhaps using -Dr will help you see what's going on :) ):
1. $_ is set to "a 0"
2. "1 a 0\n" is printed
3. "a" is matched against the default regular expression. remember,
perl uses the default regex if you don't specify one. the default
regex is the last one used successfully in the current scope
4. "2 a 0\n" is printed
5. $_ is successfully matched against ' ', setting the default regex
to ' '
6. "1 b 0\n" is printed
7. "b" is matched against the default regex, ' ', and fails, so
the script die()s.
obviously, if you remove the last match, the default regex is not
set to ' ', so the script doesn't die.
--
brian d foy <URL:http://computerdog.com>
unsolicited commercial email is not appreciated
------------------------------
Date: 30 Apr 1997 08:58:29 +0100
From: abw@peritas.com (Andy Wardley)
Subject: Re: Perl auto-replier
Message-Id: <5k6u35$qip@aoxomoxoa.peritas.com>
Tom Christiansen <tchrist@mox.perl.com> wrote:
>It got to be too much for him. When something's too much for him,
>he bails. I, on the other hand, got pissy and tried to stick with it.
>I was wrong, twice, but I'm through with those mistakes. I go now to
>join Larry in that great Perl heaven far removed from Usenet.
It's a damn shame but I don't blame you for it.
The sad thing is that there are hundreds, if not thousands, of people out
there who very much appreciate everything you do for clpm and the perl
community at large. These people are mostly silent but believe me, we're
out there.
The few arrogant shits who wouldn't understand the concept of "community"
if it was tattoed on their forehead, expect something for nothing and
kick their heels on the ground when they don't get it. They make the
most noise but they're not worth the packets they're propagated in.
It's a sad fact of life but that's the way Usenet is going.
There I've said it. Imminent death of Usenet predicted. Film at 11.
A
--
Andy Wardley <abw@peritas.com> **NEW** http://www.peritas.com/~abw
A responsible and professional individual who has no need for silly
comments, inane banter or bizarre "in-jokes" in his signature file.
------------------------------
Date: Wed, 30 Apr 1997 22:29:42 +0200
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: Perl using Microsoft Personal Web Server
Message-Id: <3367ABB6.8DD@icl.fi>
Sidney Snodgrass wrote:
>
> I have just installed MS PWS and need to run Perl, can someone tell me
> where to download it from and if there are any 'special' install
> instructions to be aware of.
You download Perl for Win32 from
http://www.activeware.com
See also
http://www.perl.com/FAQ/
and
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
FAQ number 6.3 in the latter list is about your question
(however, the ActiveWare installation should handle it
for you, but in case it doesn't, what you need to know
is there).
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: Wed, 30 Apr 1997 14:07:52 -0700
From: "Dipti V. Sonak" <dsonak@us.oracle.com>
To: "Suzanne L." <suzanne@intrepid.axess.com>
Subject: Re: program for perl?
Message-Id: <3367B4A8.F8F@us.oracle.com>
Use any editor to write the perl syntax.
- dipti
Suzanne L. wrote:
>
> Is there a program that is needed to write in perl or can they be
> written in any text editor?
>
------------------------------
Date: 30 Apr 1997 20:56:26 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Reading this will take seconds!
Message-Id: <5k8blq$1kp$1@marina.cinenet.net>
Nathan V. Patwardhan (nvp@shore.net) wrote:
: Sly@yournamehere.com wrote:
: : Thanks for your time. We at I.S.P.O.T. (The International Society
: : for the Preservation Of Trees (URL http://www.local-touch.com/ISPOT/)) feel
: : that electronic messages are great for getting the word out while preserving
: : our friend the tree. Anyway, please stop by our home page!
:
: How about the "International Society for the Preservation of Bandwidth?" :-)
I'll bet you thought you were joking -- see
http://www.infohiway.com/faster/index.html
for the Bandwidth Conservation Society website.
---------------------------------------------------------------------
| 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: 30 Apr 1997 22:11:15 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: References in foreach loop variable
Message-Id: <5k8g23$5kr@pirate.shu.edu>
Hello -
Keith Arner <kraven@keystone.westminster.edu> writes:
>David Alan Black <dblack@icarus.shu.edu> wrote:
Anyone following this, see my posting on "globs, refs, aliases,
foreach - have I got the idea?". (Keith, I'll mail you a copy :-)
David Black
dblack@icarus.shu.edu
------------------------------
Date: Wed, 30 Apr 1997 17:06:39 -0400
From: Chris Mullendore <cmullendore@spyglass.com>
Subject: Undefined subroutine &main::AF_INET
Message-Id: <3367B45F.328@spyglass.com>
I'm trying to port a perl5 script from UNIX to NT. It craps out on the
last line of the code excerpt below with the following message:
Undefined subroutine &main::AF_INET called at C:\Perl\bin/aub.bat line
1088, <CONFIG> chunk 7.
I'm running version:
This is perl, version 5.003_07
Perl for Win32 Build 306 - Built 17:50:28 Apr 10 1997
The relevant code is:
require "socket.pm";
...
&connect_tcp(SOCKET, $server, $port, 1); # Connect or bust
...
sub connect_tcp {
#
# Connect to a tcp port on some host. This code is useful in more
places
# than just in aub.
local($e) = pop(@_); # 0=return on err, >0 = print error, abort
on err
local($port) = pop(@_); # port to connect to
local($server) = pop(@_); # name of server to connect to
local($sockname) = pop(@_); # socket to use
local($packing_template) = "S n a4 x8";
local($protocol) = "tcp";
local($thishost, $problem, $junk);
# The following works by way of the GNU-Win32 toolkit from Cygnus.
$thishost = `hostname`; chop $thishost;
# Figure out our address...
($name, $junk, $junk, $junk, $ouraddr) = gethostbyname($thishost);
if ($name eq "") {
$problem="Can't get address of this host (\"$thishost\")";
&abort($problem) if $e;
return $e;
}
...
# Get the number of the protocol we're to use
($name, $junk, $proto) = getprotobyname($protocol);
if ($name eq "") {
$problem="Unrecognized protocol: $protocol";
&abort($problem) if $e;
return $e;
}
# The following line raises the error.
$us = pack($packing_template, &AF_INET, 0, $ouraddr);
Thanks for any help.
Chris Mullendore (cmullendore@spyglass.com)
------------------------------
Date: 30 Apr 1997 16:11:18 -0700
From: Russ Allbery <rra@stanford.edu>
To: cmullendore@spyglass.com
Subject: Re: Undefined subroutine &main::AF_INET
Message-Id: <qum7mhkhzs9.fsf@cyclone.stanford.edu>
[ Posted and mailed. ]
Chris Mullendore <cmullendore@spyglass.com> writes:
> I'm trying to port a perl5 script from UNIX to NT. It craps out on the
> last line of the code excerpt below with the following message:
> Undefined subroutine &main::AF_INET called at C:\Perl\bin/aub.bat line
> 1088, <CONFIG> chunk 7.
> require "socket.pm";
Don't do that; try:
use Socket;
instead.
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: 30 Apr 1997 16:20:24 -0700
From: mcravit@shell3.ba.best.com (Matthew Cravit)
Subject: Re: Undefined subroutine &main::AF_INET
Message-Id: <5k8k3o$8l3@shell3.ba.best.com>
In article <3367B45F.328@spyglass.com>,
Chris Mullendore <cmullendore@spyglass.com> wrote:
>last line of the code excerpt below with the following message:
>
> Undefined subroutine &main::AF_INET called at C:\Perl\bin/aub.bat line
>1088, <CONFIG> chunk 7.
> local($e) = pop(@_); # 0=return on err, >0 = print error, abort
>on err
> local($port) = pop(@_); # port to connect to
> local($server) = pop(@_); # name of server to connect to
> local($sockname) = pop(@_); # socket to use
Out of curiosity, why not just write this as:
local ($e, $port, $server, $sockname) = @_;
> $us = pack($packing_template, &AF_INET, 0, $ouraddr);
^^^^^^^^
That should probably be either just AF_INET or $AF_INET. Of course, if you
just do "use Socket;", you can let the Socket library module handle a lot
of the packing stuff for you and not have to worry about it. Pages 348-355
and 498-500 of Programming Perl, 2nd ed. are helpful as well.
Hope this helps.
/MC
--
--
Matthew Cravit, N9VWG | Experience is what allows you to
E-mail: mcravit@best.com (home) | recognize a mistake the second
mcravit@taos.com (work) | time you make it.
------------------------------
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 401
*************************************