[12538] in Perl-Users-Digest
Perl-Users Digest, Issue: 6138 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 26 19:07:24 1999
Date: Sat, 26 Jun 99 16:00:15 -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, 26 Jun 1999 Volume: 8 Number: 6138
Today's topics:
Re: alphabetical sorting <gellyfish@gellyfish.com>
Constant? <matthewwilson@matthewwilson.free-online.co.uk>
embedding perl question <pabl0@starmail.com>
Re: Having an external script modify %ENV? <gellyfish@gellyfish.com>
How to store hashes <thummel@junior-net.de>
In Mountain View did Larry Wall <tchrist@mox.perl.com>
Re: Job posting - Vancouver BC Canada <batyam@my-deja.com>
Re: Job posting - Vancouver BC Canada <gellyfish@gellyfish.com>
Re: My script works! PLEASE HELP!!! <gellyfish@gellyfish.com>
Re: Perl without Web-Server (Bart Lateur)
Re: Perl without Web-Server <gellyfish@gellyfish.com>
Re: spawning on the left side of the assignment <gellyfish@gellyfish.com>
Re: Unlink == delete files? Why (on earth) is it called (Benjamin Franz)
Re: Unlink == delete files? Why (on earth) is it called (Bart Lateur)
Re: Unlink == delete files? Why (on earth) is it called <tchrist@mox.perl.com>
Re: Unlink == delete files? Why (on earth) is it called (Juergen Heinzl)
Re: Unlink == delete files? Why (on earth) is it called (Ook!)
Re: Unlink == delete files? Why (on earth) is it called <gellyfish@gellyfish.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Jun 1999 22:52:38 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: alphabetical sorting
Message-Id: <7l3ljm$4tk$1@gellyfish.btinternet.com>
On Sat, 26 Jun 1999 21:38:41 +0200 "Pletschette Andri" wrote:
> Hi, you should probably take a look at this script which sorts an HTML Page
> with <img..>tags.
<snip>
> M;VX@,CET:"!O9B!-87D@,3DY.0HC(R!B>2!0;&5T<V-H971T92!!;F1RZ2AA
doesnt look like any kind of Perl program I've ever seen ...
Please dont do that anymore.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 26 Jun 1999 22:56:21 +0100
From: "Matthew Wilson" <matthewwilson@matthewwilson.free-online.co.uk>
Subject: Constant?
Message-Id: <l_bd3.3549$BS6.2651@wards>
Forgive me if this is plastered over an FAQ or doc somewhere, but when I run
this script I am told "Can't modify constant item in scalar assignment"
relating to the reassignment of the scalar count. Why on earth is this a
constant? I thought they had to be declared with use constant! Please
help!
Here is the bit of code (part of a larger program though)
$count = 9; # 9 is assigned to count here ......
sub list_cat {
open INDEX, $index or die "Could not read jokes.txt : $!";
while (<INDEX>) {
if ($value eq $cat) {
print <<EndBit;
<HTML>
<BODY>
<H1> <CENTER> $cat </CENTER> </H1>
<BR> <BR>
Here is our current collection of jokes in this category:
<BR>
EndBit
;
if (count == 9) {
print <<endc;
<TABLE width="75%"> <TR> <TD width="33.3%">
<A HREF="joke.cgi?no=$no"> $joke </A> </TD>
endc
;
count = 1; #And here is where the error occurs
The function of the code is to display some HTML depending on values passed
to the program through $ENV('QUERY_STRING')
I'd be very greatful for some newbie help!
Thanks, Matthew wilson
------------------------------
Date: Sat, 26 Jun 1999 18:42:52 -0300
From: "pabl0" <pabl0@starmail.com>
Subject: embedding perl question
Message-Id: <7l3gr6$d6c$1@ul3.satlink.com>
It's possible embed perl within a Win32 application that is not in console
mode?
I try the examples in the perl documentation but only work in console mode.
Thanks, and I appreciate some example if it's possible.
------------------------------
Date: 26 Jun 1999 22:22:48 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Having an external script modify %ENV?
Message-Id: <7l3jro$4sp$1@gellyfish.btinternet.com>
On 26 Jun 1999 16:59:00 +0200 Kai Henningsen wrote:
> akhazano@oacis.com (Andrew Khazanov) wrote on 23.06.99 in <37743986.69506154@news.isp.net>:
>
> You can make a wrapper shell script that, after running those other
> scripts, lists the current state of its environment. Then you can take
> that information from perl and use it to feed the next invocation. Or
> maybe you just redirect it to a file and make the wrapper script execute
> that file at the start.
>
Isnt that why we ask people to read the FAQ for comp.unix.programmer ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 26 Jun 1999 23:53:23 +0100
From: Timo Hummel <thummel@junior-net.de>
Subject: How to store hashes
Message-Id: <377559E3.5CF8101F@junior-net.de>
Hi,
I want to store hashes in a file. What's the best way to do this? I'm
fairly new to Perl, and I haven't found a good beginner document for
perl yet (the documentation which came with ActiveState Perl for Win32
is hard to use).
Thanks for any help
Timo
------------------------------
Date: 26 Jun 1999 16:45:41 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: In Mountain View did Larry Wall
Message-Id: <37755815@cs.colorado.edu>
In Mountain View did Larry Wall
Sedately launch a quiet plea:
That DOS, the ancient system, shall
On boxes pleasureless to all
Run Perl though lack they C.
His acolytes he gathered round
And led where tools were never found
Save but for those made dear by Bill's
Unkind--nay, cruel!--per-user fee
And visual glitz chock full of frills;
They barely worked, and were not free.
But now foul wretched pain was fast supplanted
With bright new Perl-wrought tools at last to cover
That savage place of which we long had ranted
Though some beneath a waning moon had chanted
To summon forth their sendmail-demon lover!
And in this place, long fleeced by Redmond's scheming
As if the hackers' gods were lost in dreaming
An honored program, great and open-sourced,
Which Unix hackers had long ago endorsed
Cruel schackles shattered, freeing from the jail
Where prisoners chafed beneath the Windows' flail.
Despite these joys, we paused and looked to see
Lone Larry muttering low but plaintively
He raised his arms to calm the frenzied motion
Of heartless hackers cursing systems small
That ran these boxes pleasureless to all
For struck was Larry with another notion:
'Twas not enough to bring Perl to this shore
His quiet voice he raised to ask for MORE!
This land was lacking still the pleasure
That comes from using simple glue
To join together native treasure,
And integrate COM objects, too.
Then came a miracle of rare device,
An Active Perl to lend its flair and spice
To friends trapped far from Paradise.
In a vision once I saw:
It was a Wisconsinian maid,
And with Perl Power Tools she played
Stringing puissant pipes together
Deftly weaving webs of power
Fingers dancing like a feather
Till in me deep delight did flower.
For her my time I'd sacrifice:
I built myself a tool so fair
'Twould run on Bill's or Steve's device,
That she might know me if I dare.
My friends cry out: Beware! Beware!
Her singeing sighs, her stinging stare!
She knows me not, mistrusting vice.
My words of Unix bring her dread,
But I shall sooth her fears instead
And drink the milk of Paradise.
--
Just don't compare it with a real language, or you'll be unhappy... :-)
--Larry Wall in <1992May12.190238.5667@netlabs.com>
------------------------------
Date: Sat, 26 Jun 1999 20:47:43 GMT
From: NetNation <batyam@my-deja.com>
Subject: Re: Job posting - Vancouver BC Canada
Message-Id: <7l3e9d$77o$1@nnrp1.deja.com>
Likewise we need somone too,Linux environment, or should I say bloody
rainy environment ;-)
George Muenz
NetNation Communications Inc.
resumes@netnation.com www.netnation.com
In article <375DF44E.752C5D80@walkaboutwebs.com>,
Duane Nickull <webmaster@walkaboutwebs.com> wrote:
> G'day all:
>
> I apologize in advance for this intrusion onto perl related
discussion.
> We are in need of two full time Perl/Unix/Linux programmers in
> Vancouver, BC Canada. In a final bid of desperation, I decided to post
> this message.
>
> if (anyone is in the area || knows of someone who is looking for work
> here) {
> please send me an E-mail Privately
> {
>
> Thank you.
>
> D. Nickull
> webmaster@walkaboutwebs.com
>
--
Human Resources
NetNation Communications Inc.
Vancouver, BC, Canada
resumes@netnation.com www.netnation.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 26 Jun 1999 22:09:08 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Job posting - Vancouver BC Canada
Message-Id: <7l3j24$4sm$1@gellyfish.btinternet.com>
On Sat, 26 Jun 1999 20:47:43 GMT NetNation wrote:
> Likewise we need somone too,Linux environment, or should I say bloody
> rainy environment ;-)
OK. You find the two air fares, the place to live and a job for an
experienced housing manager as well as this and we might talk ... I
guess not right ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 22:50:34 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: My script works! PLEASE HELP!!!
Message-Id: <7l3lfq$4th$1@gellyfish.btinternet.com>
On 26 Jun 1999 17:35:53 -0000 Anno Siegel wrote:
> Beg your pardon for the flippant subject...
>
> I have a bit of code which I'd like to present to the combined scrutiny
> of the group. As the subject says, it works, but I utterly dislike it.
>
> I'm using strings as sets of integers; $i is in a set $set when
> vec( $set, $i, 1) == 1. The idea is to iterate over all the elements
> of a set, returning undef once when all elements are done. After
> that, a new set will be accepted. Sets are largish, about 5 K each,
> so I want to avoid copying. Here is what I wrote:
>
> 1 { my ( $set, $byte, $bit ); # private variables, therefore
> # ...bare block around
Perl doesnt have line numbers ... it makes it really difficult to cut
and paste ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 26 Jun 1999 20:11:18 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl without Web-Server
Message-Id: <377632d3.740608@news.skynet.be>
Pletschette Andri wrote:
>I just want to know if it's possible to run (test) Perl CGI-Programs without
>a Web-Server.
>
>the page and the CGI Program are in /home/cgi-test/
>and Perl is under /usr/bin/perl
Uh... yes, but not interactively with a web browser. You can set a
variable (like "$debug") so that the CGI-script then reads the
parameters from a file, and saves the output to another file. Then
simply load that file, if it's a HTML-file, into the browser. All you
need to do after you ran the script with new parameters, is click
"Reload" on the browser.
Alternatively, you can download and install a http server, like Apache,
and run it on your computer even without a network connection.
HTH,
Bart.
------------------------------
Date: 26 Jun 1999 22:48:12 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl without Web-Server
Message-Id: <7l3lbc$4te$1@gellyfish.btinternet.com>
On Sat, 26 Jun 1999 21:21:50 +0200 "Pletschette Andri" wrote:
> I just want to know if it's possible to run (test) Perl CGI-Programs without
> a Web-Server.
>
yes it is entirely possible. If you are using the module CGI.pm then if you
run the program from the command line then it will promptly ask you to
tell it some parameters ....
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 23:05:37 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: spawning on the left side of the assignment
Message-Id: <7l3mc1$4ug$1@gellyfish.btinternet.com>
On Sat, 26 Jun 1999 19:35:01 GMT Rick Delaney wrote:
>
> Yes, it's called symbolic references, but don't use those.
I think we should be tough on symbolic references and tough on the
causes of symbolic references.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 26 Jun 1999 20:12:02 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Unlink == delete files? Why (on earth) is it called unlink?
Message-Id: <muad3.129$WL.34732@typhoon-sf.snfc21.pbi.net>
In article <37752DDB.5D596676@falukuriren.se>,
Mats Pettersson <mats.pettersson@falukuriren.se> wrote:
>Hi!
>
>After searching for a built in file-delete function in despair, i was
>surprised (although i probably shouldn't be) to find it in 'unlink'.
>
>Why such an unlogical name? Does it really delete files (as freeing up
>disk space), or am i missing something of great importance here?
>
>Feel free to enlighten me, please!
It's because Perl was originally written for operating systems with
more sophisticated disk management than Windows or Macintosh. In Unix,
a single file can have *more* than one directory entry. And the file
itself is not removed until all hard links (aka directory entries) pointing
to that file are removed. So you don't have a 'delete' per se - what
you have is the removal of a directory link to the file: unlink.
It is only on operating systems that don't do linking that 'unlink'
and 'delete' are synonymous operations.
--
Benjamin Franz
------------------------------
Date: Sat, 26 Jun 1999 20:03:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Unlink == delete files? Why (on earth) is it called unlink?
Message-Id: <377531ae.447473@news.skynet.be>
Mats Pettersson wrote:
>After searching for a built in file-delete function in despair, i was
>surprised (although i probably shouldn't be) to find it in 'unlink'.
>
>Why such an unlogical name? Does it really delete files (as freeing up
>disk space), or am i missing something of great importance here?
Because it severs the link between afilename and the data. There could
be more than one name pointing to the same data, on Unix anyway. Only
when the last link is cut, the actuall data finally is deleted.
Think of it as a form of disk-based garbage collection (instead of
memory-based).
Bart.
------------------------------
Date: 26 Jun 1999 14:39:22 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Unlink == delete files? Why (on earth) is it called unlink?
Message-Id: <37753a7a@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Mats Pettersson <mats.pettersson@falukuriren.se> writes:
:After searching for a built in file-delete function in despair, i was
:surprised (although i probably shouldn't be) to find it in 'unlink'.
:
:Why such an unlogical name? Does it really delete files (as freeing up
:disk space),
Not necessarily.
:or am i missing something of great importance here?
Rather.
:Feel free to enlighten me, please!
UNLINK(2) OpenBSD Programmer's Manual UNLINK(2)
NAME
unlink - remove directory entry
SYNOPSIS
#include <unistd.h>
int
unlink(const char *path);
DESCRIPTION
The unlink() function removes the link named by path from its
directory and decrements the link count of the file which was
referenced by the link. If that decrement reduces the link count
of the file to zero, and no process has the file open, then all
resources associated with the file are reclaimed. If one or more
process have the file open when the last link is removed, the link
is removed, but the removal of the file is delayed until all
references to it have been closed.
SEE ALSO
close(2), link(2), rmdir(2), symlink(7)
HISTORY
An unlink() function call appeared in Version 6 AT&T UNIX.
4th Berkeley Distribution June 4, 1993
--tom
--
If you want capitalism, go to Russia!
------------------------------
Date: Sat, 26 Jun 1999 21:26:38 GMT
From: juergen@monocerus.demon.co.uk (Juergen Heinzl)
Subject: Re: Unlink == delete files? Why (on earth) is it called unlink?
Message-Id: <slrn7nah45.3v.juergen@monocerus.demon.co.uk>
In article <37752DDB.5D596676@falukuriren.se>, Mats Pettersson wrote:
>Hi!
>
>After searching for a built in file-delete function in despair, i was
>surprised (although i probably shouldn't be) to find it in 'unlink'.
>
>Why such an unlogical name? Does it really delete files (as freeing up
>disk space), or am i missing something of great importance here?
unlink != delete 8) ... one can have more than one links to the same
file, now if foo is a hard link to bar and you unlink foo, then the
file is still there. It is only accessible as bar, that is true, but
it is not gone either.
[...]
Ta',
Juergen
--
\ Real name : J|rgen Heinzl \ no flames /
\ EMail Private : juergen@monocerus.demon.co.uk \ send money instead /
------------------------------
Date: Sat, 26 Jun 1999 14:34:31 -0700
From: ookookook@yahoo.com (Ook!)
Subject: Re: Unlink == delete files? Why (on earth) is it called unlink?
Message-Id: <ookookook-2606991434320001@ip126.r1.d.pdx.nwlink.com>
In article <37752DDB.5D596676@falukuriren.se>, Mats Pettersson
<mats.pettersson@falukuriren.se> wrote:
->After searching for a built in file-delete function in despair, i was
->surprised (although i probably shouldn't be) to find it in 'unlink'.
->
->Why such an unlogical name? Does it really delete files (as freeing up
->disk space), or am i missing something of great importance here?
Consider it an artifact of the Unix (File System) heritage of Perl. It (is
in the mind of the clique that writes adequate books for O'Reilly and) was
used as a tool by Unix system admistrators to automate repetitive tasks
that were not easily performed with the current set of tools at hand, such
as the various GNU application programs, vi, awk, sed, and the Bourne and
C shells.
When a file (or directory) no longer has any links (references) to it, it
ceases to exist in the scope of the Operating System. One way to remove
links to a file (or directory) is through the use of the "unlink" command
(the use of which is commonly left only to the superuser, or "system
admistrator").
--
"Television: a medium. So called because it is neither rare nor well done."
- Ernie Kovacs
------------------------------
Date: 26 Jun 1999 22:36:45 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Unlink == delete files? Why (on earth) is it called unlink?
Message-Id: <7l3klt$4ta$1@gellyfish.btinternet.com>
On Sat, 26 Jun 1999 21:45:31 +0200 Mats Pettersson wrote:
> Hi!
>
> After searching for a built in file-delete function in despair, i was
> surprised (although i probably shouldn't be) to find it in 'unlink'.
>
> Why such an unlogical name? Does it really delete files (as freeing up
> disk space), or am i missing something of great importance here?
>
You dont use Unix very often do you ?
NAME
unlink - delete a name and possibly the file it refers to
SYNOPSIS
#include <unistd.h>
int unlink(const char *pathname);
DESCRIPTION
unlink deletes a name from the filesystem. If that name
was the last link to a file and no processes have the file
open the file is deleted and the space it was using is
made available for reuse.
Understand now ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 6138
**************************************