[9686] in Perl-Users-Digest
Perl-Users Digest, Issue: 3280 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 28 20:07:38 1998
Date: Tue, 28 Jul 98 17: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 Tue, 28 Jul 1998 Volume: 8 Number: 3280
Today's topics:
Re: Could somebody help me? (Andrew M. Langmead)
Re: DBM Files with Hashes of Arrays <zenin@bawdycaste.org>
Re: Flat-File Database fitzmeyer@my-dejanews.com
Re: fork() problem (Martien Verbruggen)
Re: glob wrecks foreach loop! <tchrist@mox.perl.com>
Help Regarding Perl Extensions. <somu@cs.fsu.edu>
Re: Im Willing to pay or give a free DOMAIN for a custo (Martien Verbruggen)
Re: Inheritance broken when objects share a file? Karmadon@my-dejanews.com
Opendir and Write Not Working Like Planned... (Vikram Pant)
Re: Opendir and Write Not Working Like Planned... (Martien Verbruggen)
Re: perl complier for ms dos indhiraa@hotmail.com
Re: Pid number of called process?? danzuck@my-dejanews.com
Programmer's Editor <xidicone@iname.com>
Re: Same code, diff machines, diff results (nobody)
Re: seeing if a file exists. (Martien Verbruggen)
Understand References Today (Mark-Jason Dominus)
Using Perl Embed in Win32 C++ <ed@pdh.com>
Re: Using Perl to Determine default browser (Larry Rosler)
Re: Using Perl to Determine default browser (Martien Verbruggen)
Web Database Access with sub-queries. danzuck@my-dejanews.com
Re: Y2K problem in PERL with localtime() (Andrew M. Langmead)
Re: Y2K problem in PERL with localtime() (John Stanley)
Re: Zombies from Forking are Bad, says Sun <zenin@bawdycaste.org>
Re: Zombies from Forking are Bad, says Sun <rootbeer@teleport.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 28 Jul 1998 22:10:08 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Could somebody help me?
Message-Id: <Ewts8x.14K@world.std.com>
yukari yamashita <yukaari@gladstone.uoregon.edu> writes:
>I guess if you keep the each result saved in a file and update the
>result after each student is finished the survey and send back when the
>last student is finished.
Sounds like a reasonable way.
>But, is it possible? If so, how can I try to do it? I tried to launch
>C file, which reads a file and update the file, from .cgi file, but it
>seems not to work
My first question: Do you know that there is nothing special about the
perl language for righting programs that implement the CGI protocol?
If you know C, why not just write in C? Secondly, have you considered
using any of the debugging and problem solving techniques you must
have developed when gaining your C, C++, and Java expertise? (Knowing
that it doesn't work is the first step, from there you have to figure
out _how_ And until you figure out how it is failing, there is little
that any of us can do) And for my third and final question: Since you
have no concrete problems to blame on your perl code, have you
considered checking about the HTTP server, its configuration, and how
it goes about executing programs on your behalf?
With the little bit you gave us to go on, the only thing that I can
guess at is that your C program isn't running when called from your
perl script. Since the environment in which the HTTP server runs your
program is likely very different than your login environment. (Among
the differences: It probably runs as a different user ID than you do,
so it may not have access to the same files. It does not run your
shells startup files, so its and other PATH environment variable are
different.)
--
Andrew Langmead
------------------------------
Date: 28 Jul 1998 22:30:33 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: DBM Files with Hashes of Arrays
Message-Id: <901665636.656659@thrush.omix.com>
beaumack@my-dejanews.com wrote:
: Can I store this data in a DBM file or does anyone have a better way to store
: this information?
From perlfaq4:
How can I store a multidimensional array in a DBM file?
Either stringify the structure yourself (no fun), or else
get the MLDBM (which uses Data::Dumper) module from CPAN
and layer it on top of either DB_File or GDBM_File.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Tue, 28 Jul 1998 22:32:31 GMT
From: fitzmeyer@my-dejanews.com
Subject: Re: Flat-File Database
Message-Id: <6pljhu$6db$1@nnrp1.dejanews.com>
In article <35bc4f81.10469318@192.168.0.1>,
gareth_h@geocities.com wrote:
> On Mon, 20 Jul 1998 15:27:26 -0400, "Sam Spurling"
> <spurling@mindspring.com> wrote:
>
> >I am new to perl and am wanting to write a database that can be added to
> >deleted from and modified. Does anyone have an example that I can use to
> >see and understand how this works in perl.
> try having a look at dbman from
> http://www.gossamer-threads.com/
It's already been done and done well. Check out Selena Sol's Script
page: http://www.extropia.com/Scripts/
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 28 Jul 1998 22:53:30 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: fork() problem
Message-Id: <6plkpa$6j7$1@nswpull.telstra.net>
In article <6phf0q$m2e$1@nnrp1.dejanews.com>,
dwiesel@my-dejanews.com writes:
> Hi,
>
> I have a fork() problem. I can't figure out what is wrong. Look at this
> code...
First of all: your code runs fine for me. But I have some other
issues:
> $number_of_forks++;
> $pid = fork;
You increase the counter before forking. You don't check to see if the
fork was successful. If one of your forks is unsuccessful, you'll loop
forever.
> # If child
> if ($pid eq 0)
This is not really a very good way to test. You use eq, which is
_stringwise_ equality, to perform a numeric comparison. Besides, I
find this a bit counter intuitive.
This is how I would fork:
my $pid;
if(!defined($pid=fork))
{
# Cannot fork, log a message or something
}
elsif ($pid)
{
# I'm still the parent, just spawned a child, increase
# a counter, log a message, whatever
}
else
{
# I'm the child, do something useful here, and exit
}
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: 28 Jul 1998 23:04:11 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: glob wrecks foreach loop!
Message-Id: <6plldb$hi7$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, John.Adams@BentonvilleAR.ncr.com writes:
:I've tried to figure this out since last week, and I'm still stumped.
Don't call glob() in scalar context. It will not make you happy.
--tom
--
God made the integers; all else is the work of Man.
--Kronecker
------------------------------
Date: Tue, 28 Jul 1998 19:04:46 -0400
From: Srinivas Somu <somu@cs.fsu.edu>
Subject: Help Regarding Perl Extensions.
Message-Id: <35BE590E.EF925D77@cs.fsu.edu>
Hi,
Iam new to writing extensions in perl and i have to write a extension
for an existing DLL.Did anybody try to do this earlier?It would be a
great help if I can get some information regarding this.I was trying to
use swig to do this on win95 but it seemed to give some problems.You can
send me your replies at somu@cs.fsu.edu .
Thanking you in advance,
somu.
Srinivas Somu
Computer Science Dept,FSU.
.... KEEP TRYING....
------------------------------
Date: 28 Jul 1998 22:55:42 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Im Willing to pay or give a free DOMAIN for a custom cgi!
Message-Id: <6plkte$6j7$2@nswpull.telstra.net>
In article <a0gjp6.jlb.ln@localhost>,
tadmc@flash.net (Tad McClellan) writes:
> method98 (method98@iname.com) wrote:
>: Can Anyone Make a Hidden Cgi that clicks on sponser
>: undectably to the user viewing the web page and the sponsers
>: IT MUST BE 110% UNDECTABLE TO THE SPONSERS AND THE USERS!!!
> 110% is nonsense...
Just like the rest of the article. 'a hidden cgi that clicks on
sponsor undetectably'. tsk.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Tue, 28 Jul 1998 21:50:04 GMT
From: Karmadon@my-dejanews.com
Subject: Re: Inheritance broken when objects share a file?
Message-Id: <6plh2c$2hg$1@nnrp1.dejanews.com>
In article <6pl00q$3f9$1@csnews.cs.colorado.edu>,
tchrist@mox.perl.com (Tom Christiansen) wrote:
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, Karmadon@my-dejanews.com writes:
> :Am I wrong assuming it as a bug?
>
> Yup. The only bug is your understanding of @ISA, I fear. :-(
>
That may well be the case, however, I fail to see how your answer
may help me to understand it better :-)
Regards,
-igor
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 28 Jul 1998 19:18:36 -0400
From: usenet@vikrampant.com (Vikram Pant)
Subject: Opendir and Write Not Working Like Planned...
Message-Id: <MPG.102826556835c2e8989682@newsdesk.tidalwave.net>
I am learning PERL and began writing a script that I find extremely
useful, when it works.
It will OPEN a directory, glob the files and write them to a HTML page,
close the HTML, close the directory and continue until no directories
exist.
Problem is that it is not opening the directories like I want it to,
instead it is writing to the script's base directory.
I was hoping someone could point out my error. I am assuming that it is
something basic, but for a week I have tried to understand opendir and I
think I am doing it right.
/midifest/Pop_Rock/
index.pl
Foo_Fighters/
Rolling_Stones_The/
I'd like it to open the music groups directory, write an HTML file, close
the file and directory and move on.
-------------------------------------
Full code below:
#!/usr/local/bin/perl
# Read All Directories
opendir(ALL, '.');
@All_Dir = readdir(ALL);
closedir(ALL);
# foreach $Dir (@All_Dir) {
# if (-d $Dir) { print "$Dir\n"; }
#}
foreach $Dir (@All_Dir) {
if (-d $Dir) {
opendir(TEST, "$Dir") or die "FAIL.\n";
# Getting File Names in Arrays
@MIDI_Files = glob('*.mid');
@MIDIPack_ZIP = glob('*.zip');
@Image_File = glob('*.jpg');
# The Default Information File
$Info_File = 'info.txt';
# Default Output File
$Output_File = 'index.shtml';
open(HTML, ">$Output_File") or die "You Suck.\n";
&return_html;
close(HTML);
print "TEST\n"; closedir (TEST); } }
sub return_html {
print HTML "<HTML>\n";
print HTML "<HEAD>\n";
print HTML "<TITLE>Vikram's MIDI-Fest: $Dir</TITLE>\n";
print HTML "<LINK REL=StyleSheet HREF=\"../stuff/Pop.Rock.css\"
";
print HTML " TYPE=\"text/css\">\n";
print HTML "</HEAD>\n";
print HTML "<BODY BGCOLOR=\"#FF0000\" TEXT=\"#FFFFFF\"
LINK=\"#FFFF00\">\n";
print HTML "\n\n<p>\ \;</p>\n\n<center> \n";
foreach $JPEG(@Image_File){
open(JPEG_IN, $JPEG);
print HTML "<img src=\"$JPEG\" alt=\" \" hspace=5
vspace=5> \n";
close(JPEG_IN);
}
print HTML "<p><table cellpadding=12 border=0 cellspacing=0>\n";
print HTML "<tr bgcolor=\"#000000\">\n";
print HTML "<td align=center><font size=4>Song
Title</font></td>";
print HTML "<td align=center><font size=4>Size</font>
(Kilobytes)</td></tr>\n";
# For Each Single MIDI File, Do This
foreach $MIDI (@MIDI_Files){
open(MIDI_IN, $MIDI);
# Get File Information Of Single File
@MIDI_Size = stat($MIDI);
# Chopping The File Size To KB
for($i=0; $i < 3; $i++){
chop(@MIDI_Size[7]);
}
print HTML "<tr><td><font><b><a
href=\"$MIDI\">$MIDI</a></b></font>";
if (@MIDI_Size[10] < 899072575){
print HTML "<img src=\"../new.gif\" hspace=8>";
}
print HTML "</td><td
align=center><font>@MIDI_Size[7]KB</font></td></tr>\n";
close(MIDI_IN);
}
print HTML "</table></center>\n";
print HTML "<p>\ \;</p> <p>\ \;</p> \n";
foreach $ZIP(@MIDIPack_ZIP){
open(ZIP_IN, $ZIP);
print HTML "<center><font size=5>MIDIPack
Available</font></center> ";
close(ZIP_IN);
}
print HTML "</BODY>\n";
print HTML "</HTML>\n";
} #end sub return_html
END OF CODE
---------------------------------------------------
Thank you for all your help,
Vikram Pant
http://vikrampant.com
http://midifest.com
------------------------------
Date: 28 Jul 1998 23:59:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Opendir and Write Not Working Like Planned...
Message-Id: <6plol4$8l4$1@nswpull.telstra.net>
In article <MPG.102826556835c2e8989682@newsdesk.tidalwave.net>,
usenet@vikrampant.com (Vikram Pant) writes:
>
> I am learning PERL and began writing a script that I find extremely
> useful, when it works.
It's Perl if you talk about the language, perl if you talk about the
program.
> It will OPEN a directory, glob the files and write them to a HTML page,
open, but very loudly?
> close the HTML, close the directory and continue until no directories
> exist.
This sounds like it might be a job for File::Find. If you're not using
that, I suggest you have a look at it:
# perldoc File::Find
Lets get to your code:
> #!/usr/local/bin/perl
no -w? no use strict? bad.
> # Read All Directories
> opendir(ALL, '.');
You don't test the return value. How do tou know it succeeded?
opendir(ALL, '.') or die "Cannot open directory .: $!";
You're opening the directory that is current when the script starts.
That is fine if that is the directory you want. If you want another
one, use a real path in there.
> @All_Dir = readdir(ALL);
> closedir(ALL);
> foreach $Dir (@All_Dir) {
> if (-d $Dir) {
> opendir(TEST, "$Dir") or die "FAIL.\n";
$Dir is just the name of the file in the directory. Not a full path.
If you are trying to look in other directories, you'll have to prepend
the path.
You should indent your code more legibly.
> # Getting File Names in Arrays
> @MIDI_Files = glob('*.mid');
> @MIDIPack_ZIP = glob('*.zip');
> @Image_File = glob('*.jpg');
Why do you mix opendir/readdir with glob? Why are you globbing in the
current directory when you really want to glob in $Dir?
The html part is a bit too bulky and such for me to spend too much
time on. Besides, the errors are probably in the above. I suggest you
use File::Find. It will recurse down those directories for you, and do
all kinds of good things, which you are doing wrong. If all you're
interested in is one layer of directories, then something like:
#!/usr/local/bin/perl -w
use strict;
my $parent = '/path/to/directory';
opendir(PARENT, $parent) or die "Cannot opendir $parent: $!";
foreach my $dir (grep { -d "$parent/$_" } readdir(PARENT))
{
my $path = "$parent/$dir";
opendir(SUB, $path) or die "Cannot opendir $path: $!";
foreach my $file (grep { /\.(mid|zip|jpg)$/ } readdir(SUB))
{
print "$path/$file\n";
}
closedir(SUB);
}
closedir(PARENT);
Suggested literature:
# perldoc File::Find
# perldoc -f opendir
# perldoc -f readdir
# perldoc -f closedir
# perldoc -f grep
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Tue, 28 Jul 1998 22:24:05 GMT
From: indhiraa@hotmail.com
Subject: Re: perl complier for ms dos
Message-Id: <6plj25$5ek$1@nnrp1.dejanews.com>
In article <35BDF9DE.634C4B2@emirates.net.ae>,
sursood <sursood@emirates.net.ae> wrote:
> i don't have access to cgi-bin directory or perl on my server can i try
> the scripts on my stand alone machine?
>
> suruchi
>
Try perl2exe found at:
www.demobuilder.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 28 Jul 1998 22:45:00 GMT
From: danzuck@my-dejanews.com
Subject: Re: Pid number of called process??
Message-Id: <6plk9d$7cc$1@nnrp1.dejanews.com>
In article <6pj63q$mr$1@nnrp1.dejanews.com>, kreed@my-dejanews.com wrote: I
don't know If you have gotten an answer or not? The easiest way to do this
is with the "$$" variable. $ParentPid=$$; before you fork. $$ is the pid of
current process.
> This should be real easy but I can't figure it out.
>
> I've got a server that needs to be run in background. I need to know
> what Pid number is assigned to it as there can be many copies of
> the same program running. From the command line you can
> execute:
>
> somecommand &
>
> And it will tell you the pid number, but I need an automated way to
> store that number.
>
> I've tried doing this with Perl so that I can place the Pid number of
> that process into a file for later access.
>
> What I can't figure out is how to get the Pid number of the
> process itself, using fork all I ever get is the Pid number of the
> child that is calling the process.
>
> Something like:
>
> unless ( $pid = fork ) {
> unless (fork) {
> `/usr/local/bin/somecommand &`;
> exit 0;
> }
> exit 0;
> }
> waitpid ($pid, 0);
> print "Pid number of the actual somecomand is $pid\n";
>
> This is of course returning the child process that is calling the somecommad
> module not the pid process of the somecommand itself.
>
> Any suggestions... TIA...
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
>
-----== 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 08:11:56 +1100
From: Jussi Jumppanen <xidicone@iname.com>
Subject: Programmer's Editor
Message-Id: <35BE3E9C.3509@iname.com>
The latest version of the Zeus programmers text editor is now available:
Zeus for Windows 3.x or Win32
A powerful text editor/ integrated development environment. Features
include Brief, Epsilon, Emacs or Wordstar emulation, status bar,
toolbar,
syntax colorizing, background compiler, inline error correction,
unlimited
undo/redo, keyboard macros, scripting language, templates and more.
Version: 2.70 Platforms: Windows 3.x or Win32 Size: 1100k
For more details and even some nice screen shots of Zeus in action check
out
the following web page:
http://ourworld.compuserve.com/homepages/jussi/zMain.htm
------------------------------
Date: 28 Jul 1998 23:16:52 GMT
From: ac1@fspc.netsys.itg.telecom.com.au (nobody)
Subject: Re: Same code, diff machines, diff results
Message-Id: <6plm54$r4k@newsserver.trl.OZ.AU>
Larry Rosler (lr@hpl.hp.com) wrote:
: [Posted to comp.lang.perl.misc and copy mailed.]
: In article <6pb595$7r4$1@condor.cns.iit.edu> on 24 Jul 1998 23:27:33 GMT,
: Harshal S. Chhaya <chhahar@charlie.cns.iit.edu> says...
: ...
: > $date = `/bin/date`;
: > $ENV{"TZ"} = "Asia/Calcutta";
: > $date1 = `/bin/date`;
: > print $date, $date1;
: >
: > On machine1 (FreeBSD, perl 5.004_01) this prints:
<blah>
: > and on the other machine (Solaris 2.5, perl 5.003) it prints:
<blah>
: > Anyone know why the results are different? Are the diff versions the reason
: > for this behavior?
: There is no Perl issue here whatsoever. Perl has launched the commands,
: set the environment variable, and returned the results.
Correct!
Not really a perl issue, other than the fact that perl is calling the
external program, but you might want to check /etc/timezone, /etc/tztab
or whatever file is used on your box for defining the timezones.
"man -k zone" would be a good start.
: [But I learned that some implementations accept descriptive strings
: for TZ instead of, e.g., PST8PDT. That was a surprise in itself.]
Actually, since some Unices use the tztab file for timezone specification,
I suppose you could use descriptive names rather than mnemonics. It
just never occurred to me to deviate from the practice laid down
20-odd years ago (must be a sign of aging).
: --
: Larry Rosler
: Hewlett-Packard Laboratories
: http://www.hpl.hp.com/personal/Larry_Rosler/
: lr@hpl.hp.com
------------------------------
Date: 28 Jul 1998 22:32:18 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: seeing if a file exists.
Message-Id: <6pljhi$5uu$1@nswpull.telstra.net>
In article <35bd76d3.304650@news.ukonline.co.uk>,
oliver.cook@bigfoot.com (Ollie Cook) writes:
> I thought that wouldn't be necessary since the script is always called
> from a browser and that will convey $ENV{'REMOTE_ADDR'} automatically.
I'd still test it, just to make sure. It cannot hurt to be overly
cautious, and to never trust the web server you're running this on.
I've seen some pretty broken behaviour.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: 18 Jul 1998 05:19:10 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Understand References Today
Message-Id: <6opb8e$69q$1@picasso.op.net>
Keywords: bland, protector, swarm, whir
I wrote a short introductory article about how to use references in
Perl. If you wanted to learn about references, but you got stuck in
the manual, my article, `Understand References Today' might be a good
place to begin.
It is available at:
<URL:http://www.plover.com/~mjd/perl/FAQs/>
The article was originally published in The Perl Journal, vol 3, #2.
It appears on my web site courtesy of Jon Orwant and The Perl Journal.
--
mjd@pobox.com Mark-Jason Dominus
mjd@plover.com Plover Systems, Philadelphia, PA
------------------------------
Date: Tue, 28 Jul 1998 16:32:36 -0700
From: Ed <ed@pdh.com>
Subject: Using Perl Embed in Win32 C++
Message-Id: <35BE5F93.67CFA6F2@pdh.com>
To start out with, I am not a perl programmer and don't really know a
whole lot about perl, but was given the task to call a perl program from
within my C++ code. I have looked at the perl embed for win32 stuff but
still don't have a good idea of how to do this. Most of the programs
want to take the command line arguments which I do not want to use (from
void main(argc, argv)). I will know the argument (single argument) and
the perl program name. I have not seen any really good examples of how
to do this. Does anyone have any ideas?
thanks in advance.
Ed
------------------------------
Date: Tue, 28 Jul 1998 14:57:16 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Using Perl to Determine default browser
Message-Id: <MPG.1027e9159da466498974b@nntp.hpl.hp.com>
In article <35be3370.13188131@news2.cais.com> on Tue, 28 Jul 1998
20:25:29 GMT, root.noharvest.\@not_even\here.com (-) says...
...
> I think he just misunderstood himself. I suspect he wants to know
> what browser is being used to access his site, which would be easy to
> detect:
>
> %ENV{USER_AGENT}
>
> you just need to know what values a browser will send in the
> user_agent string.
I suspect you mean this:
$ENV{USER_AGENT}
You just need to know how to access an element of a hash, which is a
scalar.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 28 Jul 1998 22:40:15 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Using Perl to Determine default browser
Message-Id: <6plk0f$5uu$2@nswpull.telstra.net>
In article <35be3370.13188131@news2.cais.com>,
root.noharvest.\@not_even\here.com (-) writes:
> I think he just misunderstood himself. I suspect he wants to know
> what browser is being used to access his site, which would be easy to
> detect:
>
> %ENV{USER_AGENT}
^
|
$
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Tue, 28 Jul 1998 22:59:41 GMT
From: danzuck@my-dejanews.com
Subject: Web Database Access with sub-queries.
Message-Id: <6pll4t$9ji$1@nnrp1.dejanews.com>
I have an interactive page that does Oracle queries (DBD::Oracle). My search
results creates a list of DB rows, some of these rows you can drill down on.
I have to use <HREF=xxx.pl?user=xxx&pass=xxx&etc.> this shows up on the
Location bar. Does anyone have an idea how to get around this?
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 28 Jul 1998 22:22:08 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Y2K problem in PERL with localtime()
Message-Id: <Ewtssw.AJB@world.std.com>
cberry@cinenet.net (Craig Berry) writes:
>Well, using 2 digits (year % 100) for the date is pretty clearly
>problematic, at the very least. That's what this whole ruckus is about,
>after all.
Actually, there is no problem in using the last two digits for the
year. The Y2K crisis revolves around performing arithmetic based on a
two digit year.
I have some code I wrote eight years ago that uses a two digit year
and I have no inclination to change it. People enter some data that
correspond to a specific date, and the computer does some things when
that date is reached. Since these events (pro and college sports
games) are not scheduled in the past nor 100 years in the future,
there is no possiblity for a two digit year being mistaken. And since
the dates are not compared against each other there is no problem that
"00" is less than "99".
Anyone have any reasons why I should? It runs. It should continue to
run. And I have more important things to do with my time.
--
Andrew Langmead
------------------------------
Date: 28 Jul 1998 23:41:33 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Y2K problem in PERL with localtime()
Message-Id: <6plnjd$itg$1@news.NERO.NET>
In article <fl_aggie-2807980947240001@aggie.coaps.fsu.edu>,
I R A Aggie <fl_aggie@thepentagon.com> wrote:
>In article <35bed780.23922418@news.tornado.be>, bart.mediamind@tornado.be
>(Bart Lateur) wrote:
>+ Tad McClellan wrote:
>+ > So 02-29-100 is *unambiguously* (100 + 1900) the year 2000
>+ > It can be no other year.
>+ > It can only be 2000.
>+ > No bug.
>+
>+ Are you sure it's not the year 100? Are you also sure that "1900" is not
>+ the year 3800?
>Yes. By *definition*. As per 'perldoc -f localtime':
I see nothing related to perl in the string 02-29-100. If I am your
pointy haired boss and you hand me a report with that date in it, I
have no way of knowing that you programmed in perl. "Dates will be the
output of the 'localtime' perl funtion" is not how any company I know
of standardizes its dates. "Dates will be expressed as the last two
digits of the year" is.
And now you hand me a date that does not match either "4 digit year" or
"two digit year". It could be years since 1900 (2000). It could be the
year 100. It could be years since 2000 (2100). It could be the last
three digits of the year (2100). You are operating outside the box, and
that makes it ambiguous.
If you believe that your private knowledge of how the number on the
sheet of paper was produced, then I would claim that there is no y2k
problem at all. For every two digit year printed on any sheet of paper,
or contained in any database, there is someone who has private knowledge
as to how that number was produced. There can be no ambiguity.
------------------------------
Date: 28 Jul 1998 22:39:09 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Zombies from Forking are Bad, says Sun
Message-Id: <901666152.455387@thrush.omix.com>
Steve Livingston <slivings@digitalriver.com> wrote:
: Each of the children leaves a Zombie process (seen by 'top') and I often
: get many thousands of these Zombies, which _appear_ to go away when I
: restart the daemon..
>snip<
man perlipc (look for "CHLD")
perldoc -f wait
perldoc -f waitpid
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Tue, 28 Jul 1998 22:24:02 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Zombies from Forking are Bad, says Sun
Message-Id: <Pine.GSO.4.02.9807281523160.16612-100000@user2.teleport.com>
On Tue, 28 Jul 1998, Steve Livingston wrote:
> Each of the children leaves a Zombie process
Have you seen what the FAQ says about zombies? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
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 3280
**************************************