[12491] in Perl-Users-Digest
Perl-Users Digest, Issue: 6091 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 22 12:07:20 1999
Date: Tue, 22 Jun 99 09:00:29 -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 Tue, 22 Jun 1999 Volume: 8 Number: 6091
Today's topics:
Re: 2 simple (not to me tho) questions (Philip 'Yes, that's my address' Newton)
Re: 2 simple (not to me tho) questions (Steve Lamb)
Re: 2 simple (not to me tho) questions <tchrist@mox.perl.com>
Re: 2 simple (not to me tho) questions (Bart Lateur)
Re: [q] Timing of a simple looping cycle PERL vs C <kai.poitschke@axense.com>
Re: [q] Timing of a simple looping cycle PERL vs C <kai.poitschke@axense.com>
Re: [q] Timing of a simple looping cycle PERL vs C (Bart Lateur)
Re: A month behind using localtime(time) ? <upsetter@ziplink.net>
Re: A month behind using localtime(time) ? (Bart Lateur)
Re: A month behind using localtime(time) ? <Mark.Conlin@bridge.bellsouth.com>
Re: A month behind using localtime(time) ? <Mark.Conlin@bridge.bellsouth.com>
Re: A month behind using localtime(time) ? (David Cantrell)
Re: A month behind using localtime(time) ? <tchrist@mox.perl.com>
Re: A month behind using localtime(time) ? (Harry Broomhall)
Re: A month behind using localtime(time) ? (Tad McClellan)
Re: Apache + Perl <matt.sergeant@ericsson.com>
Re: bulk emailing (Abigail)
Re: can you split a word into letters? (Larry Rosler)
Re: cannot use |- multiple times <rootbeer@redcat.com>
catching directory updates (Edward P Scholl)
Re: CGI::Push Problem <rootbeer@redcat.com>
DBI / mSQL installion problem: Fetchhash not working (Dico Reyers)
DIE DIE DIE Prisoners of Bill (was: How many questions <tchrist@mox.perl.com>
Exporting variables from a module <sethr@crocker.com>
foreach and while (<FILE>) <shei@dai.ed.ac.uk>
Re: foreach and while (<FILE>) (Tad McClellan)
Re: fork on NT <matt.sergeant@ericsson.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 22 Jun 1999 15:10:19 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <376f9fa2.110269950@news.nikoma.de>
On Mon, 21 Jun 1999 22:45:49 -0700, lr@hpl.hp.com (Larry Rosler)
wrote:
>In article <376EF026.56082447@frontiernet.net> on Mon, 21 Jun 1999
>22:08:38 -0400, Bob Walton <walton@frontiernet.net> says...
>> Casey R Tweten wrote:
>> > ...I agree, in fact, why is that so long?
>> >
>> > my @animal=("c","a","t");
>> > print foreach @animal;
>>
>> If shorter is better...
>>
>> my @animal=("c","a","t");
>> print for @animal;
>
>If shorter is better...
>
>my@animal=qw(c a t);
>print@animal;
In that case, my vote is for:
my@a=qw(c a t);print@a
Leave off the newline in the middle and the semicolon at the end, and
shorten the variable name. This leaves you with a few extra bytes in
which to store e.g. such useful string constants as '19' to print in
front of your dates :)
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.net>
------------------------------
Date: 22 Jun 1999 15:08:21 GMT
From: morpheus@despair.rpglink.com (Steve Lamb)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <slrn7mv9mu.e8j.morpheus@rpglink.com>
On 21 Jun 1999 18:26:43 -0700, Tom Christiansen <tchrist@mox.perl.com> wrote:
>They aren't harmless, you know. Double quoted compose a
>*brand*new*string*. This isn't necessarily what you always want.
So far I've not seen a problem with it.
>There are enough situations where fn("$var") is different from fn($var)
>that you would be doing yourself a favor if you were to get out of
>the habit. It's confusing at best, dangerous at worst.
It is neither confusing or dangerous.
He said, "Hi, there."
print("Hi, there.");
That is why I do it and, generally, I do it ONLY on prints.
--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
ICQ: 5107343 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
------------------------------
Date: 22 Jun 1999 09:44:17 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <376faf51@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, morpheus@despair.rpglink.com (Steve Lamb) writes:
:>There are enough situations where fn("$var") is different from fn($var)
:>that you would be doing yourself a favor if you were to get out of
:>the habit. It's confusing at best, dangerous at worst.
:
: It is neither confusing or dangerous.
Golly, Maude, I think I caught me a live one!
Compare:
$var = [ qw/grok this/ ];
fn( $var );
fn("$var");
Compare:
@var = qw/grok this/;
fn( @var );
fn("@var");
Compare:
$! = 12;
fn( $! );
fn("$!");
Compare:
fn( 0x23 );
fn("0x23");
Compare:
fn( 6.02 * 10**23 );
fn("6.02 * 10**23");
Compare:
fn( 12 | 37 );
fn("12" | "37");
Doublequotes stringify. They do not argpassify.
Stringification can be destructive. Just say no.
--tom
--
Scimus nostrorum verborum sententiam non vos audire.
------------------------------
Date: Tue, 22 Jun 1999 15:50:34 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <377ab08c.9218447@news.skynet.be>
Tom Christiansen wrote:
>Compare:
>
> @var = qw/grok this/;
> fn( @var );
> fn("@var");
[etc.]
Don't forget this one:
$ref = [qw/grok this/];
fn($var);
fn("$var");
Bart.
------------------------------
Date: Tue, 22 Jun 1999 17:20:38 +0200
From: Kai Poitschke <kai.poitschke@axense.com>
To: Augur the Genius <augur@icelord.net>
Subject: Re: [q] Timing of a simple looping cycle PERL vs C
Message-Id: <376FA9C6.488AF80F@axense.com>
I think a reasonable amount of time is used for starting the perl interpreter
and compiling the programm.
You should measure the time used inside the programm not outside with time
perl ...
kai.poitschke@computer.org
------------------------------
Date: Tue, 22 Jun 1999 17:21:11 +0200
From: Kai Poitschke <kai.poitschke@axense.com>
To: Augur the Genius <augur@icelord.net>
Subject: Re: [q] Timing of a simple looping cycle PERL vs C
Message-Id: <376FA9E7.78937771@axense.com>
I think a reasonable amount of time is used for starting the perl interpreter
and compiling the programm.
You should measure the time used inside the programm not outside with time
perl ...
kai.poitschke@computer.org
------------------------------
Date: Tue, 22 Jun 1999 15:32:16 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: [q] Timing of a simple looping cycle PERL vs C
Message-Id: <3777ac21.8088035@news.skynet.be>
Augur the Genius wrote:
>#!/usr/bin/perl
>for ($i=1; $i<=5000000; $i++){++$a;} print $a, "\n";
>Here is a question: is there any best method to do this loop on perl?
It's not the loop. It's the printing. take it out, and see the
difference. I hope. :-)
>%time perl d.pl
>5000000
>13.59user 0.02system 0:13.79elapsed 98%CPU\
>Don't you think that 14 seconds for a perl variant is too far against even
>0.25sec for .c variant?
Where does the C version print to?
Bart.
------------------------------
Date: Tue, 22 Jun 1999 15:15:32 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: A month behind using localtime(time) ?
Message-Id: <oMNb3.923$7X1.235849@news.shore.net>
Malcolm Ray <M.Ray@ulcc.ac.uk> wrote:
: Stop programming by guesswork, or take up another trade.
Or move to Redmond. :)
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Tue, 22 Jun 1999 15:29:09 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: A month behind using localtime(time) ?
Message-Id: <3776abbc.7986699@news.skynet.be>
Mark Conlin wrote:
>Does that mean that January is $mon 0 ?
Yup.
Bart.
------------------------------
Date: Tue, 22 Jun 1999 11:32:30 -0400
From: Mark Conlin <Mark.Conlin@bridge.bellsouth.com>
Subject: Re: A month behind using localtime(time) ?
Message-Id: <376FAC8E.27ABF233@bridge.bellsouth.com>
> Sigh - why not read the docs to see why this is so?
> It uses the underlying C library which does the same thing - also
> documented.
Becuase I do not have a good book with me right now and in addition
my connection is so slow that it is almost impossible to search
through faqs online.
> Yes. Note that this means that an array of month names can be
> used directly without having to adjust the value.
Thanks, I wanted to know why, and this make sense.
Mark
------------------------------
Date: Tue, 22 Jun 1999 11:42:03 -0400
From: Mark Conlin <Mark.Conlin@bridge.bellsouth.com>
Subject: Re: A month behind using localtime(time) ?
Message-Id: <376FAECB.7EE7D5B0@bridge.bellsouth.com>
> Stop programming by guesswork, or take up another trade.
Now, be nice. If is so troublesome of a task to read and reply to
this message that you feel the need to insult me then why did you
do it ? No one is forcing you to respond.
I don't have a reference book here and my connection is so terrible
that it makes using the web faqs impossible. In addition the fact that
I did not understand the behavior of a perl command does not mean that
I need to switch jobs.
Mark
------------------------------
Date: Tue, 22 Jun 1999 15:50:36 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: A month behind using localtime(time) ?
Message-Id: <376fafe6.799519@news.insnet.net>
On Tue, 22 Jun 1999 10:20:21 -0400, Mark Conlin
<Mark.Conlin@bridge.bellsouth.com> said:
>When I use [localtime] I end up with $mon, being 5, correct me if
>I am wrong but it is June isn't. No big deal I just add one, I was
>just wondering why PERL does this.
You don't know _why_ you're getting 5, so you just add one anyway?
Does this not seem a little dangerous? This attitude is analogous to
the person who says "I wonder what this button does. Let's press it
anyway and find out".
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: 22 Jun 1999 09:52:55 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: A month behind using localtime(time) ?
Message-Id: <376fb157@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Mark Conlin <Mark.Conlin@bridge.bellsouth.com> writes:
:($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
:localtime(time);
:
:When I use this command I end up with $mon, being 5, correct me if
:I am wrong but it is June isn't. No big deal I just add one, I was
:just wondering why PERL does this.
:
:Does that mean that January is $mon 0 ?
No, it implies that you don't know how to read the documentation.
Do I smell a Prisoner of Bill?
% man 3 localtime
CTIME(3) CTIME(3)
NAME
asctime, ctime, difftime, gmtime, localtime, mktime - con-
vert date and time to ASCII
SYNOPSIS
#include <sys/types.h>
#include <time.h>
extern char *tzname[2];
void tzset()
char *ctime(clock)
const time_t *clock;
double difftime(time1, time0)
time_t time1;
time_t time0;
char *asctime(tm)
const struct tm *tm;
struct tm *localtime(clock)
const time_t *clock;
struct tm *gmtime(clock)
const time_t *clock;
time_t mktime(tm)
struct tm *tm;
DESCRIPTION
Ctime converts a time_t, pointed to by clock, representing
the time in seconds since 00:00:00 UTC, 1970-01-01, and
returns a pointer to a 26-character string of the form
Thu Nov 24 18:22:48 1986\n\0
All the fields have constant width.
Localtime and gmtime return pointers to ``tm'' structures,
described below. Localtime corrects for the time zone and
any time zone adjustments (such as Daylight Saving Time in
the U.S.A.). After filling in the ``tm'' structure,
localtime sets the tm_isdst'th element of tzname to a
pointer to an ASCII string that's the time zone abbrevia-
tion to be used with localtime's return value.
Gmtime converts to Coordinated Universal Time.
Asctime converts a time value contained in a ``tm'' struc-
ture to a 26-character string, as shown in the above exam-
ple, and returns a pointer to the string.
Mktime converts the broken-down time, expressed as local
time, in the structure pointed to by tm into a calendar
1
CTIME(3) CTIME(3)
time value with the same encoding as that of the values
returned by the time function. The original values of the
tm_wday and tm_yday components of the structure are
ignored, and the original values of the other components
are not restricted to their normal ranges. (A positive or
zero value for tm_isdst causes mktime to presume initially
that summer time (for example, Daylight Saving Time in the
U.S.A.) respectively, is or is not in effect for the
specified time. A negative value for tm_isdst causes the
mktime function to attempt to divine whether summer time
is in effect for the specified time.) On successful com-
pletion, the values of the tm_wday and tm_yday components
of the structure are set appropriately, and the other com-
ponents are set to represent the specified calendar time,
but with their values forced to their normal ranges; the
final value of tm_mday is not set until tm_mon and tm_year
are determined. Mktime returns the specified calendar
time; If the calendar time cannot be represented, it
returns -1.
Difftime returns the difference between two calendar
times, (time1 - time0), expressed in seconds.
Declarations of all the functions and externals, and the
``tm'' structure, are in the <time.h> header file. The
structure (of type) struct tm includes the following
fields:
int tm_sec; /* seconds (0 - 60) */
int tm_min; /* minutes (0 - 59) */
int tm_hour; /* hours (0 - 23) */
int tm_mday; /* day of month (1 - 31) */
int tm_mon; /* month of year (0 - 11) */
int tm_year; /* year - 1900 */
int tm_wday; /* day of week (Sunday = 0) */
int tm_yday; /* day of year (0 - 365) */
int tm_isdst; /* is summer time in effect? */
char *tm_zone; /* abbreviation of timezone name */
long tm_gmtoff; /* offset from UTC in seconds */
The tm_zone and tm_gmtoff fields exist, and are filled in,
only if arrangements to do so were made when the library
containing these functions was created. There is no guar-
antee that these fields will continue to exist in this
form in future releases of this code.
Tm_isdst is non-zero if summer time is in effect.
Tm_gmtoff is the offset (in seconds) of the time repre-
sented from UTC, with positive values indicating east of
the Prime Meridian.
FILES
/usr/share/zoneinfo time zone information
2
CTIME(3) CTIME(3)
directory
/usr/share/zoneinfo/localtime local time zone file
/usr/share/zoneinfo/posixrules used with POSIX-style TZ's
/usr/share/zoneinfo/GMT for UTC leap seconds
If /usr/share/zoneinfo/GMT is absent, UTC leap seconds are
loaded from /usr/share/zoneinfo/posixrules.
SEE ALSO
getenv(3), strftime(3), tzset(3), time(3), tzfile(5)
NOTES
The return values point to static data; the data is over-
written by each call. The tm_zone field of a returned
struct tm points to a static array of characters, which
will also be overwritten at the next call (and by calls to
tzset).
Avoid using out-of-range values with mktime when setting
up lunch with promptness sticklers in Riyadh.
3
=====================================================================
% man 3pl localtime
NAME
localtime - convert UNIX time into record or string using local
time
SYNOPSIS
localtime EXPR
DESCRIPTION
Converts a time as returned by the time function to a 9-element
list with the time analyzed for the local time zone. Typically
used as follows:
# 0 1 2 3 4 5 6 7 8
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time);
All list elements are numeric, and come straight out of a struct
tm. In particular this means that $mon has the range `0..11' and
$wday has the range `0..6' with sunday as day `0'. Also, $year
is the number of years since 1900, that is, $year is `123' in
year 2023, and *not* simply the last two digits of the year. If
you assume it is, then you create non-Y2K-compliant programs--
and you wouldn't want to do that, would you?
If EXPR is omitted, uses the current time (`localtime(time)').
In scalar context, returns the ctime(3) value:
$now_string = localtime; # e.g., "Thu Oct 13 04:54:34 1994"
This scalar value is not locale dependent, see the perllocale
manpage, but instead a Perl builtin. Also see the `Time::Local'
module, and the strftime(3) and mktime(3) function available via
the POSIX module. To get somewhat similar but locale dependent
date strings, set up your locale environment variables
appropriately (please see the perllocale manpage) and try for
example:
use POSIX qw(strftime);
$now_string = strftime "%a %b %e %H:%M:%S %Y", localtime;
Note that the `%a' and `%b', the short forms of the day of the
week and the month of the year, may not necessarily be three
characters wide.
--
"We all agree on the necessity of compromise. We just can't agree on
when it's necessary to compromise."
--Larry Wall in <1991Nov13.194420.28091@netlabs.com>
------------------------------
Date: 22 Jun 1999 15:52:05 GMT
From: haeb@haeb.noc.easynet.net (Harry Broomhall)
Subject: Re: A month behind using localtime(time) ?
Message-Id: <7kobf5$tpv$1@quince.news.easynet.net>
In article <376FAC8E.27ABF233@bridge.bellsouth.com>,
Mark Conlin <Mark.Conlin@bridge.bellsouth.com> writes:
[SNIP]
> Becuase I do not have a good book with me right now and in addition
> my connection is so slow that it is almost impossible to search
> through faqs online.
Why not use the local perldoc system? I wouldn't *dream* of trying to
write Perl (or any language for that matter) without adequate
documentation at hand.
Regards,
Harry.
------------------------------
Date: Tue, 22 Jun 1999 06:55:41 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: A month behind using localtime(time) ?
Message-Id: <d3qnk7.3iv.ln@magna.metronet.com>
Mark Conlin (Mark.Conlin@bridge.bellsouth.com) wrote:
: Does that mean that January is $mon 0 ?
Since you are unable to read about the function you are calling,
you are just going to have to wait a few months and try it.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 22 Jun 1999 16:08:03 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: Apache + Perl
Message-Id: <376FA6D3.6FA7DC02@ericsson.com>
ivanwalsh@my-deja.com wrote:
>
> Hello All,
>
> **newbie - please be patient **
>
> I want to test Perl on my Win98 workstation at home and have read that
> I can use ActivePerl for the Perl installation and Apache for the
> server site.
>
> My question is, will setting up Apache on my workstation effect Windows
> on any way. In other words can they both be installed on the same
> machine without destroying each other.
Yes. Put the Red Hat CD in the drive, turn it on, select "Install",
accept all the defaults, and when it's finished - reboot. You won't be
sorry.
Matt.
------------------------------
Date: 22 Jun 1999 09:16:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: bulk emailing
Message-Id: <slrn7mv6mc.k1b.abigail@alexandra.delanet.com>
Dani Koesterich (mrdank@sprintmail.com) wrote on MMCXXI September
MCMXCIII in <URL:news:7kn68q$kn6$1@holly.prod.itd.earthlink.net>:
() Hello.
()
() I created a script that takes an email database file, and a message file and
() sends the message to each person in the email database file. I have over
() 10,000 emails in my database and growing (it is a newsletter) and it gave me
() an error after email #950 so I figured it was because I wasn't letting my
Sooooo, what was the error? You should also check the return values of
your open() and close () statements.
() server rest, so I made the script pause for 3 minutes every 200 emails and
() started from email #951. It did 200 emails and paused for 3 minutes, then
() gave me an error after email #237 and a friend of mine suggested that it was
() because the email address in use had an invalid host or something.... I have
() attached the script to the end of this message, and if anyone could tell me
() how to make sure the email address works before sending out the mail, I
() would be very appreciative. Thank You.
That sounds like a problem with your mail program, which is beyond the
scope of this group. Ask elsewhere.
Abigail
--
perl -wlne '}for($.){print' file # Count the number of lines.
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 22 Jun 1999 08:09:25 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: can you split a word into letters?
Message-Id: <MPG.11d946eeb08629fd989c19@nntp.hpl.hp.com>
In article <7knmqi$4te$1@nnrp1.deja.com> on Tue, 22 Jun 1999 09:59:49
GMT, kkostenbader@my-deja.com <kkostenbader@my-deja.com> says...
> Try this:
>
> @letters = split(//, $word);
> $firstletter = $letters[0];
#!/usr/local/bin/perl -w
use strict;
use Benchmark;
my $word = 'internationalization';
timethese(1 << (shift || 0), {
Regex => sub { $word =~ /(.)/; $1 },
Split0 => sub { (split //, $word)[0] },
Split1 => sub { (split //, $word, 2)[0] },
Substr => sub { substr $word, 0, 1 },
});
__END__
Benchmark: timing 262144 iterations of Regex, Split0, Split1, Substr...
Regex: 4 wallclock secs ( 3.51 usr + 0.00 sys = 3.51 CPU)
Split0: 47 wallclock secs (47.12 usr + 0.00 sys = 47.12 CPU)
Split1: 8 wallclock secs ( 8.18 usr + 0.00 sys = 8.18 CPU)
Substr: 1 wallclock secs ( 1.53 usr + 0.00 sys = 1.53 CPU)
> In article <slrn7mrfec.k1b.abigail@alexandra.delanet.com>,
> abigail@delanet.com wrote:
...
> > sub pohc (@) {
> > my $r;
> > foreach my $s (@_ ?
> > @_ :
> > $_) {
> > $s = reverse $s;
> > $r = chop $s;
> > $s = reverse $s;
> > }
> > $r;
> > }
I couldn't bring myself to time this one, because it is so 'obviously'
facetious. But the 'split' suggestions (in this and another thread)
weren't.
Considering how many readers may not realize what 'Perl humor' is, or
may not have the skills yet to differentiate unlabeled humor from
serious answers, this trend is turning cruel and perhaps costly. If
we're trying to be funny, we should say so.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 22 Jun 1999 08:42:11 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: cannot use |- multiple times
Message-Id: <Pine.GSO.4.02A.9906220836450.1698-100000@user2.teleport.com>
On Mon, 21 Jun 1999, Dave Meyer wrote:
> I'm trying to use the |- argument to open() to fork several child
> processes which the parent can communicate with. If I try this with
> one child, I get the behavior I expect; if I try this with two (or
> more) children, my program blocks trying to write to the second child.
The problem seems to be that the second child still has a filehandle open
for writing to the first. But if you close a piped filehandle, you have to
wait for that process to finish.
Instead, you should fork the child processes with fork(), "manually"
setting up the pipe to each one. Then, each child process should close the
pipes to the others. Since you didn't create these with a piped open, Perl
won't wait for the other process to quit.
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 22 Jun 1999 11:00:19 -0400
From: scholl@xena.acsu.buffalo.edu (Edward P Scholl)
Subject: catching directory updates
Message-Id: <7ko8e3$95r$1@xena.acsu.buffalo.edu>
hello,
i have a script that does a bunch of file conversions
when called. is there a way to have the script "listen"
to the directory, so when a new file is added, it automaticall
starts the conversion? thanks.
-ed
------------------------------
Date: Tue, 22 Jun 1999 08:10:37 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: CGI::Push Problem
Message-Id: <Pine.GSO.4.02A.9906220808090.1698-100000@user2.teleport.com>
On Sun, 20 Jun 1999, Uwe W. Gehring wrote:
> I am testing server push with CGI::Push. While NS Comm. (4.x) is
> displaying my page correctly, IE (4.x, 5.x) does not. Instead, each
> new "page" is appended to the page before, seems IE is ignoring the
> boundary info.
It may be that your code (or the module's) isn't following the protocol.
Check with the docs, FAQs, and newsgroups about the protocol to be sure.
> Any help appreciated (can anyone point me to a newsgroup where cgi
> related topics are being discuss?).
I think you want comp.infosystems.www.authoring.cgi . Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 22 Jun 1999 14:59:19 GMT
From: dico@internetworks.ca (Dico Reyers)
Subject: DBI / mSQL installion problem: Fetchhash not working
Message-Id: <376fa6f8.5733598@news.attcanada.net>
I tried installing an earlier version of the module and some progres!
But command fetchhash doesnt work!
Could you post this..
Thanks,
Regards Sree
#!/usr/bin/perl
use DBI;
$dbh = DBI->connect("DBI:mSQL:database=schogini-test-database");
$sth = $dbh->prepare("SELECT * FROM sampletable");
$sth->execute;
@arr=$sth->fetchrow(); #This works
print @arr,"\n"; #This works
%hash=$sth->fetchhash(); #This gives the follwoing error!!
-----------------------------------------------
Can't locate object method "fetchhash" via package "DBI::st" at
/usr/home/jimmy/
msql/test.pl line 15.
-----------------------------------------------
Modules used...
dbi-1.11.tar.gz
data-showtable-3.3.tar.gz
msql-mysql-modules-1.2017.tar.gz
mSql version
msql-2.0.10.tar.gz
------------------------------
Date: 22 Jun 1999 09:58:45 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: DIE DIE DIE Prisoners of Bill (was: How many questions about localtime?)
Message-Id: <376fb2b5@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Matt Sergeant <matt.sergeant@ericsson.com> writes:
:How many questions about the return values of localtime() does it take
:before one goes mad reading this ng?
I don't know. I lost it after the first few hundred.
WHINGE WHINGE WHINGE. "I'm a Prisoner of Bill. I have no documentation.
I need no documentation. Write my program for me now, damn you.
Fricking idiots.
I'm reposting the perlfunc and perlfaq entries. I haven't updated them
with your input. Oh well.
I strong encourage *everyone* to mail the whole flipping manual to *anyone*
who asks an RTFM *everytime* they do so.
--tom
--
"OSI: Same day service in a nanosecond world" Van Jacobsen.
T-shirt he produced for an Interop, a few years ago.
------------------------------
Date: Tue, 22 Jun 1999 11:50:55 -0400
From: "Seth Rothberg" <sethr@crocker.com>
Subject: Exporting variables from a module
Message-Id: <930066715.274.89@news.remarQ.com>
Hi,
I'm building a module that needs to export some variables. It looks
something like this:
package Citizenship;
use strict;
use vars qw(@ISA @EXPORT);
use Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(buildCheckboxes $dbPath $entryFile $entriesPath
$catagoriesFile $catagoriesPath
$catTemplate $catRecordSize $keywordsFile $keywordsPath
$unpackEntryTemplate
$packEntryTemplate $entrySize $keywordsTemplate $keywordsRecordSize
);
$dbPath = '/path/to/database/files/';
$entryFile = 'entries.db';
$entriesPath = $dbPath.$entryFile;
$catagoriesFile = 'catagories.db';
$catagoriesPath = $dbPath.$catagoriesFile;
$catTemplate = 'iA50';
$catRecordSize = 54;
$keywordsFile = 'keywords.db';
$keywordsPath = $dbPath.$keywordsFile;
$unpackEntryTemplate = 'iA20A40A5000L';
$packEntryTemplate = 'ia20a40a5000L';
$entrySize = 5068;
$keywordsTemplate = 'ii';
$keywordsRecordSize = 8;
sub buildCheckboxes{}
1;
I guess I'm not reading the documentation correctly because it seems to
indicate that I should be able export these variables using the @EXPORT
array and a "use Citizenship;" line in the importing file. Yet when I test
the code in the module (perl -cw Citizenship.pm) I get the following error
messages: "Global symbol xyz requires explicit package name at
Citizenship.pm line n."
My ignorance is complete. What's an explicit package name? How do I indicate
it? Finally, can I even do what I'm trying to do?
Thanks,
Seth Rothberg
------------------------------
Date: Tue, 22 Jun 1999 16:10:06 +0100
From: Chi-Chiang Shei <shei@dai.ed.ac.uk>
Subject: foreach and while (<FILE>)
Message-Id: <376FA74E.63C6@dai.ed.ac.uk>
Hello:
Why does while (<FILE>) work only once (for the first element of @array)
in the following extract:
foreach $element (@index) {
while (<FILE>) {
print if (/$element/)
}
}
How can I do the while bit for each element of @index?
Chris
------------------------------
Date: Tue, 22 Jun 1999 06:59:16 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: foreach and while (<FILE>)
Message-Id: <4aqnk7.3iv.ln@magna.metronet.com>
Chi-Chiang Shei (shei@dai.ed.ac.uk) wrote:
: Why does while (<FILE>) work only once (for the first element of @array)
It does not work *at all*, let alone once.
The FILE filehandle is not defined anywhere that we can see..
: in the following extract:
: foreach $element (@index) {
: while (<FILE>) {
: print if (/$element/)
: }
: }
: How can I do the while bit for each element of @index?
Maybe you want to have an open() call in there somewhere?
We cannot help you much since,
1) you have not given the relevant code
2) you have not described what you want to do
(does @index contain the names of files or something?)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 22 Jun 1999 16:01:12 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: fork on NT
Message-Id: <376FA538.C2A076CF@ericsson.com>
Scott McMahan wrote:
>
> Philip DiFalco (phlippy@bellatlantic.net) wrote:
> > when will fork() be available on NT?
>
> The UNIX fork() call is impossible on NT because of differences in the
> process model between the operating systems. NT can't fork(). I discuss
> why in my book, coming out in August.
>
> Some runtime systems now have fork(), but to use it you normally have
> to use the runtime system and give up being a native Win32 program.
> I am interested to see if this will be the case with the native
> Perl interpreter.
Just to clarify:
Using run-time systems like Cygwin32 and OpenNT and U/Win still allows
you to have a native Win32 program - you're just linking against their
DLL, just as you do with MFC or any other runtime library. So emulating
fork() is possible on NT, but it is just that - an emulation. It's not a
native system call. The next major release of perl for Win32 from
ActiveState (should be build 6xx) will have an emulated fork() built in.
I'll be interested to read that explanation, and compare it to cygnus'
description of how the emulate fork() in cygwin32. I also look forward
to the public release of AT&T's U/Win source code.
Matt.
------------------------------
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 6091
**************************************