[13670] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1080 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 15 16:07:47 1999

Date: Fri, 15 Oct 1999 13:07:32 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <940018051-v9-i1080@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 15 Oct 1999     Volume: 9 Number: 1080

Today's topics:
        System or Pipe was(Re: Pipe errors on close()) (Bill Moseley)
    Re: System or Pipe was(Re: Pipe errors on close()) <rootbeer@redcat.com>
    Re: System or Pipe was(Re: Pipe errors on close()) (Alan Curry)
    Re: System or Pipe was(Re: Pipe errors on close()) <ltl@rgsun5.viasystems.com>
        taint ain't workin <jheck@xman.com>
    Re: taint ain't workin <cassell@mail.cor.epa.gov>
    Re: taint ain't workin <rootbeer@redcat.com>
    Re: taint ain't workin <jheck@xman.com>
    Re: tell() works incorrectly in windows (M.J.T. Guy)
    Re: tell() works incorrectly in windows <jseigh@bbnplanet.com>
        The agony of success... emlyn_a@my-deja.com
        Time in $time <ceesbakk@casema.nl>
    Re: Time in $time (Michael Budash)
    Re: Time in $time (Henry Penninkilampi)
    Re: Time in $time <wyzelli@yahoo.com>
    Re: Time in $time (Michael Budash)
    Re: Time in $time (Craig Berry)
    Re: Time in $time <uri@sysarch.com>
    Re: tmtowtdt? Getting the date <cassell@mail.cor.epa.gov>
    Re: tmtowtdt? Getting the date (Abigail)
        Too many open files error (Bob Mariotti)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 13 Oct 1999 13:52:38 -0700
From: moseley@best.com (Bill Moseley)
Subject: System or Pipe was(Re: Pipe errors on close())
Message-Id: <MPG.126e90ef152923e1989800@nntp1.ba.best.com>

