[8683] in Perl-Users-Digest
Perl-Users Digest, Issue: 2300 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 11 17:07:13 1998
Date: Sat, 11 Apr 98 14:00:24 -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 Sat, 11 Apr 1998 Volume: 8 Number: 2300
Today's topics:
Re: an interesting problem <phil@math.univ-tlse1.fr>
Re: Bill Gates should be invited to O'Reilly's "Free So (Nathan V. Patwardhan)
Re: Bill Gates should be invited to O'Reilly's "Free So (Tim Smith)
Re: Bill Gates should be invited to O'Reilly's "Free So <amr@nospam.miyako.japanologie.kultur.uni-tuebingen.de>
environnemt variables Francois-Xavier.bor@bde.espci.fr
Re: Excessive (?) Memory Usage with Large Database (M.J.T. Guy)
Re: fork and forget <smubit1@gl.umbc.edu>
Re: General Rudeness, e.g. Re: Need a web login script (I R A Aggie)
Re: How to get only 2 decimal notation? <smubit1@gl.umbc.edu>
Re: HTTP server written in perl? (Mark-Jason Dominus)
Re: Info Regarding Perl 5.005 (I R A Aggie)
Re: Is it just me? (error/bug? with "my") -- Interesti (M.J.T. Guy)
MacPerl Book Online in HTML (Chris Nandor)
making second option available? <troll@net-link.net>
Re: Numeric validation (Andre L.)
Re: Perl Puzzle: How Many Contexts? (Mark-Jason Dominus)
Re: Perl Puzzle: How Many Contexts? (Ilya Zakharevich)
Re: Q: Form CGI script and sender's e-mail address (Mark-Jason Dominus)
Q: I need to delete temp files after 24 hours... (Drake Cleary)
Re: RMS should be invited to O'Reilly's "Free Software (Tim Smith)
Re: scanf substitute in perl <smubit1@gl.umbc.edu>
Re: sort and uniq in Perl (sdm)
Test (mikep)
Re: unique string/integer from string variable? md5? otis@POPULUS.net
Re: Week of Month (Robert F. Harrison)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Apr 1998 13:48:00 -0700
From: Phil Ehrens <phil@math.univ-tlse1.fr>
Subject: Re: an interesting problem
Message-Id: <352FCC49.5C9CEA72@math.univ-tlse1.fr>
Thank you all for the help!
Shawn Gordon was the first to send me a fix, but I do thank the others
also.
My problem is solved. Thanks again.
Phil
------------------------------
Date: 11 Apr 1998 15:41:15 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <6go2ur$2p5@fridge.shore.net>
Ben Bullock (ben@hayamasa.demon.co.uk) wrote:
: I should say that the perl FAQ does not meet several free software
: criteria.
And what are these criteria?
: Development of some linux free docs such as the Network guide
: apparently died off after the O'Reilly version came out.
Prove it.
: [[The Network guide missed slightly the free software criteria
: in that it was not modifiable as far as I know.]]
And what are these criteria?
: I think that the Matt Welsh book was based on a free document
: and then died off after that as well.
You think. I think. We all think. Quit sitting on your dogmatic
fence and give me some genuine details. Prove it.
: I know that one book `Understanding Japanese Information Processing'
: killed off a free version. As far as I remember (and I could
: be wrong) I think the author tried asking people to actually
: remove the free version from ftp sites after the O'Reilly book
: came out.
You think. I think. We all think. Quit sitting on your dogmatic
fence and give me some genuine details. Prove it. Show us some email
from the author. Show us some FBI surveillance tape. Show us some
factual email from the injured parties.
: In some cases the free version might have been just a half-written
: book that the author wanted to get debugged and then turn proprietory,
: such as the Tcl/Tk book by Ousterhout (no, it's not an O'Reilly book)
: instead of an actual free project, but in my opinion that's just
: as bad.
Well, you know Ben. It's great that you're sharing your opinions with
this NG, but what you're sharing *is* your opinion. I wouldn't want
people to take it for fact since you start out every sentence with "I
think" or conclude with "in my opinion". I've been reading your
postings for several days and am yet to find anything that's a solid,
factual argument that proves (or even strongly suggests that) that ORA
or any other publisher (or even Microsoft!) has destroyed free
software or are damaging its existence.
I may not always agree with RMS, but at least I'm willing to concede
that he's right about many things. His opinions, although radical at
times, are logical and detailed. As for you, I cannot say the same.
--
Nathan V. Patwardhan
please don't send spam to president@whitehouse.gov
------------------------------
Date: 11 Apr 1998 11:18:12 -0700
From: tzs@halcyon.com (Tim Smith)
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <6goc54$liv$1@halcyon.com>
Joseph Buck <jbuck@best.com> wrote:
>>Linux had a year or so head start on FreeBSD and the derivatives, that
>>makes a big difference too.
>
>If anything, free BSD (not FreeBSD, which came later) was once well ahead
>of Linux. Almost a complete system was available when Linus was still
>doing early hacking and there was no Linux distribution.
>
>The ugly infighting in the early days of free BSD (the Jolitzes vs
>everybody else) and the splits that resulted dissipated energy, and the
>lawsuit threat from AT&T put much of the code in question for a while.
Another important, factor, I think, was attitude. For a large part (and
there are notable exceptions on both sides), the BSD's seemed to have been
mostly developed by Unix developers who wanted a free Unix for PC's,
whereas Linux seems to have attracted a larger number of people (including
developers) who have a PC background and are getting their first Unix
exposure via Linux.
Because of this, Linux has been much more concerned with getting along with
other PC operating systems. The BSD's have been much less concerned about
this. For example, for quite a long time, Linux could read and write
extended DOS partitions and the BSD's could not. I believe the BSD's
finally added support for that. Linux also deals with VFAT and FAT32 with
ease. I think that on the BSD's, such support is still at alpha level.
Also, this difference in user/developer base lead to rather different
hardware support. The BSD's took forever to get good IDE CD-ROM support,
because anyone with any sense would run SCSI on their system, of course.
People who would buy a $100 IDE CD-ROM rather than a $200 SCSI CD-ROM
because $100 < $200 were not the kind of people the BSD developers cared
about. On the Linux side, many of those kind of people were Linux
developers, and so Linux got IDE CD-ROM support much sooner, and it worked
much better. The same goes for much of the other hardware that is common
on PC's but uncommon on Unix.
The consequence of this is that if you are a newbie to Unix, Linux is a
hell of a lot nicer to try to dual boot on your Windows machine than the
BSD's are.
--Tim Smith
------------------------------
Date: Sat, 11 Apr 1998 21:44:55 +0200
From: Riechert <amr@nospam.miyako.japanologie.kultur.uni-tuebingen.de>
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <352FC835.810@nospam.miyako.japanologie.kultur.uni-tuebingen.de>
Ben Bullock wrote:
> [snip]
> I know that one book `Understanding Japanese Information Processing'
> killed off a free version. As far as I remember (and I could
> be wrong) I think the author tried asking people to actually
> remove the free version from ftp sites after the O'Reilly book
> came out.
> [snip]
I wonder what the name of the free Version was. If we don't know
the name we can't find out what happened.
(Believe me, I am very interested in the history of Japanese
Information Processing, and so quit happy to add new information
to my files)
But at the moment I don't know what "free Version" you mean.
(1) "Japanese Information Processing" was published 1993 by O'Reilly.
(2) The last Version (1.2) of "JAPAN.INF" came out in 1992.
(3) "JAPAN.INF" is dead!...but "CJK.INF" was born (1995).
(CJK= Chinese, Japanese, Korean)
(all the same author)
Could it be that the author asked people to remove JAPAN.INF
because CJK.INF succeeded JAP.INF?
Just a guess, because I don't have the information you seem to
have.
Please excuse my bad usage of the English language.
Andreas Marcel Riechert
------------------------------
Date: Sun, 12 Apr 1998 03:50:26 GMT
From: Francois-Xavier.bor@bde.espci.fr
Subject: environnemt variables
Message-Id: <6goe0s$9av$1@pinot.ext.jussieu.fr>
hi !
i would like to call a perl script each time someone looks my webpage
(in order the perl script get the IP adress of everyone; that way , i
would be able to write a hitcounter script ). my problem is not so
much the perl script (Randal Schwartz give its own on line if i need
help) but what should i put in my html page to call the perl script. I
am looking something like <Applet> but for perl instead for java.
------------------------------
Date: 11 Apr 1998 16:40:02 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Excessive (?) Memory Usage with Large Database
Message-Id: <6go6d2$ac7$1@lyra.csx.cam.ac.uk>
Tad Thurston <thurston@balrog.nssl.noaa.gov> wrote:
>I am reading a geographic (DEM) database of approximately 1.4 million points,
>(1200x1200) where the points are three-digit numbers, and I noticed that the
>program is taking 69MB of memory to run. This seems excessive, and
>I am wondering if my code is horribly inefficient. I can't think of
>why it would use this much memory, but possibly one of you can help.
Each perl scalar value can be either a string or a number, and can
have various "magic" properties. So the basic data structure does need
to be quite big.
>The main loop of the read routine is
>
>for ($current_line = 1; $current_line <= $num_lines; $current_line++)
>{
> chomp($current_line_check = (<DEM>));
> print "Error reading DEM file\n" if ($current_line_check !=
> $current_line);
> chomp($num_elevations = (<DEM>));
> chomp($line_coord = (<DEM>));
> ($line_lon, $line_lat) = split(' ', $line_coord);
>
> for ($j = 0; $j < $num_elevations; $j++)
> {
> chomp($temp = (<DEM>));
> push(@el, $temp);
> }
>}
Make that
push(@el, 0+$temp);
so that your values are stored as numbers rather than strings. That'll
probably nearly halve the space needed. And it'll make the processing
faster, if you are doing arithmetic on the data.
You also might want to investigate PDL, which is designed for efficient
handling of data of this sort.
Mike Guy
------------------------------
Date: Sat, 11 Apr 1998 16:32:58 -0400
From: Stephen Mubita <smubit1@gl.umbc.edu>
Subject: Re: fork and forget
Message-Id: <Pine.SGI.3.96.980411162920.10506A-100000@jig.gl.umbc.edu>
On Thu, 9 Apr 1998, Joe Spinney wrote:
=> Hi,
=>
=> I'm trying to make a perl script fire-off another perl script, but not
=> wait for it to terminate. I've tried using:
=> system("script_name &");
=> exec("script_name");
=> open(SCRIPT, "| script_name"); close(SCRIPT);
=>
=> but no matter what, the parent waits for the child to fininsh. How do I
=> launch the other script and forget about it?
=>
Based on entry 'fork' on page 167 of the Camel,
if($pid = fork) {
go on with code
} elsif(defined $pid) {
exec 'newscript'
} else {
die "Can't fork !\n";
}
or did you mean something else ?
Stephen
--
Stephen Mubita "All Scripture is God-breathed and is useful for
smubit1@umbc.edu for teaching, training, rebuking, correcting and
training in righteousness, so that the man of God
may be thoroughly equipped for every good work."
2 Timothy 3 : 16 - 17
-----------------------------------------------------------------------
UCS is not responsible for any opinions contained here
------------------------------
Date: Sat, 11 Apr 1998 14:02:47 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: General Rudeness, e.g. Re: Need a web login script
Message-Id: <fl_aggie-1104981402480001@aggie.coaps.fsu.edu>
In article <352E9AAE.B4ADB0FD@88net.net>, sonny <sonny@88net.net> wrote:
+ BTW, there ain't
+ no whining here, just all these self proclaimed hall monitors are
getting a tad
+ irritating.
No offense, but bullshit. You _are_ whining. Or you'd just take your
own advice: ignore 'em.
Followups...
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Sat, 11 Apr 1998 16:54:21 -0400
From: Stephen Mubita <smubit1@gl.umbc.edu>
Subject: Re: How to get only 2 decimal notation?
Message-Id: <Pine.SGI.3.96.980411165011.10531C-100000@jig.gl.umbc.edu>
On 10 Apr 1998, Apisilp Trunganont wrote:
=> This is a very dummy question, but I don't know. I write this script.
=>
=> $value = (27/126)*100;
=> print $value;
=>
=> The output is 2.142857142857142705. But I want only 2.14. How to do this?
=>
=>
With no idea about it's efficiency (me's new meself),
$value =~ s/(\d+.\d{2}).+/\1/;
If there is a better way, I'm all ears.
--
Stephen Mubita "All Scripture is God-breathed and is useful for
smubit1@umbc.edu for teaching, training, rebuking, correcting and
training in righteousness, so that the man of God
may be thoroughly equipped for every good work."
2 Timothy 3 : 16 - 17
-----------------------------------------------------------------------
UCS is not responsible for any opinions contained here
------------------------------
Date: 11 Apr 1998 13:34:06 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: HTTP server written in perl?
Message-Id: <6go9ie$9is$1@monet.op.net>
In article <352E5D84.5AEC61C4@mail.mcoe.k12.ca.us>,
Mcoe NT <sirron@mail.mcoe.k12.ca.us> wrote:
>Has anyone seen a HTTP server written only in perl?
The Plexus httpd is written in Perl.
------------------------------
Date: Sat, 11 Apr 1998 13:58:13 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Info Regarding Perl 5.005
Message-Id: <fl_aggie-1104981358130001@aggie.coaps.fsu.edu>
In article <slrn6its9l.ibg.gabor@vnode.vmunix.com>, gabor@vmunix.com
(Gabor) wrote:
+ Hmm, that's not encouraging. I take it that upgrading to 5.005 isn't
+ something that most of us should do?
Is there a way of disabling threading and getting back that 30% performance
hit?
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: 11 Apr 1998 16:30:37 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Is it just me? (error/bug? with "my") -- Interesting Twist
Message-Id: <6go5rd$a3k$1@lyra.csx.cam.ac.uk>
In article <352E73DD.1F45@tfn.com>, Frank Cortez <cortez@tfn.com> wrote:
>When in the debugger, say I've "stepped" into a routine
>called 'Routine', resulting in my being on the first line
>of Routine, which reads:
>
>my ($var) = @_;
>
>Now, if I step past this line (say two lines, just to be
>sure it's executed), I *should* be able to see the value in
>$var using 'X var'-- shouldn't I?
No. "X" prints _package_ variables. Lexicals aren't package variables.
Use the "x" or "p" commands.
Mike Guy
------------------------------
Date: Sat, 11 Apr 1998 17:26:29 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: MacPerl Book Online in HTML
Message-Id: <pudge-1104981326170001@dynamic283.ply.adelphia.net>
The MacPerl: Power and Ease book, due out in May, is available online in
HTML from PTF, publishers of the book.
http://www.ptf.com/macperl/ptf_book/HTML/
Enjoy!
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6'])
#== New Book: MacPerl: Power and Ease ==#
#== Publishing Date: Early 1998. http://www.ptf.com/macperl/ ==#
------------------------------
Date: Sat, 11 Apr 1998 16:02:28 -0400
From: mike <troll@net-link.net>
Subject: making second option available?
Message-Id: <352FCC54.3C425FE@net-link.net>
when I try to exec "progname -option1($name) -option2($length)\n"; in a
script, the program only recognizes the first option. The second is
taken to be another command. Actually the first option is an
argument(filename) and the option sets file length.
I am very new to perl, about 3 days but believe me I have done some
reading.
If anyone can point me to the answer or suggest how I might get past
this?
------------------------------
Date: Sat, 11 Apr 1998 14:28:25 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Numeric validation
Message-Id: <alecler-1104981428250001@dialup-636.hip.cam.org>
In article <Er98II.AxH@presby.edu>, jtbell@presby.edu (Jon Bell) wrote:
> ppp-support <ppp-support@canelle.telecom.uqam.ca> wrote:
> >Because I dont understand the FAQ!! Thats why i post here.
> >Well, how do i use this stuff, if i want to check if the content of $num is
> >or not numeric. Call me stupid if you want, but i will still dont get it :-)
> >
> >The faq4 say...
> > warn "has nondigits" if /\D/;
> > warn "not a whole number" unless /^\d+$/;
> > warn "not an integer" unless /^-?\d+$/; # reject +3
> > warn "not an integer" unless /^[+-]?\d+$/;
> > warn "not a decimal number" unless /^-?\d+\.?\d*$/; # rejects .2
> > warn "not a decimal number" unless /^-?(?:\d+(?:\.\d*)?|\.\d+)$/;
> > warn "not a C float"
> > unless /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/;
>
> Each one of the "warn" lines is a Perl statement. Pick one that applies
> to your situation, copy it, and paste it into your script.
>
> --
> Jon Bell <jtbell@presby.edu>
I was wondering if using compiler warnings to check for the "numericity"
of a value might be an alternative solution. Let's say you do this (with
the -w switch of course):
$num = '345q67';
do { } if ($num == 999);
A compiler warning would be issued, saying "argument 345q67 isn't numeric
in eq."
Provided you don't care about the type of numeric in $num (whether it's an
integer, a float, etc.), is this usable outside of a debugging context?
A.L.
------------------------------
Date: 11 Apr 1998 13:11:05 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Perl Puzzle: How Many Contexts?
Message-Id: <6go879$994$1@monet.op.net>
In article <6go1l0$8df$1@lyra.csx.cam.ac.uk>,
M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
>I think you're asking the wrong question. 'context' merely refers to
>the environment in which a Perl expression is evaluated. So there are
>as many contexts as there are expressions within Perl programs.
I don't think I'm asking the wrong question. We speak of `context'
for a reason, and there is a reality there. Let's use `context' in
your more general sense of being the actual semantic surroundings of
an expression, and see where we can go from there.
In Perl (unlike in many languages) the context of an expression
affects the result of that expression. However, it may be true that
for two contexts C1 and C2, every expression has exactly the same
semantics in context C1 that it has in C2. In this case, we could say
that C1 and C2 were `equivalent contexts'.
A simple example: Using the most general definition of `context', the
following two lines show EXPR in different contexts:
@a = EXPR
@b = EXPR
However, every possible expression has the same semantic meaning in
both contexts, so we can say that the two contexts are equivalent.
If we define an equivalence relation on contexts such that two
contexts are equivalent if, and only if every semantically valid
expression is evaluated the same way in both of them, then I think
we'll find that contexts fall into a few very large equivalence
classes. These equivalence classes are important, and they're what we
usually mean when we say `context'. One of these equivalence classes,
the one containing `@a = EXPR', is called `list context'; another, the
one containing `$x = EXPR', is called `scalar context'.
These are not the only two equivalence classes, however. You might
think that $h{EXPR} was a `scalar context', but this isn't so, because
it would have to be equivalent to $x = EXPR in the sense that EXPR
would have to have the same semantics in both contexts for all
possible expressions, and, and, as Chris Nandor pointed out, it
doesn't; when EXPR has the form `a, b', it is evaluated differently in
these two contexts, so that $h{EXPR} is not equivalent to $x = EXPR.
It is these large equivalence classes that I am trying to enumerate.
>ii) Certain scalar contexts are distinguished as void, boolean,
> numeric or string contexts. But these are all special cases of
> scalar contexts.
Yes, and my list doesn't include `numeric' context; that is just a
figure of speech that we use to say that an operator converts its
operants to numbers before it operates on them. However, as of
version 5.004, the list *has* included a `void' context. It is now
possible to construct an expression that has different semantics in
each of
EXPR;
$s = EXPR;
An example of such an expression is &foo, if foo has been defined to
be the subroutine { defined(wantarray) ? $q=1 : ($q=0) }.
Under this definition, I count at least six contexts, and I'm sure
I'm missing some. The puzzle is to complete the list.
------------------------------
Date: 11 Apr 1998 18:03:19 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl Puzzle: How Many Contexts?
Message-Id: <6gob97$r8v$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Mark-Jason Dominus
<mjd@op.net>],
who wrote in article <6go879$994$1@monet.op.net>:
> If we define an equivalence relation on contexts such that two
> contexts are equivalent if, and only if every semantically valid
> expression is evaluated the same way in both of them, then I think
...
> >ii) Certain scalar contexts are distinguished as void, boolean,
> > numeric or string contexts. But these are all special cases of
> > scalar contexts.
>
> Yes, and my list doesn't include `numeric' context; that is just a
> figure of speech that we use to say that an operator converts its
> operants to numbers before it operates on them. However, as of
It is not a figure of speech. "Converting to a number" is not a
trivial operation, it may include an arbitrary function call via
overloading.
I do not think you *can* finish this list. The parser has too many
special cases, say, there is a $x[$b,$c] analogues to $x{$b,$c}.
However, it is (partially) disable in the parser, though yesterday we
saw that it is still working, in particular, $b and $c are calculated
in array context.
I'm planning to exploit these fine distinctions in the future variant
of overloaded-constants patch (current one may distinguish binary
(=octal/hex) constants, integers, floats, double-q chunks, simple-q
chunks, heres, re, RHS-of-s and parts of tr///) to simplify multidim
access.
All the above distinctions are not added by the patch, they are there
in the parser, patch just allowed different overloading of all the
kings men.
Ilya
------------------------------
Date: 11 Apr 1998 13:14:35 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Q: Form CGI script and sender's e-mail address
Message-Id: <6go8dr$9ap$1@monet.op.net>
In article <6gmd3r$2a0@news.3lefties.com>, Hitman <hitman@3lefties.com> wrote:
>How do I modify a part of the script (below) so that the sender's e-mail
>address will automatically be sent to me instead of
>Internet.User@43.Cyberhost.net?
>open (MAIL, "|$mailprog $youmail") || die "Can't open $mailprog!\n";
It depends on your mail program, and since you didn't say what that
is, we can't help you. Try reading the documentation for whatever
program is named in $mailprogram. Please don't ask here again, since
this is not a question that has anything to do with Perl.
------------------------------
Date: Sat, 11 Apr 1998 19:56:57 GMT
From: killbell@peterboro.net (Drake Cleary)
Subject: Q: I need to delete temp files after 24 hours...
Message-Id: <352fc9bc.15261175@news.peterboro.net>
How do i ask the question:
is $filename older than 24 hours?
Thanks.
------------------------------
Date: 11 Apr 1998 10:46:04 -0700
From: tzs@halcyon.com (Tim Smith)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <6goa8s$l30$1@halcyon.com>
In article <87zphsbncy.fsf@dsp.net>, Chris Waters <xtifr@dsp.net> wrote:
>That's a really bad analogy. PD and BSD/X licenses are like giving
>your code away to the world.
If I *give* you my car, I can no longer use it without your permission.
If I *share* my car with you, I still get to use it. If I put code in
the public domain or under a BSD or X license (or GPL it), I still get
to use it, so I think "share" is the correct word for all of these
licenses.
>The GPL is like sharing it with the world. People who don't like to
>share are most likely to complain about the GPL.
It is sharing it with that subset of the world that will agree to share
their code on similar terms. To use another birthday analogy, PD is
like giving someone a birthday present. GPL is like giving someone a
birthday present only if they promise to give you a present on your
birthday (but with a provision that if they give no birthday presents
to anyone else that year, they don't have to give you one).
>People who use BSD/X licenses are welcome to brag that they're more
>generous -- they are -- but for them to claim that people who only
>share are not being generous enough, when most people/companies don't
>*even* share their code, seems a little extreme.
I'm not saying GPL is not generous enough. I do think many people adopt it
without thinking enough about what they are actually trying to accomplish
by sharing their code. If someone thinks about it, and decides that the
restrictions GPL imposes fit in with what they want to accomplish, then
they should use GPL. There are circumstances under which I would release
new code under GPL.
>Especially since the *only* people who are really hurt by
>the GPL's requirement to share are people who don't want to share.
There are not hurt by GPL's requirements--they are simply not helped by
them. The only way GPL can actually hurt someone is if they choose to use
it without understanding the consequences, but that same danger is
applicable to any license.
With there now being at least five reasonable ways one could release free
software (public domain, GPL, MPL, BSD/X (I'll count these as one even
though many people find the differences significant), and Artistic), people
should really consider very carefully the license they use. They should
not automatically use GPL just because, say, they develop on Linux and most
of the stuff on Linux is GPL'ed, nor should they choose BSD just because
they happen to be using FreeBSD.
--Tim Smith
------------------------------
Date: Sat, 11 Apr 1998 16:00:54 -0400
From: Stephen Mubita <smubit1@gl.umbc.edu>
Subject: Re: scanf substitute in perl
Message-Id: <Pine.SGI.3.96.980411155929.10411B-100000@jig.gl.umbc.edu>
On 8 Apr 1998, Ali Mehdizadeh wrote:
=> Is there a direct substitue for C's scanf in perl?
=>
=> Let's say I want to read in the number from the following line:
=>
=> some text 123
=>
If this is wrong, someone can correct me :)
$line =~ m/(d+)/ and $num = $1;
--
Stephen Mubita "All Scripture is God-breathed and is useful for
smubit1@umbc.edu for teaching, training, rebuking, correcting and
training in righteousness, so that the man of God
may be thoroughly equipped for every good work."
2 Timothy 3 : 16 - 17
-----------------------------------------------------------------------
UCS is not responsible for any opinions contained here
------------------------------
Date: 11 Apr 1998 17:45:23 GMT
From: sdm@blue.seas.upenn.edu (sdm)
Subject: Re: sort and uniq in Perl
Message-Id: <6goa7j$gbf$1@netnews.upenn.edu>
Hui Tang (hui.tang@tus.ssi1.com) wrote:
: Hi, all,
: Is there any simple way to get the functions of shell commands "sort"
: and "uniq" in Perl?
hint for uniq: perl has autoincrementing hashes meaning you can add
keys to a hash on the condition that it wasn't there before. this
is how I do it. the details are up to you.
-steve
http://www.pobox.com/~sdm/
------------------------------
Date: 11 Apr 1998 16:54:19 GMT
From: mikep@rt66.com (mikep)
Subject: Test
Message-Id: <6go77r$fss$2@news.rt66.com>
This is a test
===========================
Mike Powell
mikep@rt66.com
http://www.rt66.com/~mikep/
------------------------------
Date: Sat, 11 Apr 1998 12:27:32 -0600
From: otis@POPULUS.net
To: cberry@cinenet.net (Craig Berry)
Subject: Re: unique string/integer from string variable? md5?
Message-Id: <6go964$4uh$1@nnrp1.dejanews.com>
Thanks, but that's not quite what I wanted :)
I know I can always do what you suggested, but I need to be able to do this:
- take a single URL
- convert it to some unique string/integer (and preferably be able to
convert it back to URL string if I want to, later)
the solution you provide ties a URL to an index in an array, but I can;t count
of having all the URLs I find it an array at all times. That would call for
one monster array...
Thanks,
Otis
In article <6gn80a$a3i$2@marina.cinenet.net>,
cberry@cinenet.net (Craig Berry) wrote:
>
> Otis Gospodnetic (otis@POPULUS.net) wrote:
> : Problem:
> : I have a variable that contains a string (the string is actually
a
> : URL). Is there an algorithm, or better yet, a module, that can
take
> : my string variable and 'convert' it to some shorter string or
> : integer?
> : Something that will be unique, so that no two URL strings end up
> : having the same value once I convert them to this shorter string
or
> : int.
>
> Assume urls (with possible duplicates) are in @urls:
>
> my $ix = 0;
> my %url2ix = ();
> my @ix2url = ();
>
> foreach my $url (@urls) {
> next if exists $url2ix{$url};
>
> $url2ix{$url} = $ix;
> $ix2url[$ix] = $url;
> $ix++;
> }
>
> This results in the hash %url2ix mapping from url strings to their
> numeric index, and the array @ix2url being a list of the unique urls,
> each at its appropriate index position.
>
> HTH!
>
> ---------------------------------------------------------------------
> | 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."
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 11 Apr 98 20:56:25 GMT
From: harrison@pixi.com (Robert F. Harrison)
Subject: Re: Week of Month
Message-Id: <slrn6ivm65.kr.harrison@localhost.localdomain>
On 11 Apr 98 06:02:07 GMT, Robert F. Harrison <harrison@pixi.com> wrote:
> On Fri, 10 Apr 1998, I R A Aggie <fl_aggie@thepentagon.com> wrote:
> > In article <slrn6is7f0.stg.harrison@localhost.localdomain>,
> > harrison@pixi.com wrote:
> It shouldn't really matter about Leap Years and such as we are only
> testing against Saturdays and stopping if we under that value. If not,
> we do the next week.
Just so to be clear, my program DOES NOT work check for the Julian to
Gregorian calendar switch, so it isn't accurate for dates prior to 1
October, 1752.
September 1752
Su Mo Tu We Th Fr Sa
1 2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
I haven't decided if it's worth making the program work for earlier
dates. If anyone wants to do so, one may add something along these
lines:
if ($year <= 1752 && $month <= 9) {
die "Fail on date earlier than 1 Oct 1752\n"; }
As the whole thing was really just a diversion, I'm not terribly
excited about adding a lot of error checking routines.
--
rfh harrison@pixi.com
------------------------------
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 2300
**************************************