[9697] in Perl-Users-Digest
Perl-Users Digest, Issue: 3291 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 30 00:07:31 1998
Date: Wed, 29 Jul 98 21:00:44 -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 Wed, 29 Jul 1998 Volume: 8 Number: 3291
Today's topics:
Re: Can't figure out how to remove newlines (Matthew Bafford)
Re: Can't figure out how to remove newlines (Matthew Bafford)
Re: CHOMP not working on some servers (Martien Verbruggen)
Counter Help Juli@my-dejanews.com
Re: Counter Help (Bob Trieger)
Re: Counting fork()s. (Martien Verbruggen)
Re: Coverage Tool? (Mark-Jason Dominus)
Re: cperl-mode vs vi (brian moore)
Re: cperl-mode vs vi (Matthew Bafford)
Re: cperl-mode vs vi (Paul D. Smith)
Re: cperl-mode vs vi <tchrist@mox.perl.com>
Re: deadlocking sockets (Martien Verbruggen)
GD.pm and Win95 problem aranya@my-dejanews.com
Re: Getopt::Std leaves =?iso-8859-1?Q?=24opt=5FXXX=B4s? <mpersico@erols.com>
Re: Help on my very short script using hash <mpersico@erols.com>
jotto: my first perl excursion (Jim Foltz)
Re: newbie Q: self-calling script? <mcope@hmc.edu>
perl5.005 and site-specific modules loaded prior to 5.0 <akira@discover-net.net>
Re: perl5.005 and site-specific modules loaded prior to <akira@discover-net.net>
perl5.005 threads: Where's the priority? <mschilli@blaxxun.com>
Re: reading a file listing? (Martien Verbruggen)
sendmail on NT server? <blackd1@hotmail.com>
Re: Using Perl to Determine default browser (Martien Verbruggen)
Re: Y2K problem in PERL with localtime() (John Stanley)
Re: Y2K problem in PERL with localtime() (John Stanley)
Re: Y2K problem in PERL with localtime() (John Stanley)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 30 Jul 1998 01:39:14 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Can't figure out how to remove newlines
Message-Id: <MPG.10299142cd968f1398968c@news.scescape.net>
In article <35BF66F1.51278300@acm.org> on Wed, 29 Jul 1998
18:06:52 GMT, Quinn,M (a) felt the following information to be of
use:
> would this work?
> $VariableName = chomp("$String");
This won't get the results you desire...
Chomp returns the number of characters chomped, not the chomped
string.
--Matthew
------------------------------
Date: Thu, 30 Jul 1998 01:39:25 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Can't figure out how to remove newlines
Message-Id: <MPG.10299155d028924998968d@news.scescape.net>
In article <35BF66F1.51278300@acm.org> on Wed, 29 Jul 1998
18:06:52 GMT, Quinn,M (a) felt the following information to be of
use:
> would this work?
> $VariableName = chomp("$String");
This won't get the results you desire...
Chomp returns the number of characters chomped, not the chomped
string.
--Matthew
------------------------------
Date: 30 Jul 1998 03:26:13 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: CHOMP not working on some servers
Message-Id: <6pop4l$gda$3@nswpull.telstra.net>
In article <35BE114D.83637A45@dircon.co.uk>,
Chris Denman <c-denman@dircon.co.uk> writes:
> I have been coding perl for 9 months and obviously have had no
> problems with CHOMP. Just recently I moved some code from one
it's chomp.
> server to another - a daily thing for me - and the code would
> not work at all. After a bit of debugging I found that chomp
'not work'? Can you get any more vague?
> only took the last character off of the string and left some
> crap (I thought that chomp took off all of the crap off the end
> of a string?).
# perldoc -f chomp
This is a slightly safer version of L</chop>. It removes any
line ending that corresponds to the current value of C<$/> (also known as
$INPUT_RECORD_SEPARATOR in the C<English> module).
What is ambiguous about that? If you set $/ to 'blafoobarnana', chomp
will remove that, and exactly that from the end of a scalar. Normally
it is set to newline, and chomp will remove exactly that from your
scalar. if you want it to remove 'crap', whatever that is, you'll have
to tell it. But I would investigate where that 'crap' is coming from.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Thu, 30 Jul 1998 01:21:42 GMT
From: Juli@my-dejanews.com
Subject: Counter Help
Message-Id: <6pohr6$aad$1@nnrp1.dejanews.com>
$count = @file;
$index = 0;
while ($index < $count) {
($one, $two, $three, $four) = split(" ", $file[$index]);
$index++;
print "$one $two $three $four";
}
What I'm doing is splitting elements in an array and printing each one.
What I would like to do, if for every other line, do something different
EX:
if index count is 0 print "<blue>$one $two $three $four";
if index count is 1 print "<green>$one $two $three $four";
if index count is 2 print "<blue>$one $two $three $four";
if index count is 3 print "<green>$one $two $three $four"; etc.....
Thanks much.
Juli@my-dejanews.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Thu, 30 Jul 1998 02:11:31 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Counter Help
Message-Id: <6poktm$ufj$1@strato.ultra.net>
[ posted and mailed ]
Juli@my-dejanews.com wrote:
-> $count = @file;
-> $index = 0;
->
-> while ($index < $count) {
->
-> ($one, $two, $three, $four) = split(" ", $file[$index]);
-> $index++;
-> print "$one $two $three $four";
-> }
->
-> What I'm doing is splitting elements in an array and printing each one.
->
-> What I would like to do, if for every other line, do something different
-> EX:
-> if index count is 0 print "<blue>$one $two $three $four";
-> if index count is 1 print "<green>$one $two $three $four";
-> if index count is 2 print "<blue>$one $two $three $four";
-> if index count is 3 print "<green>$one $two $three $four"; etc.....
The long way of doing it goes something like this:
foreach (@file) {
($one,$two,$three,$four) = split " ";
if ($i == 0) {
$color = "<blue>";
$i++
} else {
$color = "<green>";
$i = 0;
}
print "$color$one $two $three $four\n";
}
This was not tested and I barely put any thought into it, but you should be
able to figure it out.
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972
Ext: 1949 and let the jerk that answers know
that his toll free number was sent as spam. "
------------------------------
Date: 30 Jul 1998 03:22:03 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Counting fork()s.
Message-Id: <6poosr$gda$2@nswpull.telstra.net>
In article <6pk3v3$7cg$1@nnrp1.dejanews.com>,
dwiesel@my-dejanews.com writes:
> Ok. Now I have figured out the problem. The problem was that I can't fork as
> much as I want to. Therefore I have to check if my forking was a failure or
> not.
Do you actually read the replies to your posts? Posting this same
thing multiple times does not mean that you don't have to check all
the threads you start. You started this one, as well as one with the
subject 'fork() problem'. In that thread, you got an answer, and
sample code. Furthermore, you should use dejanews (you're actually
posting from there) to search through previous threads. I posted a
sample placeholder script not that long ago which does exactly what
you want.
Check these out:
Subject: Re: multiple forks???
From: mgjv@comdyn.com.au (Martien Verbruggen)
Date: 1998/07/20
Message-ID: <6ou3q5$3ku$1@nswpull.telstra.net>
Newsgroups: comp.lang.perl.misc
And check out your other thread that you started.
> Well, I still have some problems. I wan't to have a loop that continues until
> I have done all the forks that I want to do. Then at the end, I want to wait
> until all the forks are done.
That is what wait is for. You might also want a SIG{CHLD} handler.
Again: see the reference I mentioned above.
Suggested reading:
# perldoc -f fork
# perldoc -f wait
# perldoc perlipc
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: 29 Jul 1998 21:26:56 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Coverage Tool?
Message-Id: <6poi51$om5$1@monet.op.net>
In article <6poc16$rnt$1@mark.ucdavis.edu>,
Eric Sheng <shenge@ece.ucdavis.edu> wrote:
>I was wondering if there is any tools out there or inside the perl debugger
>that would keep track of which lines of the script has been hit or executed
>during run-time.
Devel::Coverage.
Available from http://www.perl.com/CPAN/modules/by-module/Devel/Devel-Coverage-0.1.tar.gz
------------------------------
Date: 30 Jul 1998 00:58:40 GMT
From: bem@news.cmc.net (brian moore)
Subject: Re: cperl-mode vs vi
Message-Id: <slrn6rvhac.1in.bem@thorin.cmc.net>
On Wed, 29 Jul 1998 15:34:16 -0700,
Brian Moseley <ix@maz.org> wrote:
> i use emacs (just started using cperl-mode), the rest of my team
> uses emacs. they check in code with tabs, i check in code with
> spaces. heartache ensues.
Well that's because you should be using vi. :)
> i've explored a bit, and it seems that cperl-mode, perl-mode,
> c-mode, java-mode all indent with spaces, none with tabs. fine.
> it sounds like i need some type of perl-mode hook that will run
> through the entire buffer and replace each tab character with the
> appropriate number of spaces. anything like that built into
> cperl-mode or emacs that i dont know about? alternatively, is
> there a variant of indent for perl that would achieve the same
> effect?
Look at expand(1) and unexpand(1).
--
Brian Moore Kill A Spammer For Jesus
Sysadmin, C/Perl Hacker, Usenet Vandal
------------------------------
Date: Thu, 30 Jul 1998 01:50:12 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: cperl-mode vs vi
Message-Id: <MPG.102993cd4c1989d098968e@news.scescape.net>
In article <35BFA368.61934CF6@maz.org> on Wed, 29 Jul 1998
15:34:16 -0700, Brian Moseley (a) felt the following information
to be of use:
> i use emacs (just started using cperl-mode), the rest of my team uses emacs.
> they check in code with tabs, i check in code with spaces. heartache ensues.
>
> i've explored a bit, and it seems that cperl-mode, perl-mode, c-mode, java-mode
> all indent with spaces, none with tabs. fine. it sounds like i need some type of
> perl-mode hook that will run through the entire buffer and replace each tab
> character with the appropriate number of spaces. anything like that built into
> cperl-mode or emacs that i dont know about? alternatively, is there a variant of
> indent for perl that would achieve the same effect?
>
If you just want to replace all tabs with a number of spaces, do
this:
perl -i -pe 's/\t/ /g;' file1 file2 file3 etc
Converting back to tabs is not easily done with a single regex,
as you have to take quotes, etc into account.
Hope this helps!
--Matthew
------------------------------
Date: 29 Jul 1998 21:40:16 -0400
From: psmith@baynetworks.com (Paul D. Smith)
To: Brian Moseley <ix@maz.org>
Subject: Re: cperl-mode vs vi
Message-Id: <p57m0ww1z3.fsf@baynetworks.com>
%% Brian Moseley <ix@maz.org> writes:
bm> i've explored a bit, and it seems that cperl-mode, perl-mode,
bm> c-mode, java-mode all indent with spaces, none with tabs. fine.
You didn't explore far enough! :)
Turn your Emacs help facility on the variable (C-h v) indent-tabs-mode.
bm> it sounds like i need some type of perl-mode hook that will run
bm> through the entire buffer and replace each tab character with the
bm> appropriate number of spaces. anything like that built into
bm> cperl-mode or emacs that i dont know about?
Next, examine the functions (C-h f) tabify, tabify-buffer, untabify, and
untabify-buffer.
--
-------------------------------------------------------------------------------
Paul D. Smith <psmith@baynetworks.com> Network Management Development
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions--Bay Networks takes no responsibility for them.
------------------------------
Date: 30 Jul 1998 03:02:38 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: cperl-mode vs vi
Message-Id: <6ponoe$i8h$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, dragons@scescape.net (Matthew Bafford) writes:
:perl -i -pe 's/\t/ /g;' file1 file2 file3 etc
That is terrible wrong! How much it expands depends on where the
tab falls. This is the standard algorithm:
perl -i -pe '1 while s/\t+/' ' x (length($&)*8 - length($`)%8)/e'
Or, more normally, just
:1,$perl -i -pe '1 while s/\t+/' ' x (length($&)*8 - length($`)\%8)/e'
The standard expand program does this, of course.
But the question arises: why is this a problem for you?
--tom
:set sw=4
:map! ^O {^M}^[O^T
--
I know it's weird, but it does make it easier to write poetry in perl. :-)
--Larry Wall in <7865@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: 30 Jul 1998 03:27:38 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: deadlocking sockets
Message-Id: <6pop7a$gda$4@nswpull.telstra.net>
In article <6pkhd5$k4p$1@nnrp1.dejanews.com>,
faganb@my-dejanews.com writes:
> deadlocking. Does anyone have a more extensive example of a send-receive-send
> scenario? I've got camel, llama, and leopard to no avail. I'm missing
# perldoc perlipc
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Thu, 30 Jul 1998 03:30:24 GMT
From: aranya@my-dejanews.com
Subject: GD.pm and Win95 problem
Message-Id: <6popch$it9$1@nnrp1.dejanews.com>
I have a simple 3 line script
use CGI(':standard');
use GD;
exit 0;
that gives the following error:
============ OUTPUT BEGIN =================
Can't find loadable object for module GD in @INC at graph.cgi line 2
BEGIN failed--compilation aborted at graph.cgi line 2.
============ OUTPUT END =================
I am running Perl on Win95
Running perl -v gives
============ OUTPUT BEGIN =================
This is perl, version 5.003_07
Copyright 1987-1996, Larry Wall
+ suidperl security patch
Win32 port Copyright (c) 1995-1996 Microsoft Corporation.
All rights reserved.
Developed by ActiveWare Internet Corp., http://www.ActiveWare.com
Perl for Win32 Build 310 - Built 19:24:08 Sep 4 1997
============ OUTPUT END =================
GD.pm is in my perl/lib directory. I copied it to the script directory also
just in case
Any ideas ?
Aranya
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 29 Jul 1998 22:33:34 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
To: ws97-868@wsrz1.wiso.uni-erlangen.de
Subject: Re: Getopt::Std leaves =?iso-8859-1?Q?=24opt=5FXXX=B4s?= UNDEFINED
Message-Id: <35BFDB7E.4AC0771C@erols.com>
Franz Kaufmann wrote:
> When I do a
> use Getopt::Std;
> and do a :
> getopt ("avl");
>
> perl doesn4t stop to complain about the $opt-variables being "possible
> typos" until I do a "local " on all the $opt.
>
Because if you are running with
#!/usr/local/bin/perl -w
any one-time usage of a variable is considered a warning in that, in
theory, a variable should appear twice: once when declared and once when
used. The options vars are excpetions, but the -w flag isn't that smart.
What I usually do is BEFORE I call getopt, I do a
$opt_variable = undef
for those options it complains about. That way:
1) The variable now appears twice.
2) Initialization is a good thing anyway.
3) The "local" might have scoping effects that are not desired.
------------------------------
Date: Wed, 29 Jul 1998 22:40:33 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
To: lloyd <lloyd007@best.com>
Subject: Re: Help on my very short script using hash
Message-Id: <35BFDD21.6DD7E0AF@erols.com>
Ouch!
You really need to read the doc page on perl types, for I fear you
haven't gotten it yet.
A hash is collection of paired data. The pair is a key and a value. They
key must be a string. The value can be anything.
%pass = (
'lloyd' => 'lloyd',
'yada' => 'yadayada'
);
Note the comma separating pairs and the => joining the key and values.
Now, you can also eliminate the quotes around the key because => implies
the left hand is a string.
HTH
------------------------------
Date: Thu, 30 Jul 1998 02:30:09 GMT
From: aa204@acorn.net (Jim Foltz)
Subject: jotto: my first perl excursion
Message-Id: <slrn6rvn1p.27d.aa204@pc1.net>
Hello:
Jotto is a word guessing game I used to play in the olden days on the
Commodore-64. Or was that the Amiga 1000? Who knows. It is probably not very
well written but it seems to work. There is room for much improvement such
as: using the system dictionary to pick the secret word, better user guess
checking, and various other things.
It can be downloaded from http://www2.acorn.net/~aa204/jotto.tar.gz
It's a pretty good game, really. It can be quite difficult, with a difficult
word list and I think it would make a nice addition to the free software
world. Please download it, try it, and send improvements to me at
aa204@acorn.net
Ok, that's it. Thanks for reading.
------------------------------
Date: 30 Jul 1998 01:16:48 GMT
From: Michael Thomas Cope <mcope@hmc.edu>
Subject: Re: newbie Q: self-calling script?
Message-Id: <6pohi0$dp0$1@cinenews.claremont.edu>
Joe Halbrook <joe@halbrook.com> wrote:
: I have a mulit-purpose script that I'd like to perform a do
: 'same-script' or use the 'eval' function to pass a different ACTION
: parm to itself and follow a different execution path. Is this possible?
You may want to use fork
type
perldoc perlfunc
and look for fork
or go to
http://www.perl.com/CPAN/doc/manual/html/pod/perlfunc/fork.html
You may also want to use exec
http://www.perl.com/CPAN/doc/manual/html/pod/perlfunc/exec.html
I wouldn't suggest using eval.
--
Michael Cope: Harvey Mudd College '00; Armand Hammer UWC '96
E-mail: Michael_Cope@hmc.edu
------------------------------
Date: Sat, 25 Jul 1998 13:38:33 -0500
From: Akira Hangai <akira@discover-net.net>
Subject: perl5.005 and site-specific modules loaded prior to 5.005
Message-Id: <35BA2629.1DF96E0B@discover-net.net>
Hi,
I just grabbed the perl5.005 distribution and compiled it, and I have a
question regarding the backward compatibility of all the site-specific
modules already installed prior to the 5.005.
After running the "make test", I checked the @INC.
Up to 5.004_0x, @INC contained:
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/site_perl/you_platform
/usr/local/lib/perl5/your_platform/5.00404
/usr/local/lib/perl5
But 5.005 @INC contains:
/usr/local/lib/perl5/site_perl/5.005
/usr/local/lib/perl5/site_perl/5.005/your_platform
/usr/local/lib/perl5/5.005/your_platform
/usr/local/lib/perl5/5.005
Does it mean I have to re-install *all* the add-on modules I ever
installed? Or is there any way to let 5.005 use the previously installed
modules?
Thanks,
--Akira
------------------------------
Date: Sat, 25 Jul 1998 14:41:51 -0500
From: Akira Hangai <akira@discover-net.net>
Subject: Re: perl5.005 and site-specific modules loaded prior to 5.005
Message-Id: <35BA34FF.54CEC52A@discover-net.net>
> Does it mean I have to re-install *all* the add-on modules I ever
> installed? Or is there any way to let 5.005 use the previously installed
> modules?
Well, I'm replying to my own post, but I do so in a hope that there are
some other people who had the same question as I posted *without*
reading the INSTALL file thoroughly like I did. :(
After reading the INSTALL file as well as an article on The Perl Journal
Issue #10 by Gurusamy sarathy, it looks like there are some ways to keep
(or not keep) the extensions installed for the previous version ( <
5.004_50) or perl:
1) Move all the add-on modules to each appropriate directory, and hope
they work, like:
mv $perllib/site_perl/* $perllib/site_perl/5.005/
mv $perllib/site_perl/$arch/* $perllib/site_perl/5.005/$arch
mv $perllib/* $perllib/5.005/
mv $perllib/$arch/$prev_version/* $perllib/5.005/$arch
2) Keep the copy of previous-version perl along with all the *old*
modules, and call it specifically by #!/path_to_prev_version_perl
3) Install the perl5.005 with a different prefix
or
4) Re-insall all the modules.
By the way, according to Gurusamy's article, perl5.005 supports lots of
new features, most notably Threads, as well as other
performance-enhancement features (foreach optimization, compiled regex,
unlimited-size regex, etc.). Kudos to those who are leading the
development!
--Akira
------------------------------
Date: Wed, 29 Jul 1998 18:06:44 -0700
From: Michael Schilli <mschilli@blaxxun.com>
Subject: perl5.005 threads: Where's the priority?
Message-Id: <35BFC724.28E4D1F5@blaxxun.com>
Hey all,
just played with the thread functions that come with perl 5.005 -
looking great! Just one question: Is there a priority that can be
assigned to a thread?
Thanks for any help ...
-- Michael
----------------------------------------------------------
Michael Schilli http://perlmeister.com
----------------------------------------------------------
------------------------------
Date: 30 Jul 1998 03:13:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: reading a file listing?
Message-Id: <6poocs$gda$1@nswpull.telstra.net>
In article <35BD9A1E.2251A196@usa.net>,
Jason Clark <clarkjason@usa.net> writes:
> I'm trying to quite simply read a file listing from a given directory.
# perldoc -f glob
or better:
# perldoc -f opendir
# perldoc -f readdir
# perldoc -f closedir
> $FileParttern = "<".$filename."*>";
> print $FilePatterm; # Returns
> <123.txt*>
>
> foreach $files ($FilePattern) # If I use <123.txt*> it
$fp = '123.txt*';
foreach $file (glob $fp)
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Wed, 29 Jul 1998 15:09:45 +0200
From: John <blackd1@hotmail.com>
Subject: sendmail on NT server?
Message-Id: <35BF1F19.B4C04A59@hotmail.com>
I'm learning perl for CGI-programming. When I read about sending mail
with perl, this 'sendmail' program is always used.
As I understand it, this only works on UNIX servers. My problem is that
the server I use is a NT web server, and this sendmail thing doesn't
work.
What is used on NT instead of sendmail?
Please help me. All i get from my ISP when I ask is: 'I don't know, but
I'll pass on the question'. But since I never hear from them again, I
guess they're not very interested in helping me.
/John
------------------------------
Date: 30 Jul 1998 02:57:58 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Using Perl to Determine default browser
Message-Id: <6ponfm$fit$1@nswpull.telstra.net>
In article <35BDBA94.6EE16E11@phoenix-int.com>,
"P.J. Henningson" <phenning@phoenix-int.com> writes:
> Is it possible to use perl (on WINNT) to determine
> the users default web browser (IE/Netscape)??
if you mean: Can I do this from a CGI script:
No. And it's not possible in any other language. What is the 'default'
web browser anyway to a CGI script?
If you mean: Can I run a script on a NT machine and find that
information?
Possibly. You might have to read the relevant stuf from the registry.
There are perl modules to do that sort of NT specific stuff.
www.activestate.com might have them. They might be available on
www.perl.com/CPAN/. You'll have to ask on a NT group what the relevant
registry key is.
More about CGI: The people on comp.infosystems.www.authoring.cgi will
probably be able to tell you which variables to inspect to find out,
with a certain degree of certainty, which browser people are using to
connect to your site.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: 30 Jul 1998 02:42:32 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Y2K problem in PERL with localtime()
Message-Id: <6pomio$9j3$1@news.NERO.NET>
In article <1VJv1.127$9t2.1498175@news3.voicenet.com>,
Matt Knecht <hex@voicenet.com> wrote:
>John Stanley <stanley@skyking.OCE.ORST.EDU> wrote:
>>I am
>>pointing out that 02-29-100 is not an unambiguous way of representing
>>the date. Period.
>
>Why is it so hard to follow the documentation?
It's not.
>An end user should
>_never_ see the date "02-29-100".
That's right.
>If they did, then the programmer
>introduced his own date bug.
That's right.
>If this is not the case, then no programs have bugs.
That's right.
>Of course not. The language works in specific ways. You have to follow
>the rules, or it won't work.
Well, in this part of the thread, we weren't talking about the rules for
the language. We were talking about 02-29-100 not being ambiguous. I see
nothing perl-specific in that string, which makes it hard to pin this on
a 'perl rules' problem.
------------------------------
Date: 30 Jul 1998 02:45:30 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Y2K problem in PERL with localtime()
Message-Id: <6pomoa$9jb$1@news.NERO.NET>
In article <1dcy3et.wxmmcqvp1ox5N@bay1-90.quincy.ziplink.net>,
Ronald J Kimball <rjk@coos.dartmouth.edu> wrote:
>John Stanley <stanley@skyking.OCE.ORST.EDU> wrote:
>> I'm sorry you didn't follow the context of the discussion. I am not
>> printing the report. I am not the one programming this example. I am
>> pointing out that 02-29-100 is not an unambiguous way of representing
>> the date. Period.
>
>I'm sorry you didn't follow the context of this discussion.
>
>02-29-100 was given as an example of the values you get from Perl's
>localtime function.
No, actually, it was the output of a printf.
>I have followed this entire thread, starting with a user who wanted to
>know why localtime returned a year of '100' instead of '00' in the year
>2000. Apparently, you didn't bother reading what you replied to.
And you didn't notice the thread changed.
------------------------------
Date: 30 Jul 1998 02:49:26 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Y2K problem in PERL with localtime()
Message-Id: <6pomvm$9jm$1@news.NERO.NET>
In article <6pnssp$l7i@mozo.cc.purdue.edu>,
Michael J Gebis <gebis@albrecht.ecn.purdue.edu> wrote:
>stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
>}At this point, nobody knows but you, since you did not bother to include
>}a single comment as to the desired funtion of your program. If you need
>}no newline at the end, and you want the string as it was returned, then
>}there appears to be no bug.
>
>Nope. I wanted to see "7/29/98".
Don't waste time disagreeing with me until you read what you are
disagreeing with. I said "IF" you wanted what you got, there was no bug.
That statement is quite true. Only when you want something else is a bug
present.
>I suspect it's because I didn't process the output of locatime
>correctly. By some strange coincidence, this might have some sort of
>relevance to the original post.
And no relevance the question of the date 02-29-100 being ambiguous.
>I do agree with the fact that 7/29/100 is a bad way of representing
>the date two years from now. Maybe that's your whole point.
Gosh. Maybe.
>My point
>is that it's not perl's fault that people can misuse localtime and get
>things like 7/29/100.
I don't believe anyone was saying the opposite.
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3291
**************************************