lt lindley (ltl@rgsun5.viasystems.com) seems to say...
> Bill Moseley <moseley@best.com> wrote:
> :>I'm doing a pipe open to a program.  The program seems to run fine and 
> :>to completion (it's indexing a database).  But the close() is failing 
> :>and $? is returning the number 13.

Hit send too fast.

Can I use the system LIST (without passing through the shell) and have 
STDOUT goto /dev/null?

Or, If I want to run a program and just see it's return value, and throw 
away its STDOUT, what's the best way?


-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


------------------------------

Date: Wed, 13 Oct 1999 15:01:33 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: System or Pipe was(Re: Pipe errors on close())
Message-Id: <Pine.GSO.4.10.9910131448200.25558-100000@user2.teleport.com>

On Wed, 13 Oct 1999, Bill Moseley wrote:

> Can I use the system LIST (without passing through the shell) and have
> STDOUT goto /dev/null?

Well, yes, but you probably want to fork-and-exec, as below.

> Or, If I want to run a program and just see it's return value, and
> throw away its STDOUT, what's the best way?

Probably with one-arg system(), but that won't avoid the shell. Maybe you
want this, though it's not very portable.

    #!/usr/bin/perl -w

    use strict;

    # Running a command without shell, but ignoring output

    my @command = qw{ cat /etc/passwd /etc/doesnotexist };

    die "Can't fork: $!" unless defined(my $pid = fork);
    unless ($pid) {
	# Child here
	open STDOUT, ">/dev/null"
	    or die "Can't redirect stdout to /dev/null: $!";
	exec @command
	    or die "Can't exec: $!";
    }
    # Parent here
    waitpid($pid, 0);
    print "Exit status was $?.\n";

Of course, if you want to redirect STDIN, STDERR, or both, that can also
be done easily. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Wed, 13 Oct 1999 22:10:01 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: System or Pipe was(Re: Pipe errors on close())
Message-Id: <Zq7N3.1065$E_1.50156@typ11.nn.bcandid.com>

In article <MPG.126e90ef152923e1989800@nntp1.ba.best.com>,
Bill Moseley <moseley@best.com> wrote:
>Can I use the system LIST (without passing through the shell) and have 
>STDOUT goto /dev/null?
>
>Or, If I want to run a program and just see it's return value, and throw 
>away its STDOUT, what's the best way?

open(ORIGSTDOUT, '>&STDOUT');
open(STDOUT, '>/dev/null');
system("foo");
open(STDOUT, '>&ORIGSTDOUT');
-- 
Alan Curry    |Declaration of   | _../\. ./\.._     ____.    ____.
pacman@cqc.com|bigotries (should| [    | |    ]    /    _>  /    _>
--------------+save some time): |  \__/   \__/     \___:    \___:
 Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman


------------------------------

Date: 13 Oct 1999 22:32:04 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: System or Pipe was(Re: Pipe errors on close())
Message-Id: <7u3194$8f6$1@rguxd.viasystems.com>

Bill Moseley <moseley@best.com> wrote:

:>Can I use the system LIST (without passing through the shell) and have 
:>STDOUT goto /dev/null?

AFAIK, not unless the program takes an argument that lets you specify it.

:>Or, If I want to run a program and just see it's return value, and throw 
:>away its STDOUT, what's the best way?

Obviously, redirection with the shell interpreted "command >/dev/null"
was not what you had in mind.

The first thing I can think of is to dup STDOUT, then reopen it
into /dev/null.

#!/usr/lib/lprgs/perl -w
use strict;

open(DUPOUT, ">&STDOUT") 
	or die "Failed to dup STDOUT: $!";
open STDOUT, '>/dev/null' 
	or die "I guess it could have died with $!";
my $rc = system '/bin/cat', '/etc/hosts';
*STDOUT = *DUPOUT;
print "system command returned $rc\n";
__END__

Of course, at this point fd=1 still points to the bit bucket and any
other programs you system/exec will inherit that and so also write
STDOUT to the bit bucket as they are not impressed by the perl
typeglob trick.

So instead of that last typeglob assignment, you may be better off
duping STDOUT from DUPOUT.  Ooops.  Actually, I'm not certain that
the resulting file descriptor is guaranteed to be 1.  I think it
will as this is the behavior I normally see in C on the platforms
I've worked on, but I don't think any specification requires
that behavior.  I remember something about "return lowest numbered
descriptor available" from some dim corner, but...

Hmmm.  At this point I could rapidly confuse myself and so will now
bow out and let someone answer who knows.

-- 
// Lee.Lindley   /// I used to think that being right was everything.
// @bigfoot.com  ///  Then I matured into the realization that getting
////////////////////   along was more important.  Except on usenet.


------------------------------

Date: Tue, 12 Oct 1999 14:55:26 -0700
From: Jill Heck <jheck@xman.com>
Subject: taint ain't workin
Message-Id: <3803AE4E.59BD9728@xman.com>

Hi,

I'm trying to do something very simple:

#!/usr/bin/perl -T
open(FH, "> $ARGV[0]") or die;


and I'm getting:

Too late for "-T" option at custom.pl line 1.


instead of this:

Insecure dependency in open while running with -T switch at....


I pulled the example from the cookbook. 

What's wrong with this picture?

Thanks!

Jill


------------------------------

Date: Tue, 12 Oct 1999 15:54:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: taint ain't workin
Message-Id: <3803BC11.AE19F1BA@mail.cor.epa.gov>

Jill Heck wrote:
> 
> Hi,
> 
> I'm trying to do something very simple:
> 
> #!/usr/bin/perl -T
> open(FH, "> $ARGV[0]") or die;
> 
> and I'm getting:
> 
> Too late for "-T" option at custom.pl line 1.
> 
> instead of this:
> 
> Insecure dependency in open while running with -T switch at....
> 
> I pulled the example from the cookbook.
> 
> What's wrong with this picture?

Umm, what's wrong is you forgot to look in the perldiag pages 
to see what this error means.  Here's what you would have found
if you had gone there [BTW you can read the perldiag pages using
the command 'perldoc perldiag']:

Too late for "-T" option 
(X) The #! line (or local equivalent) in a Perl script contains the -T option,
but Perl was not invoked with -T in its command line. This is an error because,
by the time Perl discovers a -T in a script, it's too late to properly taint
everything from the environment. So Perl gives up. 

If the Perl script is being executed as a command using the #! mechanism (or its
local equivalent), this error can usually be fixed by editing the #! line so
that the -T option is a part of Perl's first argument: e.g. change perl -n -T to
perl -T -n. 

