[6634] in Perl-Users-Digest
Perl-Users Digest, Issue: 259 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 9 11:17:39 1997
Date: Wed, 9 Apr 97 08:00:27 -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, 9 Apr 1997 Volume: 8 Number: 259
Today's topics:
Re: "Rip the head of...." (Dave Thomas)
Re: "Rip the head of...." (Tad McClellan)
Affordable Web Hosting Solutions woutlet@worldnet.att.net
Re: Can It Be Done jhardy@cins.com
Re: Can It Be Done (John Hardy)
Re: Error when using Accept <joeo@hpfcjoe.fc.hp.com>
File handles in Perl...(akench@cvimail.cv.com) akench@cvimail.cv.com
Head of mail.... <pucko@lysator.liu.se>
Re: Holy Wars! (was: Perl vs C++, Unix vx MS, etc) (Mark Mills)
Re: No GUI environment for Perl? (Mark Mills)
Re: Pattern matching (Regexp) <dbe@wgn.net>
Re: Perl / Forms and Post (Mark Mills)
Problem with setuid script in Solaris (Leon Poon)
question from a newbie (perl and password) <reya@wni.com>
Radius, a perl for your thoughts <abrigham@mail.foxnet.net>
Re: Radius, a perl for your thoughts (Tad McClellan)
Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Michael Sperber [Mr. Preprocessor])
Re: Simple array question by newbie... (Peter L. Berghold)
Re: Substitution Question (Tim Gim Yee)
Turning off: SO_LINGER? gt_bradley@online.disney.com
Re: Unix and ease of use (WAS: Who makes more ...) (Anthony Boyd)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 Apr 1997 03:54:32 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: "Rip the head of...."
Message-Id: <slrn5km4nl.n50.dave@fast.thomases.com>
On Wed, 09 Apr 1997 02:33:29 +0200, Magnus Holmberg wrote:
> HI!
>
> Can someone tell me how to "rip the head" of a mail-file?
> I have the mail-file stored by the elm-filter and it has som
> real uggly rows at the beginnig that I like to remove.
Mail headers are separated from the body by an empty line, so you could just
skip until you find one:
perl -ne 'print if /^$/..1' <mail_file
Alternatively, you could start printing from a header you like:
perl -ne 'print if /^From:/..1' <mail_file
Regards
Dave
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Tue, 8 Apr 1997 21:27:34 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: "Rip the head of...."
Message-Id: <mquei5.oql.ln@localhost>
Magnus Holmberg (pucko@lysator.liu.se) wrote:
: HI!
: Can someone tell me how to "rip the head" of a mail-file?
: I have the mail-file stored by the elm-filter and it has som
: real uggly rows at the beginnig that I like to remove.
: It looks like this:
: From someone@ytko.nl Mon Apr 7 12:05:01 1997
: Received: from asd-gw2.euro.net (asd-gw2.euro.net [194.134.0.94])
: by lysander.lysator.liu.se (8.8.5/8.8.5) with SMTP id MAA23195
: for <pucko@lysator.liu.se>; Mon, 7 Apr 1997 12:04:55 +0200 (MET DST)
: Received: (from uucp@localhost) by asd-gw2.euro.net (8.6.12/8.6.10) with
: UUCP id MAA23802 for pucko@lysator.liu.se; Mon, 7 Apr 1997 12:04:33
: +0200
: Received: by ytko.nl (Mailcoach V2.10) via SMTP; Fri, 04 Jul 1997
: 11:31:53
: Comments: Routed through 'Mailcoach V2.10 for Win95/NT'
: Received: by ytkopc03 with Microsoft Mail
: id <01BC4347.AA64C100@ytkopc03>; Mon, 7 Apr 1997 11:34:34 +-200
: Message-ID: <01BC4347.AA64C100@ytkopc03>
: From: =?iso-8859-1?Q?Maria_Sj=F6holm?= <maria@ytko.nl>
: To: "'Magnus Holmberg'" <pucko@lysator.liu.se>
: Subject: =?iso-8859-1?Q?RE=3A_Trevligt_att_h=F6ra_att_du_lever=21?=
: Date: Mon, 7 Apr 1997 11:34:32 +-200
: MIME-Version: 1.0
: Content-Type: text/plain; charset="iso-8859-1"
: Content-Transfer-Encoding: 8bit
: X-MIME-Autoconverted: from quoted-printable to 8bit by
: lysander.lysator.liu.se id MAA23195
: Status: RO
: X-Status:
: I would be very glad if someone can tell me how to make a script that
: removes all those heads from som files.
while (<>) { last if /^$/ } # skip to first blank line
while (<>) { print } # print everything after the first blank line
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Tue, 08 Apr 1997 23:21:25 -0600
From: woutlet@worldnet.att.net
Subject: Affordable Web Hosting Solutions
Message-Id: <860559522.32702@dejanews.com>
Wolrd Outlet Inc. (http://www.worldoutlet.com)
$39.95 per month. Quality Web Hosting for Your Business:
www.your_company.com (see http://www.wolrdoutlet.com)
It is now easier to set your company apart from the rest with your own
domain name. For $39.95 per month and a one time setup fee of $99.00*,
your account will have full email capabilities (you@your_company.com)
and a URL such as "www.your_company.com", as well as all of the
following:
- FREE SUBMISSIONS TO TOP 150 SEARCH ENGINES AND DIRECTORIES
- Domain name registration provided (www.your_company.com)
- Unlimited Email accounts included (you@your_company.com)
- Unlimited e-mail traffic
- 24 hour unlimited updates via your own FTP/TELNET account
- Secure user accounts for the customer to perform content updates
- 500 MB of data transfer per month
- 20 MB of disk space for your html documents & graphics
- Detailed Web usage statistics & access to raw log files
- T1 line to the Internet used exclusively for Web site hosting
- Physically secure facility
- 7x24 Operation with full tape backup capability
- Assisted custom CGI script support
- Support for FrontPage, Perl, Java, and ActiveX
- Video support - AVI, MPEG, QuickTime, SGI and Microsoft Video
- Audio support - WAV and AIFF Audio (RealAudio available)
- Hosted on Sun Microsystems Ultra Servers
All of these for only $39.95 per month!
* THERE IS NO FEE FOR TRANSFERRING AN EXISTING DOMAIN NAME
ADDITIONAL SERVICES:
* Webmaster Service (unlimited/changes & programming)
* Directory Listing Service (search engines & directories)
* Web Site Design & Development
* CGI & Java Programming
* Custom Graphics & Scanning
* Full Commerce Solution
- Shopping Cart Technology
- Process credit cards and payments in real-time
- Control on-line inventory in real-time
- Remotely Access and update product databases
* Server Solutions (co-location)
- your own server located at our facility
- the perfect solution for resellers
- we can custom build hardware at tremendous savings
* Direct Internet Connections (56K to T-1 Frame Relay)
To see more visit our web site at:
http://www.worldoutlet.com
or call: 212-370-0404
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Tue, 08 Apr 1997 22:51:42 -0600
From: jhardy@cins.com
Subject: Re: Can It Be Done
Message-Id: <860557210.31131@dejanews.com>
In article <5a3ci5.rq.ln@localhost>,
tadmc@flash.net (Tad McClellan) wrote:
>
>
> [ please follow normal Usenet custom and limit your line lengths to
> 70-72 characters. Else they get hard to read after being quoted a few
> times
> ]
Well Im having problems with WINVN I'll have to fix that
>
> jhardy@cins.com wrote:
>
> : Come on guy's, give me a break! I know one of you Guru's know how to do this
> : and I just can't figure it out.
>
> This is very simple thing. The exalted status of guru is most
> certainly not required.
Hmmm....
>
> As I am only a lowly Intermediate type perl programmer, I hope you
> don't intend to exclude me from answering your question...
>
> If you _did_ intend to exclude me, it didn't work ;-)
>
> : I have a flat file database whcih looks like this;
>
> : Item Description Price
>
> : Monitor MegaImage $375.00
> : Monitor Toshiba $800.00
> : CPU 486 $100.00
> : CPU 486 OD 100 MHZ $235.00
> : Motherboards MB $25.00
> : Motherboards MN2 $100.00
>
> : So far I can get the script to read the file and print out the database in a
table.
> : Being a newbie to Perl I finally figured that out. Now instead of printing
it to a
> : table I want to read it in like below
>
> : #!/usr/bin/perl
>
> Hey! You are a newbie to perl and you don't want perl to help
> you debug your scripts?
>
> perl will help you if you ask it to:
>
> #!/usr/bin/perl -w
> # ^^ ALWAYS enable compiler warnings...
>
I do use -w (normally ?)
>
> : # Name: quoteSYS.pl
> : # Version: 1.0
> : # Last Modified: 04-03-97
>
> : $tax1_label ="7% GST - 8% PST";
> : $tax2_label = "7% GST";
> : $tax_rate1 = .08;
> : $tax_rate2 = .07;
> : $database = "./Data_files/crise.data";
>
> : $| = 1;
> :
> : open(DATABASE, "$database") || die "Content-type:
> : text/html\n\nCannot open database!";
> : @database = <DATABASE>;
> : close(DATABASE);
>
>
> Ask it here. Get the answer here.
>
> -----------------
> #! /usr/bin/perl -w
>
> @database = <DATA>;
>
> # read perlfunc and perlre man pages, then just do this:
>
> @cpu = grep /^CPU/, @database;
> @monitor = grep /^Monitor/, @database;
> @motherboard = grep /^Motherboards/, @database;
>
> print "CPUs:\n";
> foreach (@cpu) { # do something with each CPU line...
> print;
> }
> print "\n";
>
> print "Monitors:\n";
> foreach (@monitor) { # each Monitor line...
> print;
> }
> print "\n";
>
> print "Motherboards:\n";
> foreach (@motherboard) { # each Motherboard line...
> print;
> }
> print "\n";
>
> __DATA__
> Monitor MegaImage $375.00
> Monitor Toshiba $800.00
> CPU 486 $100.00
> CPU 486 OD 100 MHZ $235.00
> Motherboards MB $25.00
> Motherboards MN2 $100.00
> -----------------
I already figured this out but it will not work. What I need is to be
able to simply go to my DB admin script and enter new items i.e. "Memory"
The script will then search the database and find that I have entered a
NEW ITEM called Memory read it into the variable with the rest of the
items in the database and send it out to the form so the user can select
it.
If I use this in the script
@cpu = grep /^CPU/, @database;
> @monitor = grep /^Monitor/, @database;
> @motherboard = grep /^Motherboards/, @database;
then everytime I add a new item to the database I will have to also enter
it in the script.
@memory = grep /^CPU, @database;
In other words as soon as the script is called it will be its job to
search the database find all the ITEMS in the first columb of the
database (Items) sort them in proper ordered groups and send them to the
form in order of Monitors Motherboards, CPU , Memory or whatever
(including the description & price for each). If I could figure out how
to get the script to do this I know how to send it to the form in a
select box and I also know how to send it back to the script and parse
and calculate the information to be sent back to the browser. But I can't
figure out the most important part.
Not so easy any more is it?
by the way, you sound like my wife when I forget to do something
nag nag nag nag nag :)
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 9 Apr 1997 02:31:01 GMT
From: jhardy@cins.com (John Hardy)
Subject: Re: Can It Be Done
Message-Id: <5iev15$82v$1@news>
In article <5icis4$646$1@news3.microserve.net>, soccer@microserve.net says...
>
>Good luck! This is much too hard to describe in a quick note. You
>are asking for a complete process. Getting and putting data on the
>web takes a book. For your purposes I think you will find the
>following book very usefull:
> Teach Yourself CGI Programming with Perl in a week
> By Eric Herrmann
>
>jhardy@cins.com wrote:
>
>
>>Come on guy's, give me a break! I know one of you Guru's know how to do this
>>and I just can't figure it out.
>
>
Well someone suggested something like this ;
open(DATABASE,$database);
while(<DATABASE>) {
# line is in $_
chomp; # remove newline, if any
@field = split(/\t/); # array of three columns [0..2)
push @{$array{lc($field[0])}},$field[1];
foreach $key (keys(%array)) {
@dropdown = @{$array{$key}};
# ....
}
but the push@{$array - seems to be creating a syntax problem ?
------------------------------
Date: 08 Apr 1997 18:31:36 -0600
From: Joe Orth <joeo@hpfcjoe.fc.hp.com>
Subject: Re: Error when using Accept
Message-Id: <yb6iv1xvxxz.fsf@hpfcjoe.fc.hp.com>
I think that I answered my own question, but I'm not sure I like the
answer.
I also had an ALM signal handler running in my script. Whenever the
alarm would go off (I can duplicated it using kill -14 <pid>), the
accept would die with the error message that was in my previous post
Is this the expected behavior? I admit that I don't know a whole lot
about sockets, so I am not sure.
Thanks for taking the time to look at this.
-- Joe Orth
------------------------------
Date: Wed, 9 Apr 1997 18:18:36 +0500
From: akench@cvimail.cv.com
Subject: File handles in Perl...(akench@cvimail.cv.com)
Message-Id: <199704091318.SAA18459@bandar.CV.COM>
Hi Perl Gurus,
I am facing the following problem due to use
of same file handle-
#! /public/cvi-tools/bin/perl -w
open(FILE,">/tmp/a");
$result = &test();
print FILE "File /tmp/b contains $result";
sub test {
open(FILE,"/tmp/b");
$res= <FILE>;
close FILE;
$res;
}
perl gives:
print on closed filehandle main::FILE at t77 line 7
I have lot of file and about 50+subroutines and
the file handles may be have the same names too.
Is there a way so that a file handle is local to
a subroutine? Something paralle to : my $myvariable
Or any easy solution other than changing all the
filehandle names in all the files?
thanks and regards,
-Atul
(akench@cvimail.cv.com)
------------------------------
Date: Wed, 09 Apr 1997 08:09:05 +0200
From: Magnus Holmberg <pucko@lysator.liu.se>
Subject: Head of mail....
Message-Id: <334B3281.2E63@lysator.liu.se>
I like so sort the Subject, From,Date, .... Field of a mail-file and
store those in to variabels $dubject, $from, .....
This work, but I have a feelin that this is not so clever.
Can someone tell me how to do this i a better way???
======================
open(IS, $file);
@EMAIL=<IS>;
close(IS);
foreach $line (@EMAIL)
{
($name, $value) = split(/:/, $line);
$LIST{$name}=$value;
}
subject=$LIST{'Subject'};
chomp($subject);
$from=$LIST{'From'};
chomp($from);
$to=$LIST{'To'};
chomp($to);
$date=$LIST{'Date'};
chomp($date);
------------------------------
Date: Wed, 09 Apr 1997 03:25:42 GMT
From: mark@ntr.net (Mark Mills)
Subject: Re: Holy Wars! (was: Perl vs C++, Unix vx MS, etc)
Message-Id: <334b0b30.2082233@news.ntr.net>
On 8 Apr 1997 18:52:05 GMT, scott@lighthouse.softbase.com () wrote:
>Jason C Austin (jason@quake.cs.odu.edu) wrote:
>
>: Why argue and block out all the real questions?
>
>4. The Voice Of Reason is just more noise on the Internet, because
>every Joe AOL-Disk thinks he is the first person to think Bill Gates is
>the Antichrist, UNIX is hard to use, emacs is better than vi, etc etc
>etc. If there wasn't so much turnover, these flame wars wouldn't keep
>happening. You rarely see repeat trollers.
>
>Scott
>
There is a quote (from who I have no idea but...) about this.
If there are twelve clowns in the center ring, you can walk amongst
the clowns and begin reciting the purest Shakespear but to the
audience you are just the thirteenth clown.
The point originally concerned politics but it seems equally
appropriate here.
(No offense to the 'participants' or anything :> ok?)
--
Mark <mark@ntr.net>
Please don't sue my boss because you don't
understand the concept of free speech.
------------------------------
Date: Wed, 09 Apr 1997 03:29:07 GMT
From: mark@ntr.net (Mark Mills)
Subject: Re: No GUI environment for Perl?
Message-Id: <334c0caa.2460566@news.ntr.net>
On 8 Apr 1997 18:59:04 GMT, scott@lighthouse.softbase.com () wrote:
>Luca Passani (lpa@sysdeco.no) wrote:
>: If Perl was delivered with a nice GUI interface (both on Unix and PCs),
>: it would gain much more appeal to the novices which are scared by a
>: learning curve they will have to climb anyway.
>An IDE-like environment would only help hardcore perl hackers be
>more productive.
Unless there was *NO* way to turn off -w, :>
Then it would help a little.
--
Mark <mark@ntr.net>
Please don't sue my boss because you don't
understand the concept of free speech.
------------------------------
Date: Tue, 08 Apr 1997 23:42:10 -0700
From: "$Bill Luebkert" <dbe@wgn.net>
To: David Tucker <david@temss2.main.temple.edu>
Subject: Re: Pattern matching (Regexp)
Message-Id: <334B3A42.4F7A@wgn.net>
David Tucker wrote:
>
> I am a definite Perl newbie so let me first preface
> this question by apologizing for what may seem to be
> a simplistic question.
>
> I am trying to weed out bad dates in a perl subroutine.
> So I am using the following code
>
> # A date in the form MM/DD/YY where @_ holds the date
^^
> if ( ! /[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]/ ) { die "blah...";}
This works on $_ not @_ .
Therefore this should work:
$_ = $_[0];
if ( ! /[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]/ ) { die "blah...";}
or to iterate through @_
foreach (@_) {
if ( ! /[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]/ ) { die "blah...";}
}
> It does not work at all.
>
> Could someone tell me what I am doing wrong?
CC: David Tucker <david@temss2.main.temple.edu>
--
,-/- __ _ _ $Bill Luebkert
(_/ / ) // // DBE Collectibles
/ ) /--< o // // http://www.wgn.net/~dbe/
-/-' /___/_<_</_</_ Email: dbe@wgn.net
------------------------------
Date: Wed, 09 Apr 1997 04:14:59 GMT
From: mark@ntr.net (Mark Mills)
Subject: Re: Perl / Forms and Post
Message-Id: <334d16d9.5068080@news.ntr.net>
On Tue, 08 Apr 1997 11:31:35 +0100, Patrick
<Patrick.Reilly@netcel.co.uk> wrote:
>I would like to get a perl program to pretend to be a form!
>
>But, I DON'T want the perl program to produce a form that a user can
>fill in. I need to get the perl program to send the info. to the form
>handler.
>
>using GET I can do the following...
>
>print "Location: http://www.my.site.com/Perl/formhandle.pl?n=55\n\n";
>
>but how the dickens do I get a POST to work?
>I've tried :_
>
>print "Location: http://www.my.site.com/Perl/formhandle.pl\n\n";
>print "n=55";
>
>and
>
>print "Location: http://www.my.site.com/Perl/formhandle.pl\nn=55\n\n";
>
>Help??
You are sending a header to their browser that tells it to go
somewhere. POST requires the *BROWSER* to send it data. No browser
will take POST data and send it back out. Ain't gonna happen.
Sorry.
P.S. perl wasn't your problem, why not ask for help in a CGI group
next time?
--
Mark <mark@ntr.net>
Please don't sue my boss because you don't
understand the concept of free speech.
------------------------------
Date: 9 Apr 1997 05:07:11 GMT
From: lpoon@Glue.umd.edu (Leon Poon)
Subject: Problem with setuid script in Solaris
Message-Id: <5if85v$tv9$1@hecate.umd.edu>
Hi,
I am trying to run a perl script that is setuid root, but I get the
error "Can't open /dev/fd/3". I am using perl 5.003 (with Embed) on
Solaris 2.5.1. I also tried Larry Wall's C-wrapper program (i.e. setuid
the C program which calls the non-setuid perl script), but that also
didn't work. I initially thought it was a perl problem, then I found out
that setuid csh script doesn't work either. After some research, I found
that setuid ksh script works. I don't really want to rewrite the script
in ksh, so is there any workaround using perl? Any help would be greatly
appreciated. Please cc your reply to lpoon@isr.umd.edu. Thanks.
Leon Poon
------------------------------
Date: Wed, 09 Apr 1997 02:33:45 +0000
From: Rey Andrada <reya@wni.com>
Subject: question from a newbie (perl and password)
Message-Id: <334B0009.2AE9@wni.com>
Hi All,
Yes I am trying to learn how to write perl script and my problem is
that on a Sun platform that I am working on when using ssh I am ask to
give my password. According to our system admin I should be able to
program in perl and this rpogram should be able to supply the password
to ssh. of course I dont want my password to be hard coded into my
script, is this possible ?
Please e-mail me directly.
thanks,
Rey
------------------------------
Date: Tue, 08 Apr 1997 20:36:00 -0400
From: Andrew Brigham <abrigham@mail.foxnet.net>
Subject: Radius, a perl for your thoughts
Message-Id: <334AE470.63EE@mail.foxnet.net>
Got a problem parsing radius logs... script below
I want output like
Username
Date Time On Logins
Mar 15 65643 2
Mar 16 128434 5
Mar 17 43874 2
in other words total per day....
does anybody have nice simple code...???
I have something started for my totals below... its somewhat ugly but it
works..
big thanks to anyone who can help...
____________________________________________________
$/ = '';
while (<FILE>) {
next if /Acct-Session-Id = "00000000"/;
if (/Acct-Status-Type = Stop/) {
if (/Acct-Session-Id = "([^"]+)"/) {
$id = $1;
if (/NAS-IP-Address = (\S+)/ ||
/Client-Id = (\S+)/) {
$nas = $1;
$id .= '@'.$nas;
if ($seen{$id}++) {
$dup++;
next;
}
}
} else {
$err{'No ID'}++;
next;
}
# Get the Username and elapsed time (in seconds) and add 1 for
logins
if (/User-Name = "([^"]+)"/) {
$user = $1;
if (/Acct-Session-Time = (\d+)/) {
$elapsed = $1;
if ($elapsed > 0) {
$uses{$user}++;
$used{$user} += $elapsed;
}
}
}
}
}
print "# $dup duplicates\n" if $dup;
print "# $err{'No ID'} stop records without Acct-Session-ID\n" if
$err{'No Id'};
# print usage by user
foreach $user (keys %udate) {
printf
DATA"%s;%s;%s\n",$user,$udate{$user},&hms($used{$user}),$uses{$user};
}
___________________________________________________
Andrew Brigham
abrigham@foxnet.net
------------------------------
Date: Tue, 8 Apr 1997 21:31:31 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Radius, a perl for your thoughts
Message-Id: <32vei5.oql.ln@localhost>
Andrew Brigham (abrigham@mail.foxnet.net) wrote:
: Got a problem parsing radius logs... script below
^^^^^^^^^^^
If you would provide a sample of your input data, then there
would be hundreds of times more people eligible to help you with
your problem.
As it is, anyone who does not already know what a 'radius log'
is will stop reading your message after the first line...
: I want output like
: Username
: Date Time On Logins
: Mar 15 65643 2
: Mar 16 128434 5
: Mar 17 43874 2
: in other words total per day....
: does anybody have nice simple code...???
: I have something started for my totals below... its somewhat ugly but it
: works..
: big thanks to anyone who can help...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 09 Apr 1997 08:42:28 +0200
From: sperber@informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor])
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <y9l208k1yuj.fsf@modas.informatik.uni-tuebingen.de>
>>>>> "Smiljan" =3D=3D Smiljan Grmek <Smi@4mate.hr> writes:
Smiljan> Is it possible that languages with bumps and rough surfaces are so=
mehow
Smiljan> easier to remember and decode when reading than quicksilver smooth
Smiljan> theoretical ones? Is it perhaps easier to interpret an ad-hoc cons=
truct
Smiljan> than to reconstruct semantics from first principles?
No.
Anyone who has to read and write production code in Perl or Tcl or C++
within the same period as, say, Scheme, can testify to that.
--
Cheers =3D8-} Mike
Friede, V=F6lkerverst=E4ndigung und =FCberhaupt blabla
------------------------------
Date: 08 Apr 1997 22:48:44 -0400
From: peterb@Cyber-Wizard.Com (Peter L. Berghold)
Subject: Re: Simple array question by newbie...
Message-Id: <86ybaskj1v.fsf@rowboat.i-have-a-misconfigured-system-so-shoot-me>
I'd have written the sub as follows:
sub getNxtMonth {
local ($thisMonth)=@_;
local ($ptr);
for($ptr=0;$ptr<=$#months-1;$ptr++){
if ( $thisMonth eq $months[$ptr] ) {
return $months[$ptr+1];
}
}
}
I left out some error checking, but you get the idea....
--
PGP Fingerprint = D6 74 56 8E FB 52 4E DD 5C 3F 32 FE AE 1F 1C D0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Peter L. Berghold -- Unix Hacker at Large %%
%% TCG -- MIS Department PHONE: (908) 392-2722 %%
%% berghold@tcg.com (work Email) peterb@cyber-wizard.com (play Email)%%
%% "Those who fail to learn from history are condemned to repeat it" %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
------------------------------
Date: Wed, 09 Apr 1997 02:12:33 GMT
From: tgy@chocobo.org (Tim Gim Yee)
Subject: Re: Substitution Question
Message-Id: <334af82d.30356530@news.seanet.com>
On Tue, 08 Apr 1997 16:16:36 -0400, Thomas Parker <thpr@vnet.ibm.com>
wrote:
>If I have:
>
>$temp_item = "A+B";
>$master_item = "((A+B)/C)+((A+B)-D)";
>
>how do I get $master_item to be:
>
>((E)/C)+((E)-D)
>
>I have tried:
>
>$master_item =~ s/$temp_item/E/g;
>
>But this fails because $temp_item contains a "+" which seems to be
>evaluated as a regular expression.
>From perlre man pages...
\Q quote regexp metacharacters till \E
$master_item =~ s/\Q$temp_item/E/g;
heh... also quotes regexp metacharacters till /E :)
-- Tim Gim Yee tgy@chocobo.org
http://www.dragonfire.net/~tgy/moogle.html
"Will hack perl for a moogle stuffy, kupo!"
------------------------------
Date: Tue, 08 Apr 1997 20:21:32 -0600
From: gt_bradley@online.disney.com
Subject: Turning off: SO_LINGER?
Message-Id: <860548190.24856@dejanews.com>
I'm trying to develop a test tool (in perl) which simulates a web browser.
(it will be used for load testing some servers). I have found that It
seems to be able to run many times faster than observed real traffic to
our servers. Analysing the TCP/IP packets showed that the netscape
browsers closed the HTTP-transactions with a hard-close. e.g. they sent a
packet with the RST bit set instead of the three-way FIN, FIN-ACK, ACK
handshake which occurs when my perl script closes the sockey normally via
the close() call.
I have tried to set SO_LINGER off in hopes that it would cause the close
to perform as seen from netscape.
This is the code I use to set linger to off. Other than the close
sequence, every thing else works fine.
This code is after the socket is created, but before the bind.
#####
$linger = pack("II", 0, 0 ); # linger is a C struct in socket.h
$linger2 = getsockopt( S, &SOL_SOCKET, &SO_LINGER);
print " old linger2 = ", unpack("II", $linger2);
setsockopt( S, &SOL_SOCKET, &SO_LINGER, $linger) || &Die("couldn't set
to non-linger");
$linger2 = getsockopt( S, &SOL_SOCKET, &SO_LINGER);
print " new linger = ", unpack("II", $linger2), " \n";
####
Any clues???
Thanks,
gt_bradley@online.disney.com
-- opinions are my own, no one elses....
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Tue, 08 Apr 1997 23:21:13 -0700
From: anthony@outshine.com (Anthony Boyd)
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <anthony-0804972321130001@anthony.outshine.com>
"Tim Behrendsen" <tim@a-sis.com> wrote:
> Peter Seebach <seebs@solutions.solon.com> wrote:
> > Tim Behrendsen <tim@a-sis.com> wrote:
> > >Good programmers program for 1) Fun, and 2) Money, and the latter
> > >inevitably produces better quality over the long haul (obviously
> > >there can be momentary "blips" here and there).
> >
> > This is an assertion you have made frequently, but it contradicts the best
> > information we have about himan motivation.
>
> I would say it's perfectly in line with the information we have
> about human motivation. It's why Capitalism succeeds where Socialism
> fails. If humans were more motivated by abstractions such as "wanting
> to do a good job", Socialism would succeed.
>
> But I don't even need to go there. Name one freely available
> *significant* product that is *clearly* better than *any* commercial
> product, regardless of price.
Tim, are you *trying* to prove Peter's point? Good free product is
everywhere, in such abundance that I can't believe you'd think it's not.
GifBuilder is free and the best GIF animator I've used. Perl is free and
boy, is it handy. Linux is free and thousands of corporations & SOHOs use
it. Apache is free and is the world's most popular and (IMHO) most
reliable Web server. MT NewsWatcher is free, and I'm using it to post
this instead of my (paid in full) copy of Netscape. Internet Explorer is
100% free, and while I HATE the Windows version, the Macintosh version is
clearly done by people who LOVE what they do. JPEGView on the Mac is free
and displays JPEGs with better color quality than any other program I
own. Programmer's File Editor on Windows 95 is a free text editor that is
syntax-aware, offers line-numbering, etc. Great product.
After all this, I think Peter has a point. Vision and passion makes great
software -- corporate dollars makes good software.
-Anthony Boyd
------------------------------
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 259
*************************************