[12566] in Perl-Users-Digest
Perl-Users Digest, Issue: 6166 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 29 15:07:20 1999
Date: Tue, 29 Jun 99 12:00:48 -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, 29 Jun 1999 Volume: 8 Number: 6166
Today's topics:
Re: blocking SIGINT and SIGQUIT <robert@corpus.nl>
Filehandles, appending a file..why dosn't this work? <adams1015@worldnet.att.net>
Re: Foreach on hash gives undefined value <rootbeer@redcat.com>
Forms Processing - thread started in HTML group (Ken)
Re: Forms Processing - thread started in HTML group <swiftkid@bigfoot.com>
Re: Having an external script modify %ENV? (Kai Henningsen)
Help with an array test <jeffbREMOVETHIS@mcguckin.com>
Re: Help with CGI-BIN <rootbeer@redcat.com>
Re: How to convert a text file to 0-byte lenght? (Mitchell Morris)
Re: How to convert a text file to 0-byte lenght? <swiftkid@bigfoot.com>
Re: How to convert a text file to 0-byte lenght? <swiftkid@bigfoot.com>
Re: looking for a key to octalcode list (Greg Bacon)
Re: MKTEMP <doughera@lafayette.edu>
Re: Mysterious segmentation fault in mod_perl <dave@northnet.com.au>
Re: Need help building a list of files (Anno Siegel)
Pattern matching $1-$n not being pulled e_broyles2@my-deja.com
Pattern matching $1-$n not being pulled e_broyles2@my-deja.com
Re: perl CGI Redirection <foroobar@erols.com>
Re: Problem Installing Tk 8.000.14 - make => line too l (Anno Siegel)
Re: search and replace with <> (Anno Siegel)
Re: Server side issues... <rootbeer@redcat.com>
SSI (Server Side Includes) <shades__@mitec.net>
Re: SSI (Server Side Includes) (Anno Siegel)
Re: SSI (Server Side Includes) <swiftkid@bigfoot.com>
Starting asynchronous process from Perl <pweingart@worldnet.att.net>
Re: Storing "Complex" datastructures <rootbeer@redcat.com>
Storing session data in IPC vs DB File <clint@drtech.co.uk>
Re: There is a smarter way, but i dont know how. <pweingart@worldnet.att.net>
Using WindowsNT and ActivePerl and Job Scheduling (at c <jdevine@thegift.com>
Re: Web NewsReader <rootbeer@redcat.com>
why doesn't this for loop work <mikecard@my-deja.com>
Re: why doesn't this for loop work <swiftkid@bigfoot.com>
Re: win32 file access <kpmasse@cs.sandia.gov>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 29 Jun 1999 20:01:48 +0200
From: Robert de Geus <robert@corpus.nl>
Subject: Re: blocking SIGINT and SIGQUIT
Message-Id: <37790A0C.41080C0D@corpus.nl>
sub SignalHandler {
$signal = shift;
# etc...
}
$SIG{SIGINT} = \&SignalHandler;
Robert de Geus
Amsterdam
jaya wrote:
> we have a large program that really needs to have a handler for SIGINT
> and SIGQUIT.
>
> looking at perlfunc manpage and grepping through the perlmanpages for
> handling of signals did not help me. perhaps i am not looking for the
> right keywords.
>
> so i am wondering if there is a way to wrap the original program in
> something that will allow me to clear up any temp files created when
> the program sees a SIGINT.
>
> also please let me know how you discovered the solution so that i can
> figure stuff like this out in the future.
>
> thanks,
> jaya
------------------------------
Date: Wed, 30 Jun 1999 13:43:28 -0500
From: "Jeremiah and Veronica" <adams1015@worldnet.att.net>
Subject: Filehandles, appending a file..why dosn't this work?
Message-Id: <7lb4vo$iuk$1@bgtnsc01.worldnet.att.net>
I'm a newbie having a hardtime getting a script to append a file. I can get
the script to append just fine through telnet but cannot get it to work from
a browser. I've chomoded all the files to 777 out of shere frustration and
still cannot get the script to append the file. Here is the file handle
lines I am using
open (ORDERLOG, ">>orderlog") or die "Can't open orderlog.\n";
print ORDERLOG $adjective2, \n;
print ORDERLOG $adjective3, \n;
print ORDERLOG "***********************************************\n";
close ORDERLOG;
incidently, I am asuming that it is priniting the variables correctly
because the variables are parsed from a form.The scripts writes the
following to the ORDERLOG file:
SCALAR(0x80c06b4)SCALAR(0x80c06cc)
------------------------------
Date: Tue, 29 Jun 1999 11:40:22 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Foreach on hash gives undefined value
Message-Id: <Pine.GSO.4.02A.9906291135560.4425-100000@user2.teleport.com>
On Mon, 28 Jun 1999, Thomas Weholt wrote:
> When the following script is run, it prints out a entry in the
> %records_hash that doesn`t exists, and reports "use of unintitialized
> value". Why?
Nobody knows because you didn't post the actual code you're using. There
seems to be a semicolon missing in what you posted, so it won't run at
all. But rather than posting it again, cut it down to the minimal example
which demonstrates the problem you're having. That is, keep it to a dozen
lines or fewer, and don't use any modules if you can help it. The ideal
example shows clearly the one line of code which isn't doing what you
expected.
When I fixed the error and removed the code to use tied hashes, this code
did just what I expected.
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 29 Jun 1999 17:02:02 GMT
From: kloomis@it-resourcesNOSPAM.com (Ken)
Subject: Forms Processing - thread started in HTML group
Message-Id: <3778fac7.13647775@news.tiac.net>
I have a form on a website that directs people to fill in infomation
and check boxes. If all is well, the form info gets sent and a
message appears that thanks them and provides further instructions.
I want to have it so that if a certain box is checked, the info is not
set and a different web message appears that tells them that for some
reason they are disqualified.
Can someone suggest how this would be done?
If e-mailing remove the obvious.
Thanks
Ken
Ken Loomis
IT Resources
Lexington, MA
www.it-resources.com
------------------------------
Date: Tue, 29 Jun 1999 22:44:46 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Forms Processing - thread started in HTML group
Message-Id: <7lc3ut$57d7@news.cyber.net.pk>
Ken <kloomis@it-resourcesNOSPAM.com> wrote in message
news:3778fac7.13647775@news.tiac.net...
<snip>
> I want to have it so that if a certain box is checked, the info is not
> set and a different web message appears that tells them that for some
> reason they are disqualified.
<snip>
You mean something like this:
<input type=checkbox name=mycheck value=on>
CGI:
use CGI qw/:standard/;
print header;
&field_missing unless param 'mycheck';
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift ICQ: 4265451
FAX: (815) 846-2877
------------------------------
Date: 29 Jun 1999 19:40:00 +0200
From: kaih=7Jll2Lb1w-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Having an external script modify %ENV?
Message-Id: <7Jll2Lb1w-B@khms.westfalen.de>
gellyfish@gellyfish.com (Jonathan Stowe) wrote on 26.06.99 in <7l3jro$4sp$1@gellyfish.btinternet.com>:
> On 26 Jun 1999 16:59:00 +0200 Kai Henningsen wrote:
> > akhazano@oacis.com (Andrew Khazanov) wrote on 23.06.99 in
> > <37743986.69506154@news.isp.net>:
> >
> > You can make a wrapper shell script that, after running those other
> > scripts, lists the current state of its environment. Then you can take
> > that information from perl and use it to feed the next invocation. Or
> > maybe you just redirect it to a file and make the wrapper script execute
> > that file at the start.
> >
>
> Isnt that why we ask people to read the FAQ for comp.unix.programmer ?
I have no idea. That's just what I did in a similar situation. I didn't
need any FAQ to get that idea, either.
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: Tue, 29 Jun 1999 12:38:15 -0600
From: Jeff Beard <jeffbREMOVETHIS@mcguckin.com>
Subject: Help with an array test
Message-Id: <37791297.66392A21@mcguckin.com>
Hi,
I need to test an array to see if all values are null. If they are, do
one things if not, do another. I've been playing with loops that test if
each element is null but I need to know if they're all null.
Any help is appreciated.
Cheers,
Jeff
--
-------------------------------------------------------
Clean up my email address before using it to reply
-------------------------------------------------------
Jeff Beard
McGuckin Hardware
Boulder, CO
------------------------------
Date: Tue, 29 Jun 1999 11:17:28 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Help with CGI-BIN
Message-Id: <Pine.GSO.4.02A.9906291115100.4425-100000@user2.teleport.com>
On Mon, 28 Jun 1999, sam wrote:
> if there's anyone who has the time and patience to explain to me how
> to install the script into my CGI-BIN,
That would be your local help desk. It's not a Perl question. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 29 Jun 1999 16:36:46 GMT
From: mgm@unpkhswm04.bscc.bls.com (Mitchell Morris)
Subject: Re: How to convert a text file to 0-byte lenght?
Message-Id: <slrn7nhtgv.cm6.mgm@unpkhswm04.bscc.bls.com>
In article <7lbrgt$3uo11@news.cyber.net.pk>, Faisal Nasim wrote:
[snip]
>
>$/ = undef;
>open FILE , "+<file.txt";
> $data = <FILE>;
> truncate FILE , 0;
>close FILE;
>
>
>--
>Faisal Nasim (the Whiz Kid)
>Web: http://wss.hypermart.net/
>AOL: Whiz Swift ICQ: 4265451
>FAX: (815) 846-2877
Since you can also pass an EXPR as a filename to truncate, you can also
trvially:
truncate "file.txt", 0;
--
Mitchell Morris
I will always cherish the initial misconceptions I had about you.
------------------------------
Date: Tue, 29 Jun 1999 22:26:11 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: How to convert a text file to 0-byte lenght?
Message-Id: <7lc2s4$5if2@news.cyber.net.pk>
> I see you still haven't got this newsreader thing down. :-(
You mean Outlook Express? Well, I like it very much and
I don't have any other choice! I got a winmodem,
thus I cannot connect from Linux :(
Outlook offers more features than Netscape, thus I have to
use Outlook!
But look, I shortened my sig, removed that separator, and I
try to quote the message as less as possible! And also put
reply after the quoted message.
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift ICQ: 4265451
FAX: (815) 846-2877
------------------------------
Date: Tue, 29 Jun 1999 22:26:59 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: How to convert a text file to 0-byte lenght?
Message-Id: <7lc2tm$57d4@news.cyber.net.pk>
Jim <jim@*nospam*network-2001.com> wrote in message
news:7larhf$sgm$1@news3.infoave.net...
> open (EMP, ">$file") || die $!;
> print EMP "";
> close (EMP);
The print() statement is not required
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift ICQ: 4265451
FAX: (815) 846-2877
------------------------------
Date: 29 Jun 1999 18:38:00 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: looking for a key to octalcode list
Message-Id: <7lb3q8$kjg$2@info2.uah.edu>
In article <3778614D.F73DA032@cyberdude.com>,
slinden <jorp@cyberdude.com> writes:
: i am looking for a key(board) to octalcode list
: a list that contains e.g.
: that the ESC-key is 033 in octal.
% man ascii
What's your Perl question?
Greg
--
Cop: I can put you in Queens on the night of the hijacking.
Hockney: Really? I live in Queens. Did you put that together yourself?
------------------------------
Date: Tue, 29 Jun 1999 14:05:05 -0400
From: Andy Dougherty <doughera@lafayette.edu>
Subject: Re: MKTEMP
Message-Id: <Pine.GSU.4.05.9906291400170.6973-100000@newton.phys>
On Tue, 29 Jun 1999, Scott Pritchett wrote:
> Does anyone know of the Perl equivalent to C's MKTEMP or MKSTEMP which
> apparebtly guarantees a(n) unique filename?
Though not exactly the same, POSIX::tmpnam and IO::File::new_tmpfile
might be suitable for what you want to do.
Alternatively, it should be quite easy to use h2xs to build an extension
that gives you access to mkstemp().
Hope this helps,
Andy Dougherty doughera@lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
------------------------------
Date: Wed, 30 Jun 1999 02:15:15 +1000
From: David Nillesen <dave@northnet.com.au>
Subject: Re: Mysterious segmentation fault in mod_perl
Message-Id: <3778F113.55B3B5CF@northnet.com.au>
I had similar wierd problems with mod_perl and it turned out RedHat were
giving out a crappy version of mod_perl.
You seem to have a more recent version then i did but it may still be evil
libraries or something.
Its fairly obvious, but make sure you are running the latest of all updates
for your distrobution of unix and recompile everything.
Bye,
Dave
hovinen@my-deja.com wrote:
> Hello
>
> I have a script and a bunch of modules that I'm trying to run under
> mod_perl. Whenever I try to run the script, it parses through and
> executes the code in all of the modules and then mysteriously segfaults.
> I have been trying for several hours and still cannot locate the exact
> point where the segmentation fault occurs. Running the script manually
> does not cause this problem, and the Perl interpreter reports no
> warnings when run with `perl -w -T'.
>
> Any help in solving this problem would be appreciated. I'm running Perl
> 5.00503, Apache 1.36, and mod_perl 1.19.
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
--
David Nillesen
Northnet Internet Services
+612 67749300
For info on what this jumble below is look right at the bottom.
Type Bits/KeyID Date User ID
pub 2048/BBCA4E3D 1998/01/03 David A Nillesen
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3ia
mQENAzSuzZAAAAEIALp91sG9Nq85LKUmvQJlF1imz89BSaoJGb5Dx3pSMhsCztFo
l9iLvGDKQoDXFw7g0FKHme2mBypIeNctBnFCC57xFKDjbJz4KIljN1ngPewgwH2e
PlR0Hm/ocIkuh33HnueJYUC8d8bmAACGAavt40Y+5nVxXcbz+6lGUXEzcdnlKh/E
Oo5MDJnLk1cVl8YgdILKT584oCBWbfBvS9pwNyjwX+HW0cX0f8cOLlGJJNtOtUnm
fff1eV5ZXNXEE7YM2uf3p5u/eCtM0poJA8yY3MwhPiu9a4sjRe7zFpBdTGIBJB+8
iEX7IbQf/NsT8hqkg44IpujnjBGBPqGUAbvKTj0ABRG0J0RhdmlkIEEgTmlsbGVz
ZW4gPGRhdmVAbm9ydGhuZXQuY29tLmF1PokBFQMFEDSuzZA+oZQBu8pOPQEB5j4H
/169BcOssg2lXzTFxmR2ifF1rd0k5PlnCSVEE6+h6EtvZ4uPc+zJTbBLqszV2kfr
WRoiSWTzDVMySMYFmOl+azdkedgqS6GBOl+qBC0w88slFj6kXP1lzLuEDT1Hoxta
NQeleOU0hDibnv0losv4rcis7cThD8YClqkiRStw7IBEgStA3d8o+CMGzdzgvMx4
bqTPDRaTSmGA2Pay5am6/uT1gvEbrjSb8QbDkpKav1cUFYOyIQ6k3XoNZX8eUeqB
kl8c4mg3D0Z9pAY
------------------------------
Date: 29 Jun 1999 17:59:46 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Need help building a list of files
Message-Id: <7lb1ii$a90$1@lublin.zrz.tu-berlin.de>
Keith Lee <leejk@cat.com> wrote in comp.lang.perl.misc:
>Hello,
> I have a situation where I need to read a directory listing of files,
>copy the contents of individual files in this directory based on which
>filenames the user inputs from a command line, and create a newfile
>containing the contents of all the files copied that the user specified. I
>have wrote a little something, but when run it goes off into la la land. Can
>any of you Perl gurus take a look at it, and make some suggestions?
>
>@input = <STDIN>;
># open the text files directory and get a listing of the files there
>opendir (TXTDIR, "$txt_dir") or die "can't open text files directory: $!";
>@txtfiles = readdir(TXTDIR);
>closedir (TXTDIR);
>
> FILE: foreach $file (@txtfiles) {
> if (grep {$file eq $input[@input]} @txtfiles) {
Oh dear. What is this grep supposed to do? And have you switched
on warnings?
[rest snipped]
I suppose you want to extract those filenames from @txtfiles that
also appear in the users @input. I so, see perldoc -q intersection.
Also, if you set up @input = <STDIN>, you'll have an array of the
lines the user has typed. If he has given more than one filename
on a line, you'll have to split the line on a convenient separator.
For that, see perldoc -f split.
Anno
------------------------------
Date: Tue, 29 Jun 1999 18:42:24 GMT
From: e_broyles2@my-deja.com
Subject: Pattern matching $1-$n not being pulled
Message-Id: <7lb42d$o33$1@nnrp1.deja.com>
Can someone tell me why when I do this:
$myvar = "134:00:34:56";
if ($myvar =~ /(.*?):(.*?):(.*?):(.*?)/) {
print "$1\n";
print "$2\n";
print "$3\n";
print "$4\n";
}
I get the following output:
134
00
34
Instead of
134
00
34
56
Thanks!
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 29 Jun 1999 18:41:27 GMT
From: e_broyles2@my-deja.com
Subject: Pattern matching $1-$n not being pulled
Message-Id: <7lb40k$o2h$1@nnrp1.deja.com>
Can someone tell me why when I do this:
$myvar = "134:00:34:56";
if ($myvar =~ /(.*?):(.*?):(.*?):(.*?)/) {
print "$1\n";
print "$2\n";
print "$3\n";
print "$4\n";
}
I get the following output:
134
00
34
Instead of
134
00
34
56
Thanks!
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 29 Jun 1999 13:57:41 -0400
From: "Mike Foroobar" <foroobar@erols.com>
Subject: Re: perl CGI Redirection
Message-Id: <7lb1cb$3s3$1@autumn.news.rcn.net>
Just make two frames, like this:
<frameset rows="*,100%" frameborder="0">
<frame name="blank" src="blank.html" scrolling="No" frameborder="0"
noresize>
<frame name="content"
src="http://www.somehost.com/~someuser/somepage.html" scrolling="Auto"
frameborder="0" noresize>
</frameset>
and make a file with nothing in it and call it blank.html or change the
frames a bit. Now the url will look like something that it isn't. No CCI,
just creativity.
Mike Foroobar
Ben Short <bshort@n0spam.shortboy.dhs.org> wrote in message
MPG.11e21bb9abddcfe79896b7@loomi.telstra.net...
>Hi,
>
>I was wondering if anybody has out there a *free* URL redirection script
>that also does "seamless redirection" (that is, user sees foo.org, but
>files are at someotherplace.com/~someuser/somedir/file.htm)
>
>The only scripts I can see like this are either commercial, or are simply
>creating a page with a META HTTP-EQUIV Refresh in them, which dont allow
>for seamless redirection.
>
>Any assistance is greatly appreciated.
>
>Regards
>Ben
>--
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>Ben Short http://www.shortboy.dhs.org
>Shortboy Productions mailto:bshort@n0spam.shortboy.dhs.org
>
>*Remove n0spam to email me*
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: 29 Jun 1999 17:15:26 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Problem Installing Tk 8.000.14 - make => line too long
Message-Id: <7lauve$7g3$1@lublin.zrz.tu-berlin.de>
Simon griffiths <s.grififths@virgin.net> wrote in comp.lang.perl.misc:
>The line in question is - I think -
>
># --- MakeMaker pm_to_blib section:
>
>pm_to_blib: $(TO_INST_PM)
> @$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
> "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
> -e "pm_to_blib({qw{$(PM_TO_BLIB)}},'$(INST_LIB)/auto')"
>
>- in other words its only the expansion that's the problem !
>Thus splitting into separate lines is not an option !
Oh, okay. $(PM_TO_BLIB) is indeed a biggie, it could be something
like 10 or 20 K. Gnu make swallows it with no hickup though.
What kind of make have you got?
I dunno, could there be a way to make a make-variable *expand*
to continuation lines? That might be another cop-out.
Anno
------------------------------
Date: 29 Jun 1999 18:35:44 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: search and replace with <>
Message-Id: <7lb3m0$brs$1@lublin.zrz.tu-berlin.de>
Phil R Lawrence <prlawrence@lehigh.edu> wrote in comp.lang.perl.misc:
>This Search and Replace script seems to correctly go through the files, but
>while it claims there have been replacements, no change has actually been made
>to the files in question. Can anyone see why?
>
>snr.pl:
>________________________
>#!/usr/local/bin/perl -w
>use diagnostics;
>use strict;
>
>#usage: snr files* -s "search_str" -r "replace_str"
>
>my $replace = pop;
>die "No replace string!\n" unless (pop =~ /-r/);
>my $search = pop;
>die "No search string!\n" unless (pop =~ /-s/);
>
>my $count = 0;
>while (<>) {
> $count += s/$search/$replace/og;
>}
>print "Replaced \"$search\" with \"$replace\" $count times.\n";
Well, you never write anything to a file in this script, so how
do you expect a poor file to change? Also, reading from <> as you do
will concatenate all the files the user names, which is probably
not what you want. While there are ways to tell them apart (see
the __FILE__ token) it would be tedious to do so here. Look into
the -i and -p command line options of perl to get the behavior
you seem to expect.
Further: It is customary for command line switches like your
-s and -r above to be placed before any file (or other) arguments.
The Getopt::Std module will process them for you so that they are
out of the way when you get to look at @ARGV. It will also do
a better job on error checking than you do in that script, though
it's laudable you do any checking at all.
Good luck,
Anno
------------------------------
Date: Tue, 29 Jun 1999 11:30:09 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Server side issues...
Message-Id: <Pine.GSO.4.02A.9906291129180.4425-100000@user2.teleport.com>
On Mon, 28 Jun 1999, Anders Johansson wrote:
> Is there a book available on server part, like the Web client
> programming - for server?
There probably is. Do you know how to find the docs, FAQs, and newsgroups
about webservers and programs in the CGI environment?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 29 Jun 1999 00:15:37 -0500
From: "Daniel Ulrich" <shades__@mitec.net>
Subject: SSI (Server Side Includes)
Message-Id: <3778ffd7@news5.newsfeeds.com>
Hi,
I need to send a server side include a variable (a code to tell it what
to display) but I can't seem to do this. I am using Perl 5 on a Linx/Apache
server. Is there a way that I can do this. I have tried cgi="script.pl?a"
wont work. cgi="script.pl$a" works but I can't find the variable in the env
or argv. If someone can help me? If you can please email me a
shades__@mitec.net.
Thanks,
Shades__
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 29 Jun 1999 17:51:11 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: SSI (Server Side Includes)
Message-Id: <7lb12g$9if$1@lublin.zrz.tu-berlin.de>
Daniel Ulrich <shades__@mitec.net> wrote in comp.lang.perl.misc:
>Hi,
> I need to send a server side include a variable (a code to tell it what
>to display) but I can't seem to do this. I am using Perl 5 on a Linx/Apache
>server. Is there a way that I can do this. I have tried cgi="script.pl?a"
>wont work. cgi="script.pl$a" works but I can't find the variable in the env
What on earth are you trying to do? Where is the (contents of the)
variable coming from? And why should it miraculously appear in
your environment when you call your script by another name?
Valid questions, none of which have to do with perl. Try one
of the cgi- or html-oriented newsgroups.
>or argv. If someone can help me? If you can please email me a
>shades__@mitec.net.
Nope. You post here, you read here.
Anno
------------------------------
Date: Tue, 29 Jun 1999 22:35:33 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: SSI (Server Side Includes)
Message-Id: <7lc3dm$57d5@news.cyber.net.pk>
Daniel Ulrich <shades__@mitec.net> wrote in message
news:3778ffd7@news5.newsfeeds.com...
> Hi,
> I need to send a server side include a variable (a code to tell it
what
> to display) but I can't seem to do this. I am using Perl 5 on a
Linx/Apache
> server. Is there a way that I can do this. I have tried cgi="script.pl?a"
<snip>
SSI:
<!--#include virtual="/blah/mycgi.pl?info" -->
CGI:
you can find "info" in $ENV { 'QUERY_STRING' }
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift ICQ: 4265451
FAX: (815) 846-2877
------------------------------
Date: Tue, 29 Jun 1999 14:52:08 -0400
From: Philip Weingart <pweingart@worldnet.att.net>
Subject: Starting asynchronous process from Perl
Message-Id: <377915D8.21118806@worldnet.att.net>
Hi, all,
I think perhaps I'm having a brain hiccup, and there's a simple answer, but I
can't think of it for the life of me.
I want to fire off a subprocess from a Perl script and continue with the script
without waiting for the subprocess to finish. In the Korn shell something like
this is simple; you just enclose the call in parenthesis, invoking a subshell.
How do I do it in Perl?
Email replies especially welcome, and thanks in advance.
Phil Weingart
pweingart@worldnet.att.net
------------------------------
Date: Tue, 29 Jun 1999 11:24:10 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Storing "Complex" datastructures
Message-Id: <Pine.GSO.4.02A.9906291120340.4425-100000@user2.teleport.com>
On Mon, 28 Jun 1999, Thomas Weholt wrote:
> I got a database-like structure I`d want to store to disk.
Maybe you want the modules for "Persistent Storage" from the CPAN Modules
List.
http://www.cpan.org/modules/00modlist.long.html
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 29 Jun 1999 18:59:59 +0100
From: "Clinton Gormley" <clint@drtech.co.uk>
Subject: Storing session data in IPC vs DB File
Message-Id: <7lb19f$567$1@taliesin.netcom.net.uk>
I am wanting to store session data in between requests to my Apache server
(running with mod_perl)
My two options are to use IPC::Shareable and DB File - both work. Howvever,
I am unable to test them in the live environment yet.
To compare speeds of the two methods, I wrote a little script which tied
%HASH to IPC::Shareable or DB File with {KEY=>'0'}. Then, it read the value
of KEY, incremented it, printed it and then wrote the new value of KEY back
to either shared memory or disk.
DB File seemed to be a lot faster than IPC (both using Storable to linearize
the data).
Why is this so? Would IPC gain the upper hand if there were a 1000 keys, or
if there is other database activity happening at the same time?
Why is IPC so slow in the first place? (I'm running RedHat 6)
Any input would be appreciated
Thanks
Clint
------------------------------
Date: Tue, 29 Jun 1999 15:00:54 -0400
From: Philip Weingart <pweingart@worldnet.att.net>
Subject: Re: There is a smarter way, but i dont know how.
Message-Id: <377917E6.E37BB615@worldnet.att.net>
Martin Quensel wrote:
>
> Hello!
>
> I want the 10 first variables in an array, but it seems like i have to use
> foreach, instead of a simple "for".
>
> Then i sort the hash like this:
>
> @SortedURLs = sort { $Urls{$b} <=> $Urls{$a} } keys %Urls;
>
> This i can do like this i think...dont know if it works yet
>
> for($i=0;$i<10;$i++)
> {
> print "%Urls{@SortedUrls[$i]} @SortedUrls[$i]\n";
> }
>
> But if this works..isent there another better way? Am i at least thinking in
> the right direction??
It should work. I would have written it to use an array instead of a hash, but
that's just a personal preference; with a list this small, I doubt there's much
point in worrying about efficiency.
Your print statement syntax has an error; it should be "%Urls{$SortedUrls[$i]}."
Dollar sign ($) in front of the array variable, not At sign (@). I would use tab
characters or formats to separate the two fields in the print statement, to make
the columns line up. And, you must put a conditional "last" statement inside the
for loop, against the condition that there are fewer than ten Urls in the list.
Aside from that, you should be ok.
Phil Weingart
pweingart@worldnet.att.net
------------------------------
Date: Tue, 29 Jun 1999 17:13:20 GMT
From: Joe Devine <jdevine@thegift.com>
Subject: Using WindowsNT and ActivePerl and Job Scheduling (at command)
Message-Id: <37790163.CF7289F6@thegift.com>
This is a multi-part message in MIME format.
--------------8A5043ED7795FDAAA196E01F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I've managed to get my PERL scripts running with the
Windows NT AT command by putting them in a batch
batch file before I call PERL.
However, PERL seems to have some problems reading
the remotely mapped (network) drive that I'm trying to
list when running under AT.
When I run the PERL program from the command line
(DOS) it works just fine. But the readdir() function in
my script returns nothing when it runs under AT.
So my questions are thus:
1. Has anyone tried to do this and if so, how?
2. Is there anything obvious that I might be doing wrong?
3. Are there any PERL modules that might help with
reading remotely mapped drives?
Thanks in advance!!!
jdevine@thegift.com
--------------8A5043ED7795FDAAA196E01F
Content-Type: text/x-vcard; charset=us-ascii;
name="jdevine.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Joe Devine
Content-Disposition: attachment;
filename="jdevine.vcf"
begin:vcard
n:Devine;Joe
tel;pager:817.425.5541
tel;cell:817.919.5436
tel;fax:817.421.9800
tel;work:817.410.2111x17
x-mozilla-html:TRUE
url:http://wwwTheGift.com/
org:TheGift.com
version:2.1
email;internet:jdevine@TheGift.com
title:Director - Information Technology
adr;quoted-printable:;;751 Port America Place=0D=0ASuite 700;Grapevine;Texas;76051;USA
fn:Joe Devine
end:vcard
--------------8A5043ED7795FDAAA196E01F--
------------------------------
Date: Tue, 29 Jun 1999 10:53:03 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Web NewsReader
Message-Id: <Pine.GSO.4.02A.9906291051360.4425-100000@user2.teleport.com>
On Sun, 27 Jun 1999, Tanya wrote:
> How can i use a broswer to read news
> in certain newsgroup via perl script
You asked this already. In what way were the already-given answers
insufficient?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 29 Jun 1999 17:08:30 GMT
From: mike cardeiro <mikecard@my-deja.com>
Subject: why doesn't this for loop work
Message-Id: <7laui3$lep$1@nnrp1.deja.com>
hi
i have a for loop that does not do what i expect it to do. basically it
is three for loops wrapped into one. what i expect to have happen is
each time the master loop (if there is such a term) goes through a
cycle, a sub-loop goes through 3 cycles, each time pushing part of on
array into another and incrementing $card_place.
when that loop is finished another loop goes through 3 cycles each time
printing out the sum of $card_place plus the number of loop this
particular loop is on.
when i read through it it seems like it should work but when i run it
the final loop prints out the same number 3 times instead of 3
consecutive numbers. anyway its probably easier to read than explain so
the source code is below
#!/usr/bin/perl -w
require "pitchsub.cgi";
$num_players = 2; # 3 players
$card_place = 0;
for ($y = 0, $y <= $num_players, ++$y) {
for (0..2) {
push @p_hand, $deck[$card_place];
++$card_place;
}
for ($a = 0, $a <= 2, ++$a) {
print $card_place + $a, "\n";
}
}
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 29 Jun 1999 22:32:25 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: why doesn't this for loop work
Message-Id: <7lc37p$5if3@news.cyber.net.pk>
> for ($y = 0, $y <= $num_players, ++$y) {
Just scrolled down and saw that!
You have to use ; instead of ,
for ( $y = 0 ; $y <= $num_players ; $y++ ) {
#$y++ or ++$y doesn't make a difference here
comma is used like this:
for ( $y = 0 , $z = 0 ; $y <= $num_players ; $y++ ) {
etc
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift ICQ: 4265451
FAX: (815) 846-2877
------------------------------
Date: Tue, 29 Jun 1999 12:48:04 -0600
From: Kenneth Massey <kpmasse@cs.sandia.gov>
To: Faisal Nasim <swiftkid@bigfoot.com>
Subject: Re: win32 file access
Message-Id: <377914E4.E3BDE87@cs.sandia.gov>
I've tried the .tmp solution, but unlink does not delete the file. What
is the command to delete a file for NT. I read previously that flock()
should work on NT, but I wrote a test script that simply
{opened,locked,delayed 20 seconds,closed,unlocked} in that order (is
that the correct order?). I then was able to run the script a second
time while the first run supposedly had the file locked for 20 seconds.
Thanks for your help.
Kenneth
Faisal Nasim wrote:
>
> flock() should work on NT.
>
> Anyway you can always create a .tmp file and delete it after close(),
>
>
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 6166
**************************************