If the Perl script is being executed as perl scriptname, then the -T option must
appear on the command line: perl -T scriptname. 


Trust me, it's always easier to use the Perl docs than to
wait around for some snotty stranger to make a lame guess 
about what went wrong with your code.  :-)

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: Tue, 12 Oct 1999 16:35:44 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: taint ain't workin
Message-Id: <Pine.GSO.4.10.9910121634400.19155-100000@user2.teleport.com>

On Tue, 12 Oct 1999, Jill Heck wrote:

> Too late for "-T" option at custom.pl line 1.

Have you seen what the perldiag manpage has to say about this? Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Tue, 12 Oct 1999 17:05:19 -0700
From: Jill Heck <jheck@xman.com>
Subject: Re: taint ain't workin
Message-Id: <3803CCBF.6B8A57FD@xman.com>

Got it. 

Thanks.

Jill

David Cassell wrote:
> 
> Jill Heck wrote:
> >
> > Hi,
> >
> > I'm trying to do something very simple:
> >
> > #!/usr/bin/perl -T
> > open(FH, "> $ARGV[0]") or die;
> >
> > and I'm getting:
> >
> > Too late for "-T" option at custom.pl line 1.
> >
> > instead of this:
> >
> > Insecure dependency in open while running with -T switch at....
> >
> > I pulled the example from the cookbook.
> >
> > What's wrong with this picture?
> 
> Umm, what's wrong is you forgot to look in the perldiag pages
> to see what this error means.  Here's what you would have found
> if you had gone there [BTW you can read the perldiag pages using
> the command 'perldoc perldiag']:
> 
> Too late for "-T" option
> (X) The #! line (or local equivalent) in a Perl script contains the -T option,
> but Perl was not invoked with -T in its command line. This is an error because,
> by the time Perl discovers a -T in a script, it's too late to properly taint
> everything from the environment. So Perl gives up.
> 
> If the Perl script is being executed as a command using the #! mechanism (or its
> local equivalent), this error can usually be fixed by editing the #! line so
> that the -T option is a part of Perl's first argument: e.g. change perl -n -T to
> perl -T -n.
> 
> If the Perl script is being executed as perl scriptname, then the -T option must
> appear on the command line: perl -T scriptname.
> 
> Trust me, it's always easier to use the Perl docs than to
> wait around for some snotty stranger to make a lame guess
> about what went wrong with your code.  :-)
> 
> David
> --
> David Cassell, OAO                     cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician


------------------------------

Date: 13 Oct 1999 15:24:15 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: tell() works incorrectly in windows
Message-Id: <7u286v$1s1$1@pegasus.csx.cam.ac.uk>

Joe Seigh  <jseigh@bbnplanet.com> wrote:
>M.J.T. Guy wrote:
>> 
>> If you feed those values back into seek(), do you get the correct
>> behaviour?    I.e. does the following print "line2\n" ?
>> 
>>       open FH, "unix/file/as/above" or die "open: $!\n";
>>       seek FH, 0, 4;
>>       print scalar <FH>;
>> 
>
>Nope, seek is broke in that sense.  It puts you a the offset tell() returned,
>not where you would have read the same data that the subsequent read after tell
>would have returned.

So that's a bug, if only in the documentation.    Can you use the
perlbug program to report it?      Oh, and I should have asked earlier,
does this behaviour occur with the latest version of Perl?     Bugs do
sometimes get mended ...

