[12304] in Perl-Users-Digest
Perl-Users Digest, Issue: 5904 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 6 12:07:23 1999
Date: Sun, 6 Jun 99 09:00:21 -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 Sun, 6 Jun 1999 Volume: 8 Number: 5904
Today's topics:
[ANNOUNCE] Tie::ShadowHash 0.6 <rra@stanford.edu>
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
ANNOUNCE: Set::Object 1.00 <jll@skynet.be>
ANNOUNCE: WING 0.8 (Web/IMAP gateway) is available (Malcolm Beattie)
ANNOUNCEMENT: gRMA v0.01a released sam@tregar.com
ANNOUNCEMENT: NEW VERSION: HTML::Template 0.02 <sam@tregar.com>
Re: Bulk E-Mailing (I R A Aggie)
Re: Bulk E-Mailing (Steve Lamb)
CGI.pm & submit butt...ons <unclelui@grin.net>
Re: Copying any files <Alar@mtk.ut.ee>
Re: Creating symbolic link to dir via argument? (Randal L. Schwartz)
Re: Defining array names according to loop <james@britlinks.co.uk>
Re: How to diff two time vars <jdf@pobox.com>
Re: Looking for a shopping cart script!!! - Off-topic (Michel Dalle)
Looking for a shopping cart script!!! suzanne@wbom.com
multithread perl program... (GEMINI)
Re: PERL T SHIRT FOR SALE <jester@isdead.aha>
Re: problem clearing an array of array (Larry Rosler)
Re: Struggling with FORMAMAIL.PL (Bob Trieger)
Re: Struggling with FORMAMAIL.PL (I R A Aggie)
Unpack problem <npp@mail1.stofanet.dk>
Re: Uploading image files.. <dtbaker@bus-prod.com>
Re: using sed recursively (Randal L. Schwartz)
Wanted-Web Builder Seeking Fame & Fortune <panas@bestweb.net>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 6 Jun 1999 14:57:30 GMT
From: Russ Allbery <rra@stanford.edu>
Subject: [ANNOUNCE] Tie::ShadowHash 0.6
Message-Id: <7je28q$2ke$1@play.inetarena.com>
I am pleased to announce the release of version 0.6 of my Tie::ShadowHash
module. New in this release is an additional, special type of data source
that Tie::ShadowHash can manage. You can pass it the name of a text file
and a reference to a sub, and it uses the list returned by the sub as the
key and value(s) for the hash.
This provides a trivial and painless way of generating hashes from space-
(or comma-, or anything-else-) separated text files for easier use in the
rest of your program.
General information about Tie::ShadowHash from the README:
Tie::ShadowHash version 0.6
(Merge multiple data sources into a hash)
If you have a bunch of separate sources of data in the form of Perl
hashes, tied hashes (of whatever type, including on-disk databases tied
with DB_File, GDBM_File, or similar modules), or text files that you
want to turn into hashes, and you want to be able to query all of those
sources of data at once for a particular key without having to check
each one of them individually each time, this module is what you're
looking for. If you want to use a hash-like data source, even just one,
but make modifications to its data over the course of your program that
override its contents while your program runs but which don't have any
permanent effect on it, then this module may be what you're looking for.
Tie::ShadowHash lets you create a "shadow hash" that looks like a
regular Perl hash to your program but behind the scenes queries a whole
list of data sources. All the data sources underneath have to also
behave like Perl hashes, but that's the only constraint. They can be
regular Perl hashes or other tied hashes, including tied DB_File or
GDBM_File hashes or the like to access on-disk databases. All data
sources are treated as read-only; modifications to any data is stored in
the shadow hash itself, and subsequent accesses reflect any
modifications, but none of the data sources are changed.
This latest release is currently winding its way through PAUSE, and is
at <URL:ftp://ftp.eyrie.org/pub/software/modules/ShadowHash-0.06.tar.gz>.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Sun, 06 Jun 1999 10:24:05 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage928664641.14139@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 10 Sep 1998
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://cpan.perl.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://cpan.perl.org/
http://www.perl.com/CPAN/
http://cpan.perl.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:
setdir usenet-by-group/news.announce.newusers
send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 6 Jun 1999 14:55:44 GMT
From: Jean-Louis Leroy <jll@skynet.be>
Subject: ANNOUNCE: Set::Object 1.00
Message-Id: <7je25g$2ju$1@play.inetarena.com>
Hello,
I have uploaded version 1.00 of Set::Object to CPAN. Only change since
0.003: it will build with the current development distribution of Perl.
Set::Object can be found at:
http://www.cpan.org/modules/by-module/Set/Set-Object-1.00.tar.gz
DESCRIPTION
This module implements a Set of objects, that is, a collection of
objects without duplications. It is similar to a Smalltalk IdentitySet.
Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy
------------------------------
Date: 6 Jun 1999 14:56:40 GMT
From: mbeattie@sable.ox.ac.uk (Malcolm Beattie)
Subject: ANNOUNCE: WING 0.8 (Web/IMAP gateway) is available
Message-Id: <7je278$2k7$1@play.inetarena.com>
Version 0.8 of WING, the Web IMAP/NNTP Gateway, is now available.
WING is an Open Source Apache/mod_perl based system which allows
users to access email held on an IMAP server via any web browser.
Some features of WING are:
* The browser does not need to support Java, JavaScript or frames
but table and cookie support are preferable.
* Users can create a hierarchy of multiple mailboxes and browse and
move messages between them.
* Messages with MIME attachments can be displayed nicely.
* Per user defaults (such as screen size and mail signature) can be
set and saved between sessions.
* Files local to the client browser can be included in composed
messages or MIME attached to them.
* Arbitrary headers can be added to composed messages except that the
"From:" header cannot be changed or forged for outgoing messages
from WING.
* WING is scalable up to thousands and tens of thousands of users.
WING 0.8 introduces the following features:
* Users can import address books by uploading them via their browser
(only Pine format address books supported in this version).
* Users can create their own links (bookmarks), presented in a
hierarchical list which can be folded/unfolded.
* Users can login using a "portal" view which provides a frame down
the left hand side of the browser containing site-configurable
links along with their personal links. This is the only part of
WING which requires frame support from the browser.
When integrated with a mail cluster similar to the one we have here
at Oxford University, WING also has these features:
* Users can manage their account via the WING interface. This includes
changing passwords, querying disk usage of mailboxes and disk quota
an setting mail forwarding and "vacation" messages.
* Users can create address books which can be browsed, searched and
shared in an ACL controlled manner with chosen lists of other
users and groups.
* WING server nodes can be added or removed transparently and can be
taken down for upgrades without affecting user service.
* There are a few web-based admin tools for querying the status of
the WING cluster and its users.
REQUIREMENTS
In its current state, WING requires many other pieces of software to
function. Future versions may be easier to install, configure and
maintain but this one requires the attention of an experienced system
administrator familiar with Apache/mod_perl, Perl and SQL databases.
It was also developed primarily for Linux and other platforms may have
to add extra Perl code to make up for missing features. For
configuring a mail cluster and its associated features (currently
undocumented), the administrator will also need to know about network
configuration, firewalling, NFS, automount, named and exim.
AVAILABILITY
Wing will shortly be available from your favourite CPAN site as
modules/by-authors/Malcolm_Beattie/wing-0.8.tar.gz and is available
right now from its home site in tar.gz form
ftp://ftp.ox.ac.uk/pub/perl/wing-0.8.tar.gz
or (better) source RPM form
ftp://ftp.ox.ac.uk/pub/linux/SRPMS/wing-0.8-1.src.rpm
or "binary" (noarch) RPM form for Red Hat 5.x Linux
ftp://ftp.ox.ac.uk/pub/linux/RPMS/noarch/wing-0.8-1.noarch.rpm
Wing depends on many other pieces of software and Perl modules, most
of which are available from CPAN, a couple only from the home site
mentioned above.
SUPPORT
There isn't any official support. There is a mailing list called
"wing-admin" where those who use or want to use WING can discuss
things. The list is a majordomo list. To subscribe, send the
following message *body* (the subject line is irrelevant and ignored)
subscribe wing-admin
to majordomo@maillist.ox.ac.uk. To unsubscribe again send the message
body "unsubscribe wing-admin" to the same address. To send messages to
the list, mail to wing-admin@maillist.ox.ac.uk (only subscribers can
send to the list).
--Malcolm
--
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Oxford University Computing Services
"I permitted that as a demonstration of futility" --Grey Roger
------------------------------
Date: 6 Jun 1999 14:56:06 GMT
From: sam@tregar.com
Subject: ANNOUNCEMENT: gRMA v0.01a released
Message-Id: <7je266$2k5$1@play.inetarena.com>
ANNOUNCEMENT: gRMA v0.01a released
The first alpha release of gRMA a free, graphical tool for doing Rate
Monotonic Analysis of real-time systems has been released. You can
get this release from:
http://www.tregar.com/gRMA/
In case you're wondering what this has to do with Perl - it's written
entirely in Perl and I'm looking for other Perl programmers to help me
develop it further.
>From the README:
-----------
gRMA v0.01a
-----------
a graphical tool for rate monotonic analysis
of real time systems
DESCRIPTION
This program provides a graphical environment for experimentation with
rate monotonic analysis of real-time systems. You are provided with
tools for describing a real time system. You can then view the
results of performing rate monotonic analysis of this system. For
details on the theory please see the documentation in the 'doc/'
directory. For details on the operation of the program, please refer
to the online help system accessible from the 'Help' menu on the main
screen.
This module is licensed under the GPL - no warranty of any kind is
provided. See the LICENSE section below for more details.
*** THIS IS AN ALPHA RELEASE ***
WARNING: This is an alpha release! It is not a complete software
product. Please report any and all bugs you find in it to me at
sam@tregar.com. Please consider contributing solutions to bugs and
shortcomings - any and all help will be appreciated and credited.
This program is in a highly incomplete form. In particular, it is
possible to specify systems that the analysis engine cannot produce
results for. This was done to provide a working base for future
development. If someone wants to add, for example, the ability to
handle "bursty" aperiodic tasks to the analysis engine, all that is
necessary is to modify the engine itself. If I had not included the
"Bursty" option in the Task Editor, it would require a difficult
change to the GUI code to support that analysis. Of course, some
changes will require GUI changes, but the hope is that these will be
kept to a minimum.
CONTACT
Sam Tregar (sam@tregar.com)
LICENSE
gRMA : a graphical tool for rate monotonic analysis of real time systems
Copyright (C) 1999 Sam Tregar (sam@tregar.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 6 Jun 1999 14:56:24 GMT
From: Sam Tregar <sam@tregar.com>
Subject: ANNOUNCEMENT: NEW VERSION: HTML::Template 0.02
Message-Id: <7je26o$2k6$1@play.inetarena.com>
ANNOUNCEMENT: NEW VERSION: HTML::Template 0.02
NAME
HTML::Template - a Perl module to use HTML Templates
CHANGES
0.02 Mon May 31 12:47:00 1999
- a few minor bugs fixed
- die on multiple source parameters in new()
- tries to preserve newlines in loop body
- copies in array contents from array refs on param call
i.e. allows for reuse of scratch arrays on calling side
- Added a CREDITS section to the docs, inaugurated it with
Richard Chen for his many fixes.
- Added type => 'sometype', source => 'source' new() syntax.
- made "NAME=" in tags optional. Added a test.pl to check for
this.
DESCRIPTION
This module attempts to make using HTML templates simple and
natural. It extends standard HTML with a few new tags - <TMPL_VAR>
and <TMPL_LOOP>. The file written with HTML and these new tags is
called a template. It is usually saved separate from your script -
possibly even created by someone else! Using this module you fill
in the values for the variables and loops declared in the template.
This allows you to seperate design - the HTML - from the data,
which you generate in the Perl script.
This module is licenced under the GPL. See the LICENCE section
of the README.
AVAILABILITY
The module is available on CPAN. You can get it using CPAN.pm or
go to:
http://www.cpan.org/authors/id/S/SA/SAMTREGAR/HTML_Template-0.01.tar.gz
MOTIVATION
It is true that there are a number of packages out there to do HTML
templates. On the one hand you have things like HTML::Embperl
which allows you freely mix Perl with HTML. On the other hand lie
home-grown variable substitution solutions. Hopefully the module
can find a place between the two.
One advantage of this module over a full HTML::Embperl-esque
solution is that it enforces an important divide - design and
programming. By limiting the programmer to just using simple
variables and loops in the HTML, the template remains accessible to
designers and other non-perl people. The use of HTML-esque syntax
goes further to make the format understandable to others. In the
future this similarity could be used to extend existing HTML
editors/analyzers to support this syntax.
An advantage of this module over home-grown tag-replacement schemes
is the support for loops. In my work I am often called on to
produce tables of data in html. Producing them using simplistic
HTML templates results in CGIs containing lots of HTML since the
HTML itself could not represent loops. The introduction of loop
statements in the HTML simplifies this situation considerably. The
designer can layout a single row and the programmer can fill it in
as many times as necessary - all they must agree on is the
parameter names.
For all that, I think the best thing about this module is that it
does just one thing and it does it quickly and carefully. It
doesn't try to replace Perl and HTML, it just augments them to
interact a little better. And it's pretty fast.
DOCUMENTATION
The documentation is in Template.pm in the form of POD format
perldocs. Even the above text might be out of date, so be sure to
check the perldocs for the straight truth.
CONTACT INFO
This module was written by Sam Tregar (sam@tregar.com) for Vanguard
Media (http://www.vm.com).
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 6 Jun 1999 14:19:58 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Bulk E-Mailing
Message-Id: <slrn7ll12t.ckn.fl_aggie@thepentagon.com>
On Sun, 6 Jun 1999 01:13:54 -0400, Dani Koesterich <mrdank@sprintmail.com>, in
<7jd09p$f5c$1@oak.prod.itd.earthlink.net> wrote:
+ I wrote a script to send out my newsletter issues. My
+ subscribers list exceeds 10,000 so it has to be good, and
+ no screw ups.
Then use the right tool, something like majordomo [1] or
mailman [2].
James
[1] - http://www.greatcircle.com/
[2] - http://www.list.org/
------------------------------
Date: 6 Jun 1999 14:36:31 GMT
From: morpheus@despair.rpglink.com (Steve Lamb)
Subject: Re: Bulk E-Mailing
Message-Id: <slrn7ll1rf.fjj.morpheus@rpglink.com>
On 6 Jun 1999 14:19:58 GMT, I R A Aggie <fl_aggie@thepentagon.com> wrote:
>On Sun, 6 Jun 1999 01:13:54 -0400, Dani Koesterich <mrdank@sprintmail.com>,
>in <7jd09p$f5c$1@oak.prod.itd.earthlink.net> wrote:
>+ I wrote a script to send out my newsletter issues. My
>+ subscribers list exceeds 10,000 so it has to be good, and
>+ no screw ups.
>Then use the right tool, something like majordomo [1] or
>mailman [2].
Or Listar[3].
>[1] - http://www.greatcircle.com/
>[2] - http://www.list.org/
[3] - http://www.listar.org/
--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
ICQ: 5107343 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
------------------------------
Date: Sun, 06 Jun 1999 06:01:56 -0700
From: "Luis F. Salas" <unclelui@grin.net>
Subject: CGI.pm & submit butt...ons
Message-Id: <375A7144.4275@grin.net>
Hola,
I am trying to write a Guestbook program that shows a form, once it is
filled out with name, email address and comments it should display a
2nd page where the data entered is printed as text, and 2 buttons
labeled ACCEPT and CHANGE.
The program displays the initial form, however, on the second page,
where it asks you for confirmation or change of entries, once you
click on any submit button it does not do anything. Instead get a
message that says "internal server error".
What I'm doing is this:
+++++++++++++++++++++++++
standard stuff
my $submit = param('abutton');
sub createform { ## first page
...
submit(-name=>'abutton',-value=>sign);
}
sub reflectdata { ## second page
...
submit(-name=>'abutton',-value=>'send');
submit(-name=>'abutton',-value=>'change');
moveon();
}
sub moveon { ## does not happen, get error message instead
if $submit eq "send"
sendentry();
else if $submit eq "change"
createform();
}
#main
if (param())
reflectdata();
else
createform();
+++++++++++++++++++++++++++++++++++++++++++++++
When on the second page I click either button (send or change) I get
the error message. The CGI.pm online doc says to give a diff value
to each submit button. That's what I did, but what is they are in
different pages, does that make a difference? Is that the correct way
to do it?
Can anyone help?
** Note: I MUST have a second page with 2 buttons.
Muchas Gracias
Luis
unclelui@grin.net
------------------------------
Date: Sun, 6 Jun 1999 15:53:57 +0300
From: "Alar Pandis" <Alar@mtk.ut.ee>
Subject: Re: Copying any files
Message-Id: <7jdr2d$mjm$1@kadri.ut.ee>
Hi and thanks!
Result is the same.
print open LXHFILE, "<$kat.$fail";
copy(LXHFILE, $arhkat.$fail) || print $!."-".$arhkat.$fail;
Alar.
Kai Henningsen <kaih=7IN0nxW1w-B@khms.westfalen.de> wrote in message
news:7IN0nxW1w-B@khms.westfalen.de...
> Alar@mtk.ut.ee (Alar Pandis) wrote on 05.06.99 in
<7jbjk0$enl$1@kadri.ut.ee>:
>
> > # KAT is directory and FAIL is file; ARHKAT is dest. dir.
> >
> > open LXHFILE, "<$kat$fail";
> > copy LXHFILE, $arhkat.$fail || print $!."-".$arhkat.$fail;
> > close LXHFILE;
> >
> > == No such file or directory.
> >
> > If both of files opened then same result (one for reading, othe for
> > writing).
> >
> > If just
> >
> > copy $kat.$fail, $arhkat.$fail;
> >
> > it works, but binary files is corrupted and timestamps etc. is wrong.
Result
> > is the same if I just open and then writing (print).
>
> Hmm. Maybe the problem is that you are missing a "." in your open line?
> You might want to change that line to read
>
> open LXHFILE, "<$kat.$fail" or die "can't open $kat.$fail: $!";
>
> to see if the open succeeds.
>
>
> Kai
> --
> http://www.westfalen.de/private/khms/
> "... by God I *KNOW* what this network is for, and you can't have it."
> - Russ Allbery (rra@stanford.edu)
------------------------------
Date: 06 Jun 1999 08:13:38 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Creating symbolic link to dir via argument?
Message-Id: <m16751mkf1.fsf@halfdome.holdit.com>
>>>>> "Barry" == Barry Margolin <barmar@bbnplanet.com> writes:
Barry> In article <designer-ya02408000R0406992209270001@news.ricochet.net>,
Barry> Dan Poynor <designer@ricochet.net> wrote:
>> I'm trying to create a symbolic link to a directory with the following...
>> ln -s `ls -ut /home/httpd/html/rotating_shows/ | tail -1`
>> /home/httpd/html/current
>> But this seems to think its creating a sym link to a file rather than to a
>> sub-directory in the rotating_shows directory.
Barry> Type:
Barry> ls -ut /home/httpd/html/rotating_shows/ | tail -1
Barry> and notice the output. It's just a filename, not a full pathname. That's
Barry> what gets substituted into your command line, so that's what the symlink
Barry> will point to.
Barry> Change it to:
Barry> ln -s `ls -ut /home/httpd/html/rotating_shows/* | tail -1` /home/httpd/html/current
Or, without launching so many processes, or concern about the
subdirectories of that directory:
#!/usr/bin/perl
($oldest) =
map { $_->[0] } sort { $b->[1] <=> $a->[1] }
map { [$_, -A] } </home/httpd/html/rotating_shows/*>;
unlink "/home/httpd/html/current" or warn "unlink: $!";
symlink $oldest, "/home/httpd/html/current" or die "symlink: $!";
Perl is your friend. Use Perl.
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Sun, 6 Jun 1999 09:42:04 +0100
From: James Stewart <james@britlinks.co.uk>
Subject: Re: Defining array names according to loop
Message-Id: <ant0608041cbLh==@ch0128.charis.co.uk>
In article <ak4cj7.bal.ln@magna.metronet.com>, Tad McClellan
<URL:mailto:tadmc@metronet.com> wrote:
> James Stewart (james@britlinks.co.uk) wrote:
> : In article <Pine.GSO.4.02A.9906051523021.1103-100000@user2.teleport.com>,
> : Tom Phoenix <URL:mailto:rootbeer@redcat.com> wrote:
>
> : > The perlref manpage (and perllol and
> : > perldsc) may be of some help. Good luck!
>
> : thanks. I'm grabbing the files at the moment.
> ^^^^^^^^^^^^^^^^^^
>
>
> No need to "grab" them.
>
> They *come with* Perl.
>
> If you have a properly installed perl, then you already
> have them on your hard disk somewhere...
Badly phrased ... I've not got perl on my home machine (that will change
when I switch to linux next month) and am using it via telnet. I was
spooling the files to my hard disk as I typed.
James.
--
James Stewart - james@britlinks.co.uk | "Telecom ignored us and
The Britlinks - http://www.britlinks.co.uk | democracy has died."
Phantom Tollbooth - http://www.tollbooth.org | -- Fat And Frantic
Sixpence None The Richer in the UK - http://www.britlinks.co.uk/sixpence/
------------------------------
Date: 06 Jun 1999 08:43:49 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: "Allen zhao" <Allenz@qd.lucent.com>
Subject: Re: How to diff two time vars
Message-Id: <m3wvxhsdmi.fsf@joshua.panix.com>
"Allen zhao" <Allenz@qd.lucent.com> writes:
> $tm1="May 5 12:0:0";
> $tm2="May 6 13:1:1";
>
> How can I get the difference between the two time points? I want to
> get a result such as "1 day 1 hour 1 min 1 sec".
You'll probably enjoy the Date::Calc module, available at the CPAN:
http://www.perl.com/CPAN-local/
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Sun, 06 Jun 1999 12:31:57 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Looking for a shopping cart script!!! - Off-topic
Message-Id: <7jdpm9$4co$1@xenon.inbe.net>
In article <7jdh3v$rkt$1@nnrp1.deja.com>, suzanne@wbom.com wrote:
>Hi All,
>
>I am in search of a shopping cart script that allows for customers to
>enter and store their info for future orders... sort of like Amazon.com
>has.
The CGI Resource Index might have something for you :
http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Shopping_Carts/
As for your MiniVend troubles, have you tried asking on their "mail list" ?
http://www.minivend.com/iri/maillist.html
BTW, this has nothing to do with Perl, so you're in the wrong newsgroup...
Happy shopping anyway,
Michel.
------------------------------
Date: Sun, 06 Jun 1999 10:04:48 GMT
From: suzanne@wbom.com
Subject: Looking for a shopping cart script!!!
Message-Id: <7jdh3v$rkt$1@nnrp1.deja.com>
Hi All,
I am in search of a shopping cart script that allows for customers to
enter and store their info for future orders... sort of like Amazon.com
has.
I tried MiniVend but it just never sets up right.. MiniVend is exactly
what I am looking for, or something very close to it. I don't care if
its not a free script!!!
Can some one please point me in the direction of something comparible
to MiniVend or if you have use MiniVend how about some HELP!!! The damn
thing is driving me crazy!!!!
Please e-mail me with any help you can provide!
Thanks!
Suzanne
suzanne@wbom.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 6 Jun 1999 13:19:15 GMT
From: dennis@info4.csie.nctu.edu.tw (GEMINI)
Subject: multithread perl program...
Message-Id: <7jdsgj$knt$2@netnews.csie.NCTU.edu.tw>
I am trying to write a multithreaded
TCP server instead of traditional
fork-based server. When a request
incoming, the main thread create a new thread
to serve the client, and go on to accept another
incoming:
use Thread;
use IO::Socket::INET;
$server=IO::Socket::INET->new(.....
while ($client=$server->accept()) {
new Thread(\&servclient,$client);
}
the main thread cannot wait for the new thread
to join back because we don't know when the connection
will finish. Actually the thread will exit when
the servclient subroutine return.
The problem is:
The Thread module maintains a list of thread
that currently running or exit but not join.
Since I could never use join, I found the list
will growing larger and larger. I'm afraid that
it will eat all the memory eventually.
So how can I solve this problem??
thanx.
------------------------------
Date: Sun, 6 Jun 1999 21:08:30 +0930
From: "Jester" <jester@isdead.aha>
Subject: Re: PERL T SHIRT FOR SALE
Message-Id: <pfs63.2030$H21.10127@ozemail.com.au>
Finally, I'd like to see those bullies at school call me a nerd now when I
rock up in my brand new t shirt.
Jamie Brown wrote in message <7jd7go$lmb$1@news.inc.net>...
>http://www.gware.net
>
>
>
>
>
>
><img src=http://www.spamm.net/images/geek_banner_sm.gif border=0 width=460
>height=60 alt="check out GeekWare for all your GEEK needs!">
><P>
><img src=http://fp.iserve.net/brice/perl_shirt.gif><p>
>PERL Coder's Shirt<br>
>You're a hard-coding, perl hacking, script writing machine!<br>
> You won't break a sweat on your next project with our PERL shirt!
><p>(back reads: "We code more before 9am than most people code all day")
>
>
>100% Cotton in GI Green
>
>L, XL, XXL (stock: 10-PERL)
>
>
>$4.50 shipping and handling.
>
>
>
>See the other cool stuff at the web site!!!
><img src=http://www.spamm.net/images/geek_banner_sm.gif border=0 width=460
>height=60 alt="check out GeekWare for all your GEEK needs!">
>
>
>
------------------------------
Date: Sun, 6 Jun 1999 06:18:16 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: problem clearing an array of array
Message-Id: <MPG.11c414eaf6902b2b989b78@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <7jais8$24e$1@nnrp1.deja.com> on Sat, 05 Jun 1999 07:16:26
GMT, smnayeem@my-deja.com <smnayeem@my-deja.com> says...
> Dear Perl experts,
> I am having difficulties clearing the values of an array-ref of
> array-refs. I am declaring and using an array of array references (for
> convenience of passing it to and from subroutines).. what happens is
> that when the subroutine that uses it (it declares it locally using my
> and then uses it) it somehow remembers the previous values (i thought
> all sorts of variables lose their values as soon as they get out of
> their scope)...
That is a misconception. You have copied some values into a data
structure and retained the references to the data. Nothing is going out
of scope or losing its values.
> i tried everything, i tried initializing it to undef
> when declaring it, also tried to pop off the values after using it, but
> to no avail.
You haven't shown us code that fails (or works, for that matter)!
> My array is something like this :
>
> sub SayThings {
> my $MyArray = []; #declare as a reference of an array
No such thing in Perl. A scalar is a scalar is a scalar. You create a
ref to an array, then overwrite it immediately.
> $MyArray = fillit;
As shown, this cannot work, because 'fillit' isn't defined.
> for ($i = 0, $i <= $#$MyArray, $i++) {
The s/,/;/g has already been observed.
> print $MyArray->[$i][0], "\t";
> print $MyArray->[$i][1], "\t";
> print $MyArray->[$i][2], "\t";
> print $MyArray->[$i][3], "\n";}
The line above references data that aren't there. It also has the worst
placement for a closing brace that I've ever seen.
> }
>
> sub fillit {
> my $retval = [];
> #store references of arrays in it
> push @$retval, ["Hello","there", "everyone"];
> push @$retval, ["this", "isnt" , "working"];
> push @$retval, ["very", "troublesome" , "problem"];
> push @$retval, ["cant", "figure" , "out"];
> return $retval;
> }
>
> what happens is that when i call sub SaySomething a second time and the
> sub fillit returns some other values, somehow the old values gets
> remembered and i cant seem to be able to get rid of them.
I have no idea what this means.
> does anyone know how i can solve this problem?
Can you show the *exact* code that doesn't work, what it did, and what
you wanted it to do?
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 06 Jun 1999 10:36:46 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Struggling with FORMAMAIL.PL
Message-Id: <7jdh6j$f9g$1@fir.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
Mike Likvan <mlikvan@home.com> wrote:
>I've downloaded the FORMMAIL.PL from Matt's Script Archive (attached)
>and I'm having problems when referring to it in some HTML I'm writing.
>
>The complete part of the HTML that I'm having problems with is listed
>below "ATTACHMENT B".
E-mail Matt Wright and ask him for assistance. He wrote the script.
------------------------------
Date: 6 Jun 1999 14:22:07 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Struggling with FORMAMAIL.PL
Message-Id: <slrn7ll16t.ckn.fl_aggie@thepentagon.com>
On Sun, 06 Jun 1999 10:36:46 GMT, Bob Trieger <sowmaster@juicepigs.com>, in
<7jdh6j$f9g$1@fir.prod.itd.earthlink.net> wrote:
+ [ courtesy cc sent by mail if address not munged ]
+ E-mail Matt Wright and ask him for assistance. He wrote the script.
No warranty, guarantee, or double-your-money-back assurances from Matt.
AFAIK, he doesn't support his scripts, and hasn't for more than a year.
James
------------------------------
Date: Sun, 6 Jun 1999 15:01:13 +0200
From: "Nikolaj Pedersen" <npp@mail1.stofanet.dk>
Subject: Unpack problem
Message-Id: <7jdrd6$qk3$1@news101.telia.com>
I would like to pack some string variables into one string, and then unpack
them into an array, without using delimiters. Here is my best guess, but it
doesn't work, unpack unpack the whole string into the first variable. Am I
using unpack the wrong way?
$a = "Name";
$b = "Title";
$c = "Path";
$d = "167";
$p = pack( "a*a*a*a*a*", $a, $b, $c, $d );
($a, $b, $c, $d ) = unpack ( "a*a*a*a*a*", $p );
print $a . "\n";
print $b . "\n";
print $c . "\n";
print $d . "\n";
Output is:
NameTitlePath167
Any hints and comments welcome!
--
Nikolaj Pedersen
Email: npp@fjendsnet.dk
------------------------------
Date: Sun, 06 Jun 1999 09:32:08 -0500
From: Dan Baker <dtbaker@bus-prod.com>
Subject: Re: Uploading image files..
Message-Id: <375A8668.DE175E83@bus-prod.com>
David Efflandt wrote:
>
> On Thu, 27 May 1999 13:16:55 -0300, Terra Landry <terral@cyberplex.com> wrote:
> >I want to upload images in perl... I have it uploading, but it saves an
> >empty file, so I'm not sure what I'm doing wrong... can anyone help me by
> >giving me an example of a file upload??
----------
I have been workinga similar stuff, and found some great examples at
http://www.idocs.com
The only things I'm still struggling a little with is how to get at the
information available from the uploadInfo("$filename")
Dan
------------------------------
Date: 06 Jun 1999 08:08:42 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: using sed recursively
Message-Id: <m1aeudmkn9.fsf@halfdome.holdit.com>
>>>>> "Dale" == Dale Hagglund <rdh@best.com> writes:
Dale> The, or, at least, a perl solution would look something like
Dale> find dir ... -print |
Dale> xargs perl -pi.bak -e 's/change this/to that/g'
You can also do this entirely in Perl:
find2perl dir ... \
-eval 'push @ARGV, $name; END { while (<>) { s/this/that/g'; print; } }' |
perl -i.bak
Saves the launch of find, and works even with names with newlines in
them.
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Sun, 06 Jun 1999 15:40:15 GMT
From: "John Panas" <panas@bestweb.net>
Subject: Wanted-Web Builder Seeking Fame & Fortune
Message-Id: <zDw63.2065$T24.151142@newshog.newsread.com>
Small highly motivated Internet team seeks to add a
member in order to launch a new Internet component to
an existing business.
If your bright w/Internet expertise and looking for a
challenge and adventure this could be for you. If you
are imaginative, crave the opportunity to excel and
seek FAME and FORTUNE please read on....
If you think the Internet will redefine every facet
of business and how money is made please read on.
-WARNING-
The gold rush will not last forever, the clock is
ticking. When the net's bandwidth increases big
glittery sites with full motion video and paid-for
search-engine-hits will squeeze the little guys (us)
out in favor of big corporations. But there is still
time to make BIG money... if you act now.
If your interested in helping to rolling out a sleepy
little operation into an international FORCE read on...
We'll work together remotely using the Internet and
the phone. It's a method I've used successfully before
to build several Internet Adventures. If your the kind
of person who can see the vision and work independently
in contributing to a team effort then your the person
I'm looking for.
While technical expertise is very important it's not the
only important success factor. Being a team player with
a burring desire to learn and excel are also critical.
If your such a person please read on.
This is not for everyone...but if your tyhe right
person you and I will know it the first time we talk.
You must have some Internet experience, and the more the
better...BUT we can train. ANY of the following are
helpful: HTML, or HTML editors, Perl/CGI coding or
Perl/CGI installation experience, or search engine
placement experience, or Java or Internet DB expertise
or experience with building non-US sites.
Please send urls and or samples of your work to
Thank you for taking the time to read this.
Wishing you all the best.
John Panas
------------------------------
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 5904
**************************************