[10589] in Perl-Users-Digest
Perl-Users Digest, Issue: 4181 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 9 14:07:14 1998
Date: Mon, 9 Nov 98 11:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 9 Nov 1998 Volume: 8 Number: 4181
Today's topics:
---->WANTED Today! Perl & C++ Programmer<------ <mike@gono.com>
---->WANTED Today! Perl & C++ Programmer<------ <mike@gono.com>
Re: 2nd posting: why do I get in this case: "untie atte <montyt@bestnet.com>
Re: any simple cookie examples? dtbaker_dejanews@my-dejanews.com
Re: Array problems for newbie <fncll@aurora.alaska.edu>
Re: Array Ref Question (Ronald J Kimball)
Re: Array-Hash-Problem (Andre L.)
Re: dont echo passwords !!! <tonylabb@infonline.net>
Re: how2 talk to ssh(1) from within perl(1), it wants a <dean2@mail.biol.sc.edu>
Re: Need a two way hash (Craig Berry)
Need wlib to install Perl <mikane@shell3.ba.best.com>
newbie question (Jang Choe)
Re: Not to start a language war but.. <zenin@bawdycaste.org>
Re: perl cgi tutorial <support@acuity.com>
Re: Poor performance processing a file (Ronald J Kimball)
Problem With Counter+Statistic (James Bond 098)
Problem with Counter+Statistic (James Bond 098)
Re: Returning a WAV file to browser to play (Vikram Pant)
Re: Security - How to circumvent it. <dean2@mail.biol.sc.edu>
Re: Security - How to circumvent it. (I R A Aggie)
Re: Setting/Getting value in an Hash of Hash... <jdf@pobox.com>
Re: Setting/Getting value in an Hash of Hash... <ludlow@us.ibm.com>
TO KILL or NOT to kill a process (SattarS)
Re: TO KILL or NOT to kill a process <zenin@bawdycaste.org>
Re: Where are Perl Interpreters found? <drumnjim@ericbr.globalnet.co.uk>
Re: Where are Perl Interpreters found? <mikane@shell3.ba.best.com>
Why doesn't my perl compiler like this expression? <nospam.gear4u@hotmail.com>
Win32::Process ljkbrost@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 09 Nov 1998 17:38:46 GMT
From: "Mike Thacker" <mike@gono.com>
Subject: ---->WANTED Today! Perl & C++ Programmer<------
Message-Id: <GMF12.113$ZS.399966215@dca1-nnrp1.news.digex.net>
---->WANTED Today! Perl & C++ Programmer<------
We need someone immediately for web site Perl programming support.
We need C++ also. We need Perl NOW.
Call me ASAP at numbers below.
Mike Thacker, mike@NetCollect.com
IT Manager, NetCollect.com
***************************************
9am - 5pm CST (GMT -0600)
Local Nashville, TN area --------- 615-859-5236 ext. 210
Toll free outside of Nashville --- 1-800-826-4929 ext. 210
***************************************
http://www.NetCollect.com "Where the World Shops Collectibles!"
------------------------------
Date: Mon, 09 Nov 1998 17:40:18 GMT
From: "Mike Thacker" <mike@gono.com>
Subject: ---->WANTED Today! Perl & C++ Programmer<------
Message-Id: <6OF12.115$ZS.125304843@dca1-nnrp1.news.digex.net>
---->WANTED Today! Perl & C++ Programmer<------
We need someone immediately for web site Perl programming support.
We need C++ also. We need Perl NOW.
Call me ASAP at numbers below.
Mike Thacker, mike@NetCollect.com
IT Manager, NetCollect.com
***************************************
9am - 5pm CST (GMT -0600)
Local Nashville, TN area --------- 615-859-5236 ext. 210
Toll free outside of Nashville --- 1-800-826-4929 ext. 210
***************************************
http://www.NetCollect.com "Where the World Shops Collectibles!"
------------------------------
Date: Mon, 9 Nov 1998 07:52:39 -0800
From: "Monty Taylor" <montyt@bestnet.com>
Subject: Re: 2nd posting: why do I get in this case: "untie attempted..."
Message-Id: <72734m$30624@roc344.ghc.org>
Hello,
I tried running your script fragment, and I didn't run into the same
problem. My perl didn't like the _hash as a bareword with strict turned on.
It obviously didn't like hash, either, so I stuck an r in there and made it
harsh and it runs fine.
Since that script looks like a partial re-write of something larger, maybe
there is something different between your big script and what you posted?
--
-----------------------------------------------
Monty Taylor
Sybase DBA, UNIX Admin
Best Consulting -- Seattle, WA
montyt@bestnet.com
ronald_f@my-dejanews.com wrote in message
<724l7i$fh7$1@nnrp1.dejanews.com>...
>Hi all!
>
>This is my second posting to this problem (seems to really be a hard one).
Any
>suggestions or hints welcome!
>
>I get the error message
>
> untie attempted while 1 inner references still exist at ./pt2 line 17.
>
>wenn trying to untie a reference that is stored as a member in some class.
>
>Why do I get this message in the following program? I can not see why there
>should still exist a pending reference!
>
>I use Perl 5.004 to run it:
>
>#!/usr/local/bin/perl -w
>package Demo;
>
>use strict;
>use Fcntl;
>use NDBM_File;
>
>sub _h { return shift->{_hash}; }
>
># simulate "Demo->new" for this small example
>my $self = { _hash => {} }; # Real application has other members as well
>bless $self,"Demo";
>
>(tie(%{$self->_h}, "NDBM_File", "dh.db", O_RDWR|O_CREAT, 0640)) or die;
>
> if(tied %{$self->_h})
> {
> untie %{$self->_h}; # At this point the error occurs
> }
>
>
>
>--
>Ronald Fischer <ronald_f@my-dejanews.com>
>http://ourworld.compuserve.com/homepages/ronald_fischer/
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 09 Nov 1998 16:30:28 GMT
From: dtbaker_dejanews@my-dejanews.com
Subject: Re: any simple cookie examples?
Message-Id: <7275b4$dot$1@nnrp1.dejanews.com>
In article <Pine.GSO.4.02A.9811081249220.14028-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
> On Sun, 8 Nov 1998, Dan Baker wrote:
>
> > I'm struggling a bit with learning how to use cookies.... does anyone
> > have a small example that sets/gets a cookie to post?
>
> Sounds as if you're doing CGI programming. The docs, FAQs, and newsgroups
> about CGI programming should be helpful. If you'll be using Perl, the CGI
> module may also be useful. Good luck!
---------------
yes, I am learning to do some CGI... using perl to create on-the-fly option
lists and such for HTML forms. While some values can be passed from one form
to the next in VALUES, I'm finding that I need to save some "state-like"
information in cases where one perl script may get executed later in a work
session, etc.
I have read thru the :CGI docs several times, and am really only using 2 or 3
of the methods (param and cookie). I am slowly making sense of the docs and
making progress in a little trial and error test routine, but "error" is the
keyword there... ;) While the docs I've found show the syntax for the actual
call, I think I'm not getting the big picture for correct use, and am looking
for a little example. Always makes more sense to me to see something that
way....
Have I missed a complete example in the :CGI docs?
If there is a specific site that does a good job of a mini-tutorial on
cookies, please post the URL ! thanx Dan Baker
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 09 Nov 1998 08:31:52 -0900
From: Chris Lott <fncll@aurora.alaska.edu>
Subject: Re: Array problems for newbie
Message-Id: <ypnlnlk22nr.fsf@aurora.alaska.edu>
Use CTRL-D instead of CTRL-Z and it will work fine (at least it does
on both of my WinNT and 95 setups).
c
--
Chris Lott <fncll@uaf.edu>
IT Specialist
University of Alaska Fairbanks
p907.474.6350 f907.474.6841
------------------------------
Date: Sun, 8 Nov 1998 18:43:33 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Array Ref Question
Message-Id: <1di6tjp.bwuo6b17whw8mN@bay1-423.quincy.ziplink.net>
Kevin Reid <kpreid@ibm.net> wrote:
> Where is {} ambiguous?
In general, whereever there could be either a term or a block.
Sometimes, the ambiguity will cause a syntax error, because Perl 'knows'
the {} are a block, when the programmer meant them to be an anonymous
hash reference.
DB<1> @a = (1..3)
DB<2> x map {$_, $_*2} @a # map BLOCK ARRAY
0 1
1 2
2 2
3 4
4 3
5 6
DB<3> x map +{$_, $_*2}, @a # map EXPR, ARRAY
0 HASH(0x1010491c)
1 => 2
1 HASH(0x101282c0)
2 => 4
2 HASH(0x100fdc80)
3 => 6
DB<4> x map {$_, $_*2}, @a # map ???
syntax error at (eval 10) line 2, near "},"
In the last call to map, Perl assumes the {} is a BLOCK, which means the
comma is a syntax error. But if the {} were an anonymous hash
reference, as in the previous map, it would be valid syntax.
However, I don't know of any code offhand which will trigger the warning
Ambiguous use of %s resolved as %s
based on an ambiguity with {}.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Mon, 09 Nov 1998 14:06:16 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Array-Hash-Problem
Message-Id: <alecler-0911981406160001@dialup-695.hip.cam.org>
In article <727646$ece$1@nnrp1.dejanews.com>, nomam@my-dejanews.com wrote:
[...]
> %element = (
> 'name' = $name,
> 'size' = $size
> );
[...]
You meant to use => instead of = here.
HTH,
Andre
------------------------------
Date: Mon, 09 Nov 1998 12:34:13 -0500
From: Tony Labbiento <tonylabb@infonline.net>
Subject: Re: dont echo passwords !!!
Message-Id: <36472795.D1B30983@infonline.net>
This is how I normally do it:
print "Enter Password: ";
system('stty', '-echo');
chop($pwd = <STDIN>);
system('stty', 'echo');
print "\nYour password is: $pwd\n";
Of course, this is using UNIX.
Michael Renshaw wrote:
>
> I came across the Expect module last week. While going through the
> examples I found the following code to prevent echoing
> a password....
>
> $stdin->exp_stty('-echo');
>
> Does anyone know a way to do this outside of the Expect module
> as I would like to use it in non-Expect scripts ?
>
> thanx
>
> Mike
--
****************************************
* Tony Labbiento *
* Infinity Online, Inc. *
****************************************
------------------------------
Date: 09 Nov 1998 11:41:25 -0500
From: Dean Pentcheff <dean2@mail.biol.sc.edu>
To: Junichi Kurokawa <jun@mew.gol.com>
Subject: Re: how2 talk to ssh(1) from within perl(1), it wants a controlling tty!
Message-Id: <m3k914x1hm.fsf@mail.biol.sc.edu>
Junichi Kurokawa <jun@mew.gol.com> writes:
...
> Apparently the ssh(1) wants to read its passphrase from '/dev/tty'
> instead of STDIN as far as I could read from the `readpass.c' source
> file of SSH, while the perl(1) interpreter doesn't seem to talk to
> that.
...
I just recently tackled a related problem. The system standard
readpass routine reads from /dev/tty if it can, but falls back to
stdin if it can't. Hence, the "trick" is to detach the process from
its controlling tty. I ended up doing the whole job in C for various
reasons, so I'm afraid I'll have to leave the Perl version as an
exercise for the reader. However, one way to do it could be to write
a short "wrapper" in C that calls the Perl job after doing the
necessary fussing.
The code is appended following my signature. Hope it's helpful!
-Dean
--
N. Dean Pentcheff <dean2@mail.biol.sc.edu>
Biological Sciences, Univ. of South Carolina, Columbia SC 29208 (803-777-7068)
=======================================================================
/*
* cpasswords.c
* Copyright N. Dean Pentcheff 1998
* University of South Carolina
* dean2@mail.biol.sc.edu
*
* This program is free software; you can redistribute it and/or
* modify it under the same terms as Perl itself (see http://www.perl.com).
*
* Change both the Unix and SMB passwords for a user.
* To work, must be installed SUID-root.
* If called interactively (from a tty), is slightly verbose, and uses
* the standard getpass() routine to query for and confirm a password.
* If called noninteractively, expects the password (once) on stdin.
*
* Customize the locations of the standard Unix and SMB password programs
* in the "#defines" near the top (do NOT be tempted to add code to make
* these changeable from command-line arguments: these programs will
* be run as root!). If your paths are obscenely long, examine the
* size of STRLEN to make sure it will accomodate them.
* The sleep()s in the actual pwd-changing routines appeared to be necessary
* in some early tests I did with the PAM-passwd program on Linux. I'm
* not convinced they're always necessary. Delays in a pwd-changing
* program aren't a bad idea anyway, so I've left them in.
*/
#include <fcntl.h>
#include <sys/ioctl.h>
#include <pwd.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#define PASSWD "/usr/bin/passwd"
#define SMBPASSWD "/usr/local/bin/smbpasswd"
#define PROMPT1 "Type a new password: "
#define PROMPT2 "Type the same password again: "
#define STRLEN 1024
int main (void)
{
int fd;
int status;
struct passwd *pwentry;
char new[STRLEN];
char cmd[STRLEN];
char *cp;
FILE *cmdpipe;
FILE *mystderr;
/* what's my username? */
if ((pwentry = getpwuid(getuid())) == NULL) {
fprintf(stderr, "Failed getting name entry for UID=%d, exiting...\n",
getuid());
exit(1);
}
/* do we have the appropriate permissions? */
if (geteuid() != 0) {
fprintf(stderr, "This program cannot run unless it is SUID-root, "
"exiting...\n");
exit(1);
}
/* get a password and strip any trailing cr/lf stuff */
if (isatty(0)) { /* interactive, so use a no-echo prompt twice */
cp = getpass(PROMPT1);
strncpy(new, cp, STRLEN);
cp = getpass(PROMPT2);
if (strcmp(new, cp)) {
fprintf(stderr, "The two versions don't match, exiting...\n");
exit(1);
}
} else { /* noninteractive, so just get it from stdin */
if (read(0, new, STRLEN) <= 0) {
fprintf(stderr, "Failed to read a new password, exiting...\n");
exit(1);
}
}
for (cp=new; *cp!='\n' && *cp!='\r' && cp-new<STRLEN-1; ++cp)
;
*cp = '\0';
if (strlen(new) <= 0) {
fprintf(stderr, "No password entered, exiting...\n");
exit(1);
}
/* get a private stderr, then close stderr/stdout to silence pwd programs */
if ((fd = dup(2)) < 0) {
fprintf(stderr, "Strange! Couldn't dup error-output fd, exiting...\n");
exit(1);
}
if ((mystderr = fdopen(fd, "w")) == NULL) {
fprintf(stderr, "Strange! Couldn't fdopen new stderr fd, exiting...\n");
exit(1);
}
close(1);
close(2);
/* detach from controlling tty to convince smbpasswd to read stdin for pw */
if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
if (ioctl(fd, TIOCNOTTY) < 0) {
fprintf(mystderr, "Failed to detach from /dev/tty: %s, exiting...\n",
strerror(errno));
exit(1);
}
close(fd);
}
/* shuffle UIDs for permissions - we expect to be running SUID-root */
if (setuid(geteuid()) != 0) {
fprintf(stderr, "Failed to properly set UID, exiting...\n");
exit(1);
}
/* open a pipe to and then feed the standard Unix passwd program, slowly */
if (isatty(0))
fprintf(mystderr, "Changing Unix password...\n");
strcpy(cmd, PASSWD);
strcat(cmd, " ");
strcat(cmd, pwentry->pw_name);
if ((cmdpipe = popen(cmd, "w")) == NULL) {
fprintf(mystderr, "Failed to open pipe to '%s', exiting...\n", cmd);
exit(1);
}
sleep(3);
fprintf(cmdpipe, "%s\n", new); fflush(cmdpipe); sleep(2);
fprintf(cmdpipe, "%s\n", new); fflush(cmdpipe); sleep(2);
if ((status = pclose(cmdpipe)) != 0) {
fprintf(mystderr, "Program '%s' returned error code %d, exiting...\n",
cmd, status);
exit(1);
}
if (isatty(0))
fprintf(mystderr, "\tSuccessfully changed Unix password.\n");
/* now change the SMB password */
if (isatty(0))
fprintf(mystderr, "Changing SMB/Windows password...\n");
strcpy(cmd, SMBPASSWD);
strcat(cmd, " ");
strcat(cmd, pwentry->pw_name);
if ((cmdpipe = popen(cmd, "w")) == NULL) {
fprintf(mystderr, "Failed to open pipe to '%s', exiting...\n", cmd);
exit(1);
}
sleep(3);
fprintf(cmdpipe, "%s\n", new); fflush(cmdpipe); sleep(2);
fprintf(cmdpipe, "%s\n", new); fflush(cmdpipe); sleep(2);
if ((status = pclose(cmdpipe)) != 0) {
fprintf(mystderr, "Program '%s' returned error code %d, exiting...\n",
cmd, status);
exit(1);
}
if (isatty(0))
fprintf(mystderr, "\tSuccessfully changed SMB/Windows password.\n");
exit(0);
}
/* end of program */
------------------------------
Date: 9 Nov 1998 17:53:12 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Need a two way hash
Message-Id: <727a69$dfa$1@marina.cinenet.net>
Awrobinson (awrobinson@aol.com) wrote:
: I'm building an application where I have two quantities matched up. In some
: cases, I need to use one set as the key to the other. In other cases, I need to
: use the second set as the key to the first. Can anyone suggest a convenient way
: to do this? Is there a way to use the values in a hash to get to the keys?
%alpha_to_num = qw( a 1 b 2 c 3 );
%num_to_alpha = reverse %alpha_to_num;
print "$alpha_to_num{b} $num_to_alpha{2}\n"; # prints '2 b'
Note that you must ensure that the values in the 'source' hash are unique
or you'll lose some values on the reversed version.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: 09 Nov 1998 00:47:52 GMT
From: <mikane@shell3.ba.best.com>
Subject: Need wlib to install Perl
Message-Id: <36463bb8$0$12767@nntp1.ba.best.com>
During the make process for perl5.005_02 I get the
error message that "wlib" is not found.
I have learned that wlib is the Watcom Library Manager.
Does anyone know where I get the source/binary for Solaris/x86?
Mike
------------------------------
Date: 9 Nov 1998 00:48:44 GMT
From: gt6786b@acmey.gatech.edu (Jang Choe)
Subject: newbie question
Message-Id: <725e5c$286@catapult.gatech.edu>
How do I attatch 2 strings together to a variable?
like
$foo = "hello" + "world";
which makes $foo = "hello world"
thanks.
--
That he is mad, 'tis true: 'tis true 'tis pity;
And pity 'tis 'tis true. --Shakespeare, Hamlet, II, 2
Quote of the day: "
------------------------------
Date: 9 Nov 98 17:52:26 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Not to start a language war but..
Message-Id: <910634023.139241@thrush.omix.com>
Garrett G. Hodgson <garry@sage.att.com> wrote:
>snip<
: i've seen little evidence of people using perl for this kind of stuff.
Please define "this kind of stuff", or are you only speeking of
design patterns?
--
-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: Mon, 09 Nov 1998 10:54:32 -0600
From: John Warner <support@acuity.com>
Subject: Re: perl cgi tutorial
Message-Id: <36471E48.C8BDE50C@acuity.com>
I have to agree here. Learning Perl is the first step. Once you know
a little Perl, writing a CGI script in Perl is far easier because you
will have an idea of where to go when you have a question (Perl docs
or CGI docs). If you are using Perl 5, I would definitely recommend
looking at _Official Guide to Programming with CGI.pm_ by Lincoln
Stein (http://www.wiley.com/compbooks/stein). CGI.pm is a seriously
cool module (it alleviates a ton of headaches you would otherwise have
to deal with) to know if you are going to be a serious CGI with Perl
person.
John Warner
Acuity Technical Support
Tore Aursand wrote:
> On Fri, 6 Nov 1998 09:47:31 +0200, "John Spyrou"
> <infotec@mail.otenet.gr> wrote:
> > I have found some cgi scripts writen in perl but I really don't
> > know the language.
>
> First of all: Learn Perl. Perl is not CGI. CGI is not Perl, but
> both *can* be, if you understand what I mean? :-)
>
> Ideal books for learning Perl the easy way:
> - "Learning Perl, 2nd Edition", O'Reilly (ISBN: 1-56592-284-0)
> - "Programming Perl, 2nd Edition", O'Reilly (ISBN: 1-56592-149-6)
>
> Secondly: A nice book - in my opinion - for learning CGI using
> Perl, is "CGI Programming on the World Wide Web", also from
> O'Reilly. (ISBN: 1-56592-168-2)
>
> Good luck!
>
> --
> Tore Aursand
> ForumNett Online AS
> http://www.forumnett.no/
------------------------------
Date: Sun, 8 Nov 1998 18:43:34 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Poor performance processing a file
Message-Id: <1di6ub0.1ls76nn1y0p8gN@bay1-423.quincy.ziplink.net>
Torquil Chapman <torquil@protest.demon.co.uk> wrote:
> I've written a script that sequentially processes two text input files and
> produces seven text output files. Both input files have more that 2 million
> lines in them and I'm processing line by line.
>
> Initially, performance is exceptionally good and I'm able to process the
> first 10,000 lines in 1 minute. The next 10,000 lines take about two
> minutes and so on. It took 35 minutes to process the first 100,000 lines
> and more than double that to process the next 100,000 lines! What is
> decaying the performance? I assume that the slowest part of the operation
> is the IO, particularly the writes but what can I do to speed them up?
Perhaps you have a memory leak in your program? If you really process
each file line by line, I don't see any reason why execution time would
not increase linearly.
I don't suppose you process the second file for each line in the first
file, or something like that?
But with the few snippets "from" your program you provided, I don't see
any way to answer your question.
> I use the following syntax to open my files for output;
>
> $my_file_name = "e:\\my_path\\my_file.txt";
> open MY_FILE_HANDLE ">$my_file_name";
You're missing a comma after the filehandle.
Missing comma after first argument to open function at - line 1, near
"">$my_file_name";"
You forgot to make sure the open() succeeds.
open(MY_FILE_HANDLE, ">$my_file_name") or
die "Unable to open $my_file_name: $!\n";
> ...and I print to them ...
>
> print MY_FILE_HANDLE "$out_field1 $out_field2 $out_field3\n";
That looks fine.
> The input files are sequentially processed in a loop...
>
> while (!(eof $my_input_file)) {
> $line_of_file = chop <$my_input_file>
> ....
> ....
I very much doubt that your program actually processes the input in that
manner...
Can't modify <HANDLE> in chop at - line 1, near "<>;"
So, what does your code *really* look like? :-)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 08 Nov 1998 07:37:52 GMT
From: burningboy@hotmail.com (James Bond 098)
Subject: Problem With Counter+Statistic
Message-Id: <34b5cebe.463390@news.au.ac.th>
EMERGENCY CASE:
I'm writing a counter+statistic cgi, i don't know how to check what
web-site do the people came from to my page, please suggest me.
------------------------------
Date: Sun, 08 Nov 1998 07:23:54 GMT
From: burningboy@hotmail.com (James Bond 098)
Subject: Problem with Counter+Statistic
Message-Id: <36454687.801739@news.au.ac.th>
EMERGENCY Case:
i'm writing a counter+statistic, i don't know how to check what
web-site do the people came from to my page, Suggest me please.
------------------------------
Date: Mon, 9 Nov 1998 13:07:09 -0500
From: nospam@wam.umd.edu (Vikram Pant)
Subject: Re: Returning a WAV file to browser to play
Message-Id: <MPG.10b0f957b998e24d9896a4@news.wam.umd.edu>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
Thank you very much, didn't realize about the URL I was sending the
browser.
Thanks again for the help,
Vikram Pant
In article <1di78p1.1agv3mb1tne4skN@bay1-8.quincy.ziplink.net>,
rjk@coos.dartmouth.edu says...
> Vikram Pant <nospam@wam.umd.edu> wrote:
>
> > print "Content-type: audio/x-wav\n\n";
> > $ReturnSound;
> >
> > I'm doing as above.
> > $ReturnSound =
> > http://vikrampant.com/alltimefavflics/Heat/sound/deniro.jpg
>
> If you want to return a file of type audio/x-wav to the browser, then
> you actually have to print out such a file.
>
> The above program doesn't print out anything, other than a Content-type
> header.
>
> And even if you did print out the $ReturnSound variable, then you would
> be giving the browser a URL, rather than a file of type audio/x-wav.
>
> And the URL is for an image/jpeg file, at that. (Okay, so the .jpg bit
> was probably a typo. :-)
>
>
> $sound_file = '/alltimefavflics/Heat/sound/deniro.wav'
>
> open(WAV, $sound_file) or
> die "Can't open $sound_file: $!\n";
> binmode(WAV);
>
> print "Content-type: audio/x-wav\n\n";
> print <WAV>;
>
> --
> _ / ' _ / - aka - rjk@coos.dartmouth.edu
> ( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
> / http://www.ziplink.net/~rjk/
> "It's funny 'cause it's true ... and vice versa."
>
------------------------------
Date: 09 Nov 1998 11:44:12 -0500
From: Dean Pentcheff <dean2@mail.biol.sc.edu>
To: asitmain.tperry@email.state.ut.us
Subject: Re: Security - How to circumvent it.
Message-Id: <m3hfw8x1cz.fsf@mail.biol.sc.edu>
asitmain.tperry@email.state.ut.us writes:
...
> Insecure $ENV{PATH} while running setuid at /ipl/ipl.pl line 14, <>
> chunk 1
>
> Although I understand that there is significant security risk with
> this script, let me make myself clear that I really don't care if
...
See:
man perlsec
for a discussion of this (and related) issues. You should be able to
do what you want, and you won't need to recompile Perl.
-Dean
--
N. Dean Pentcheff <dean2@mail.biol.sc.edu>
Biological Sciences, Univ. of South Carolina, Columbia SC 29208 (803-777-7068)
------------------------------
Date: Mon, 09 Nov 1998 12:04:36 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Security - How to circumvent it.
Message-Id: <fl_aggie-0911981204360001@aggie.coaps.fsu.edu>
In article <36470769.6080513@blinksoft.com>,
asitmain.tperry@email.state.ut.us wrote:
+ Insecure $ENV{PATH} while running setuid at /ipl/ipl.pl line 14, <>
+ chunk 1
You might want to try consulting the documentation...'perldoc perlsec'...for
instance...
James
------------------------------
Date: 09 Nov 1998 18:19:20 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: "Sylvain St.Germain" <sylvain@macadamian.com>
Subject: Re: Setting/Getting value in an Hash of Hash...
Message-Id: <m367co7pif.fsf@joshua.panix.com>
"Sylvain St.Germain" <sylvain@macadamian.com> writes:
> This is a multi-part message in MIME format.
Please don't do that.
> NOTE: my right parenthesis is printed as a pipe....
I don't know what you mean by that.
> open FILE, "cat ....|";
You fail to check whether the open() worked. Why are you using cat
instead of simply opening the file?
> $api{'toto'}{COUNT} =+ 1;
Are you trying to increment $api{toto}{COUNT} ?
$api{toto}{COUNT}++;
or
$api{toto}{COUNT} += 1;
> while(($func, $stat)=each %api) {
> print "$stat{COUNT}\n";
$stat is a hash reference, not a hash.
print "$stat->{COUNT}\n";
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Mon, 09 Nov 1998 11:28:33 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Setting/Getting value in an Hash of Hash...
Message-Id: <36472641.110E11CB@us.ibm.com>
Sylvain St.Germain wrote:
[snip]
> This seems to work, however, I cannot figure out how
> to update COUNT and FOUND... I tried stuff like (assuming toto is in the
> hash):
>
> $api{'toto'}{COUNT} =+ 1;
> $api{'toto'}{'COUNT'} =+ 1;
^^^
I don't think this is doing what you think it's doing, but this isn't
the problem. Check your operator list again. Always, always, always,
use the -w switch (always).
> but nothing works when I print the content using:
>
> while(($func, $stat)=each %api) {
> print "$stat{COUNT}\n";
> print "$stat{'COUNT'}\n";
> }
>
> What am I doing wrong?
Try using $stat->{COUNT}
If you want to see what's going on here, try playing around with the
debugger (-d). The "x" command is very useful for seeing what's going
on inside of a hash.
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: 9 Nov 1998 17:46:32 GMT
From: sattars@aol.com (SattarS)
Subject: TO KILL or NOT to kill a process
Message-Id: <19981109124632.04052.00001317@ng11.aol.com>
Hi,
HELPP!!!! I have a perl script running in a directory - does anyone know how I
can delete the contents of the directory with the perl script whilst the script
is running ?
I would deeply appreciate (urgently) some help - thanks beforehand
Sattar
------------------------------
Date: 09 Nov 1998 17:59:19 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: TO KILL or NOT to kill a process
Message-Id: <910634129.937156@thrush.omix.com>
SattarS <sattars@aol.com> wrote:
: HELPP!!!! I have a perl script running in a directory - does anyone know how I
: can delete the contents of the directory with the perl script whilst the script
: is running ?
I take it you're running under Windows? If so, you probably can't.
--
-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: Mon, 9 Nov 1998 17:34:53 -0000
From: "Drummond Richardson" <drumnjim@ericbr.globalnet.co.uk>
Subject: Re: Where are Perl Interpreters found?
Message-Id: <727961$mh3$1@newnews.global.net.uk>
I've kindly been told where to find one now thanks.
Drummond Richardson wrote in message <7258qi$21g$1@newnews.global.net.uk>...
>Just starting out in Perl for website function programming. The first thing
>I need is an interpreter for Windows95. Can anyone tell me where this can
be
>found on the net. I tried Microsoft without success.
>
>Thanks in advance, very grateful.
>
>Yours sincerely,
>
>Drummond Richardson
>
>
------------------------------
Date: 09 Nov 1998 18:09:08 GMT
From: <mikane@shell3.ba.best.com>
Subject: Re: Where are Perl Interpreters found?
Message-Id: <36472fc4$0$12764@nntp1.ba.best.com>
www.perl.com
Mike Landeros
MLD
Novato, CA
In comp.lang.perl.misc Drummond Richardson <drumnjim@ericbr.globalnet.co.uk> wrote:
: I've kindly been told where to find one now thanks.
: Drummond Richardson wrote in message <7258qi$21g$1@newnews.global.net.uk>...
:>Just starting out in Perl for website function programming. The first thing
:>I need is an interpreter for Windows95. Can anyone tell me where this can
: be
:>found on the net. I tried Microsoft without success.
:>
:>Thanks in advance, very grateful.
:>
:>Yours sincerely,
:>
:>Drummond Richardson
:>
:>
------------------------------
Date: Sun, 08 Nov 1998 22:22:10 -0500
From: sara starre <nospam.gear4u@hotmail.com>
Subject: Why doesn't my perl compiler like this expression?
Message-Id: <36465FE2.1203CBDD@hotmail.com>
if
(i) $a=$b=$c=0;
and
(ii) $a=$b=$c=1;
are fine, and seem to work correctly, then why does the compiler not
like:
(iii) $a=1+$b=$c=0;
???
Parsing from r to l, each l-value has a legit r-value. We could argue
that an LR parser would encounter an undefined r-value in (iii) when it
parses $a=1+$b, since $b isn't defined yet. However, exactly the same
argument can be made in (i) and (ii). I'm confused!
HUG,
S
------------------------------
Date: Mon, 09 Nov 1998 16:17:05 GMT
From: ljkbrost@my-dejanews.com
Subject: Win32::Process
Message-Id: <7274i1$csa$1@nnrp1.dejanews.com>
Hello,
I am trying to write a Perl script on a Windows95 machine. I am using the
Win32::Process module to spawn a process and I would like to capture the
"spawned" process's output to an array so that the parent process can later
manipulate it.
Can someone please offer a way in which I can do this?
Thanks,
--
Kyle Brost
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 4181
**************************************