>And, if I remember correctly, seek is a little bit twitchy on where you
>try to position it.  I think it didn't like being set where there was a
>CR and would bump up a character or two.  I had to resort to a little
>bit of hackery to get it to work in the look.pl rewrite.  The orginal
>look.pl, after doing a file system's buffer's worth of reads, tell()
>wasn't even in the right neighborhood.  No amount of hackery was going
>to get around that.

Well, perldoc perlport *does* say

     Due to the "text" mode translation, DOSish perls have
     limitations of using seek and tell when a file is being
     accessed in "text" mode.  Specifically, if you stick to
     seek-ing to locations you got from tell (and no others), you
     are usually free to use seek and tell even in "text" mode.
     In general, using seek or tell or other file operations that
     count bytes instead of characters, without considering the
     length of \n, may be non-portable.  If you use binmode on a
     file, however, you can usually use seek and tell with
     arbitrary values quite safely.

so you shouldn't be too surprised.   But the example above shows
that the case it describes as safe actually isn't.

And this stuff also ought to be documented in  README.win32.


Mike Guy


------------------------------

Date: Wed, 13 Oct 1999 16:51:32 GMT
From: Joe Seigh <jseigh@bbnplanet.com>
Subject: Re: tell() works incorrectly in windows
Message-Id: <3804B81E.C09F81C7@bbnplanet.com>

M.J.T. Guy wrote:
> 
> Joe Seigh  <jseigh@bbnplanet.com> wrote:
snip
> >M.J.T. Guy wrote:
> So that's a bug, if only in the documentation.    Can you use the
> perlbug program to report it?      Oh, and I should have asked earlier,
> does this behaviour occur with the latest version of Perl?     Bugs do
> sometimes get mended ...
> 
snip
> 
> Well, perldoc perlport *does* say
> 
>      Due to the "text" mode translation, DOSish perls have
>      limitations of using seek and tell when a file is being
>      accessed in "text" mode.  Specifically, if you stick to
>      seek-ing to locations you got from tell (and no others), you
>      are usually free to use seek and tell even in "text" mode.
>      In general, using seek or tell or other file operations that
>      count bytes instead of characters, without considering the
>      length of \n, may be non-portable.  If you use binmode on a
>      file, however, you can usually use seek and tell with
>      arbitrary values quite safely.
> 
> so you shouldn't be too surprised.   But the example above shows
> that the case it describes as safe actually isn't.
> 
> And this stuff also ought to be documented in  README.win32.

I've downloaded the latest ActiveState perl build, 520.  I was
using 515.  The bug is still there, so I've filed a bug report
with them on it.

Joe Seigh


------------------------------

Date: Fri, 15 Oct 1999 12:04:12 GMT
From: emlyn_a@my-deja.com
Subject: The agony of success...
Message-Id: <7u757m$d1k$1@nnrp1.deja.com>


> : I've figured out the problem anyway, and it's very much Perl-based.
>
>    I don't see (in this thread on deja) that you have shared
>    the solution.
>
>    I figure you are writing up another followup with that info
>    in it so that you can help the others here?
>
>    I am probably just too impatient.  Sorry, I'm sure it will show up.
>

I'm gettin' there, I'm gettin' there..! I figured since I was obviously
such a newbie, that you guys couldn't give two hoots what the Hell I
came up with...

Here's the magic, and hopefully I can go from here.

Within the parse subroutine, I included this:

$value =~ s/\%0D/<br>/g;
$value =~ s/\%0A//g;

For some reason, it's better to replace the %0D with HTML breaks (or
whatever you want) rather than both the %0D and %0A. It's better to
just replace %0A with nothing and let %0D do the spacing.

Result? It returns formatted text to the screen on print, and it writes
the entire contents of the textarea to a |field| with nice <br>s where
they should be.

I'm getting quite choked up now...

E.


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Fri, 15 Oct 1999 09:29:52 +0200
From: "Mark Bakker" <ceesbakk@casema.nl>
Subject: Time in $time
Message-Id: <3806d7c0$0$14202@reader2.casema.net>

I want to set the time in YYYY-MM-DD HH:MM:SS format in a string,
how do I do this? I can't Use print "%04d-%02d etc... because I do not print
this string but I have to put It in a MySQL database...

Please help...




------------------------------

Date: Fri, 15 Oct 1999 00:45:03 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: Time in $time
Message-Id: <mbudash-1510990045030001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>

In article <3806d7c0$0$14202@reader2.casema.net>, "Mark Bakker"
<ceesbakk@casema.nl> wrote:

>I want to set the time in YYYY-MM-DD HH:MM:SS format in a string,
>how do I do this? I can't Use print "%04d-%02d etc... because I do not print
>this string but I have to put It in a MySQL database...
>
>Please help...

one way (using current time):

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
$thisyear = $year + 1900;
$mon++;

$today_long = sprintf ("%04d-%02d-%02d %02d:%02d:%02d", $year+1900, $mon,
$mday, $hour, $min, $sec);

hope this helps-
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


------------------------------

Date: Fri, 15 Oct 1999 18:10:19 +0930
From: spamfree@metropolis.net.au (Henry Penninkilampi)
Subject: Re: Time in $time
Message-Id: <spamfree-1510991810200001@d6.metropolis.net.au>

In article
<mbudash-1510990045030001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>,
mbudash@sonic.net (Michael Budash) wrote:

> >I want to set the time in YYYY-MM-DD HH:MM:SS format in a string,
> >how do I do this? I can't Use print "%04d-%02d etc... because I do not print
> >this string but I have to put It in a MySQL database...
> >
> >Please help...
> 
> one way (using current time):
> 
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
> $thisyear = $year + 1900;
> $mon++;
> 
> $today_long = sprintf ("%04d-%02d-%02d %02d:%02d:%02d", $year+1900, $mon,
> $mday, $hour, $min, $sec);

Err, you've got a bit of redundant $year + 1900 going on...

Try this:

($ss,$mm,$hh,$DD,$MM,$YYYY) = localtime();
$dateTime = sprintf "%04d-%02d-%02d %02d:%02d:%02d",$YYYY+=1900,++$MM,
$DD,$hh,$mm,$ss;

Henry.


------------------------------

Date: Fri, 15 Oct 1999 21:46:51 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Time in $time
Message-Id: <UWEN3.5$GE1.825@vic.nntp.telstra.net>

Mark Bakker <ceesbakk@casema.nl> wrote in message
news:3806d7c0$0$14202@reader2.casema.net...
> I want to set the time in YYYY-MM-DD HH:MM:SS format in a string,
> how do I do this? I can't Use print "%04d-%02d etc... because I do not
print
> this string but I have to put It in a MySQL database...
>
> Please help...
>
Use sprintf rather than printf...

sprintf returns with the variable formatted as per printf

ie :
$timevar = sprintf "%04d-%02d etc etc

Wyzelli




------------------------------

Date: Fri, 15 Oct 1999 09:19:18 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: Time in $time
Message-Id: <mbudash-1510990919180001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>

In article <spamfree-1510991810200001@d6.metropolis.net.au>,
spamfree@metropolis.net.au (Henry Penninkilampi) wrote:

>In article
><mbudash-1510990045030001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>,
>mbudash@sonic.net (Michael Budash) wrote:
>
>> >I want to set the time in YYYY-MM-DD HH:MM:SS format in a string,
>> >how do I do this? I can't Use print "%04d-%02d etc... because I do not print
>> >this string but I have to put It in a MySQL database...
>> >
>> >Please help...
>> 
>> one way (using current time):
>> 
>> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
>> $thisyear = $year + 1900;
>> $mon++;
>> 
>> $today_long = sprintf ("%04d-%02d-%02d %02d:%02d:%02d", $year+1900, $mon,
>> $mday, $hour, $min, $sec);
>
>Err, you've got a bit of redundant $year + 1900 going on...
>
>Try this:
>
>($ss,$mm,$hh,$DD,$MM,$YYYY) = localtime();
>$dateTime = sprintf "%04d-%02d-%02d %02d:%02d:%02d",$YYYY+=1900,++$MM,
>$DD,$hh,$mm,$ss;
>
>Henry.

oops... thanks... it was late last nite...
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


------------------------------

Date: Fri, 15 Oct 1999 17:24:38 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Time in $time
Message-Id: <s0eoqm37r0179@corp.supernews.com>

Mark Bakker (ceesbakk@casema.nl) wrote:
: I want to set the time in YYYY-MM-DD HH:MM:SS format in a string,
: how do I do this? I can't Use print "%04d-%02d etc... because I do not print
: this string but I have to put It in a MySQL database...

  use POSIX;
  my $timestr = strftime '%Y-%m-%d %H:%M:%S', localtime;

By the way, for more general-purpose formatted writes to variables, see
sprintf ("string printf").

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "They do not preach that their God will rouse them
      a little before the nuts work loose." - Kipling


------------------------------

Date: 15 Oct 1999 13:45:35 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Time in $time
Message-Id: <x77lkoiklc.fsf@home.sysarch.com>

>>>>> "CB" == Craig Berry <cberry@cinenet.net> writes:

  CB>   my $timestr = strftime '%Y-%m-%d %H:%M:%S', localtime;

golf, anyone?

strftime '%Y-%m-%d %T', localtime;

there is no abbreviation for that date format, only for the time format.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


------------------------------

Date: Tue, 12 Oct 1999 15:34:36 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: tmtowtdt? Getting the date
Message-Id: <3803B77C.B967967B@mail.cor.epa.gov>

Henry Penninkilampi wrote:
[snip]
> ($YYYY,$MM,$DD) = (localtime)[5,4,3];
> $dateStamp = sprintf "%04d%02d%02d",$YYYY+1900,++$MM,$DD;

Umm, just a couple style issues here.  One, you really ought
to use lowercase or titlecase for your variables here, and
reserve uppercase-only for filehandles and dirhandles.  Two,
you ought to my() your variables too.

But thanks for adding your solution.

And *extra* thanks for using sprintf and getting the year
handled right!

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: 12 Oct 1999 23:23:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: tmtowtdt? Getting the date
Message-Id: <slrn808297.nk2.abigail@alexandra.delanet.com>

David Cassell (cassell@mail.cor.epa.gov) wrote on MMCCXXXIII September
MCMXCIII in <URL:news:3803B77C.B967967B@mail.cor.epa.gov>:
|| Henry Penninkilampi wrote:
|| [snip]
|| > ($YYYY,$MM,$DD) = (localtime)[5,4,3];
|| > $dateStamp = sprintf "%04d%02d%02d",$YYYY+1900,++$MM,$DD;
|| 
|| Umm, just a couple style issues here.  One, you really ought
|| to use lowercase or titlecase for your variables here, and
|| reserve uppercase-only for filehandles and dirhandles.  Two,
|| you ought to my() your variables too.

Hmm. Didn't put Larry all those funny thingies in front of variables
to distinguish them? I don't need lowercase/uppercase to see what's
a filehandle or not. If it has a leading '$', it isn't a filehandle.

And a reference to a filehandle, I usually use lowercase as well....



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


  -----------== 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: Wed, 13 Oct 1999 13:21:59 GMT
From: bobm@cunix.com (Bob Mariotti)
Subject: Too many open files error
Message-Id: <380486ec.64109520@news.earthlink.net>

We use perl for all our cgi programming running under Netscape
Fasttrack 2.01 on AIX 4.2.1.  Recently we have experiencing the
netscape server locking up and its error log shows "too many files
open".  The only thing that we have added recently is some javascript
to our perl generated web pages.

Has anyone seen this before and what perl issues MIGHT be causing
this?  I know this is a shot in the dark but any suggestions will be
greatly appreciated.

Bob Mariotti
Financial DataCorp
bobm@cunix.com



------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 1080
**************************************


home help back first fref pref prev next nref lref last post