[12697] in Perl-Users-Digest
Perl-Users Digest, Issue: 106 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 11 00:07:31 1999
Date: Sat, 10 Jul 1999 21:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 10 Jul 1999 Volume: 9 Number: 106
Today's topics:
Re: ActiveState's PerlScript <john@dlugosz.com>
Array of Hash References <anonymous@web.remarq.com>
Re: Array of Hash References <rpsavage@ozemail.com.au>
Re: cgi.pm question <mattias.arvidsson@post.utfors.se>
Re: Changing case local-specifically (Larry Rosler)
Re: Changing case local-specifically (Neko)
Re: Changing case local-specifically (Abigail)
Re: Changing case local-specifically <rick.delaney@home.com>
Re: Global variables from a module <tye@metronet.com>
Re: Help -- Weird Increments (MacPerl) <tmornini@netcom9.netcom.com>
Re: Help: creating files through a CGI <mattias.arvidsson@post.utfors.se>
Re: How secure is my Perl code on the web? <flavell@mail.cern.ch>
Re: How secure is my Perl code on the web? <ptimmins@itd.sterling.com>
Re: one-file Perl for Win32 <carvdawg@patriot.net>
Re: PERLFUNC: tr/// - transliterate a string <uri@sysarch.com>
Problem with sleeping script fireball402@my-deja.com
Re: Problem with sleeping script <flavell@mail.cern.ch>
Re: Problem with sleeping script (Abigail)
Re: Simulating CRON (David Efflandt)
Re: Simulating CRON <rpsavage@ozemail.com.au>
Use a Perl Module w/o Installing It? nkaiser@my-deja.com
Re: variable "$foo" will not stay shared (Tad McClellan)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 10 Jul 1999 20:48:44 -0500
From: "John M. Dlugosz" <john@dlugosz.com>
Subject: Re: ActiveState's PerlScript
Message-Id: <603AC75C91438E36.8545B8EF2FCFFD4E.02A7B8132B1AB626@lp.airnews.net>
David Cassell <cassell@mail.cor.epa.gov> wrote in message
news:3787925C.7E65C418@mail.cor.epa.gov...
> BTW, ActiveState's PerlScript is an ActiveX scripting engine
> which allows one to use Perl with any ActiveX scripting host.
> Do you mean Perl or PerlScript?
I indeed mean PerlScript, as called by an ActiveX scripting host, IE in this
particular case. I was experimenting with using HTML as a GUI for
Perl-based apps using Dynamic HTML and PerlScript. Last week, I wrote a
real solution this way, and ran into problems.
> > I've been using it, and have discovered a lack of documentation, and
some
> > weird problems.
>
> That's very peculiar. ActiveState Perl comes with more
> on-line docs than you can shake a stick at.. assuming one
> would want to shake a stick at documents. :-)
Not for Perl<B>Script</B>. In particular, the "object model", seen as other
functions and globals to the running code, needs to interface with Perl
somehow. Just poking around, I found that in IE the $window variable
corresponds to the Window top-level object in the DHTML Object Model.
Meanwhile, VB and Java Script people can just use document as another such
global, but it seemed to be missing in PerlScript. So I assigned $document=
$window->document or whatever the correct access path was, and then found
that any use of $document would crash Perl. Even if I =didn't= make that
assignment, $document would crash Perl. I even tried doing a print ref
$document to see what kind of object it was (some kind of OLE I assume) and
=that= crashes. So it appears that $document is set up as a global to
access the document object provided by the host, but it has some kind of
broken magic.
> Don't you have the entire HTML doc tree? Don't you have the
> FAQs? The POD? perldoc? The module documentation? If
> you do not, then you do not have Perl. Real copies of Perl
> have all that stuff as part of the install.
Perl =Script=, not Perl Proper. Yes, I've read all the regular docs and
everything from ActiveState. More classes (undocumented), more magic
(undocumented), caveats, etc. and no instructions whatsoever -- just a
paragraph that says PerlScript is a scripting engine.
> File::Find works for everyone else. I'm not being flippant
> here. What do you mean 'not work'? Are you using -w and
> 'use strict'? Are you getting errors? Are you getting
> results different from what you expected? You're not giving
> me much to work with here.
>
> I've never seen $main::document or anything similar crash
> Perl. Try this at the command line:
>
> perl -e "$document=qq(yuck!\n); print $main::document;"
>
> It works, right? If it doesn't then your Perl may be busted.
Yes, the module works in a regular command-line hosted Perl interpreter.
The same code fails under PerlScript. It appears to not traverse
subdirectories at all, and something else may be happening -- I'd have to
look at the results again to be sure. But if someone knows why this module
doesn't work in PerlScript, or what kind of stuff in general affects
PerlScript, or if there is a list of known problems, then I can save this
specific debugging chore. Understand?
> And why on earth would you *need* to say $main::document ?
> Are you defining a global variable somewhere, then creating
> a variable with the identical name in some package and
> having to tell the difference while in that package?
It has to do with the way <anything>Script works. IE provides globals
window, document, and others to any script.
> I think that you're going to have to submit some code and
> results in this NG before I believe that the problem is
> Perl rather than your code.
I'd rather save the effort of building small test cases etc. until I find
out if there is already a list of problems, differences, and general issues
concerning PerlScript. That's all I was asking -- not a request to debug my
specific problem.
The Sb: line =says= "PerlScript". I'm sorry you thought this was a newbe
general Perl question.
--John
------------------------------
Date: Sat, 10 Jul 1999 17:43:53 -0800
From: Ashish Kadakia <anonymous@web.remarq.com>
Subject: Array of Hash References
Message-Id: <931657435.9509@www.remarq.com>
I have simple question:
$a = {};
push @ary, $a;
foreach (@p){ print "Matches" if /$a/; }
dosen't work..
If I replace the first line by
$a=10;
it works fine..
somehow it fails to match the hash-references.
Can you point me, how I should modify my if-statement.
Thank You
**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****
------------------------------
Date: Sun, 11 Jul 1999 13:48:57 +1000
From: "Pen and Ron Savage" <rpsavage@ozemail.com.au>
Subject: Re: Array of Hash References
Message-Id: <%xUh3.1949$1u.18025@ozemail.com.au>
See below
--
Cheers
ron@savage.net.au
pen@savage.net.au
http://savage.net.au/
Ashish Kadakia wrote in message <931657435.9509@www.remarq.com>...
>I have simple question:
>$a = {};
>push @ary, $a;
>foreach (@p){ print "Matches" if /$a/; }
Surely you meant 'foreach (@ary)...'?
Please publish complete working programs in future, so we can run them
without having to type in scaffolding code.
>
>dosen't work..
>
>If I replace the first line by
>$a=10;
>
>it works fine..
>
>somehow it fails to match the hash-references.
>Can you point me, how I should modify my if-statement.
Yes? Modify your if stmt to do what, exactly?
>Thank You
>
>
>
>
>
>**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here
(tm) ****
------------------------------
Date: Sat, 10 Jul 1999 02:54:37 +0200
From: Mattias <mattias.arvidsson@post.utfors.se>
To: John Hurley <jhurleyremove@njsba.org>
Subject: Re: cgi.pm question
Message-Id: <378699CD.7C8C3F5E@post.utfors.se>
John Hurley wrote:
> hi all,
>
> I have been having a problem with using cgi mail forms on my web site
> for quite some time. And I THINK I found the problem and want to know
> if it is possible.......
>
> My site is running on a BSD server and every time i try to run a Perl
> program on it with the use CGI line, i get a 500 error. Can it be
> that the Perl interpreter on the server may be an old version that
> does not contain cgi.pm on it? I have been trying to get a hold of my
> isp for a while now to find out about this and have not been replied
> to yet. So I just thought I would ask you Perl pros.
>
> Thanks,
> John M Hurley
----8<-----
I'ts hardly possible that any perlmodules at all will exist on a
perl-supporting webhotel.
They are always removed and not there..
-
Dr.H
------------------------------
Date: Sat, 10 Jul 1999 19:17:02 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Changing case local-specifically
Message-Id: <MPG.11f19e74e1b458c989c9b@nntp.hpl.hp.com>
In article <x7r9mgovwg.fsf@home.sysarch.com> on 10 Jul 1999 20:46:55 -
0400, Uri Guttman <uri@sysarch.com> says...
> >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
>
> >> my @left = map chr, ord('A') .. 0xFF;
> >> my @right = map {$_ ne uc $_ ? uc : lc} @left;
> >> eval "sub TR { \$_[0] =~ tr/@left/@right/ }";
>
> having finally looked at that trick closely i wonder if you are setting
> $" to '' before you build the TR? otherwise, you will get a space char
> interpolated between each char in @left and @right. it shouldn't affect
> the functionality but it does make for a longer tr/// and a slightly
> slower execution, i would imagine.
Never having interpolated an array in that context, I was curious about
the same thing. This is a "double-quoteISH" context, but does that mean
that the implicit join is with $" or with ""?
I decided that it didn't matter at all. The tr/// may be longer, but
after compilation that ends up as a 256-character lookup table no matter
what the contents of the tr/// look like. Every one of the spaces (if
they are there, and I'm not sure how to find out whether they are or
not) ends up creating one entry in the table, namely that for " ". So
there is no effect on the execution time whatever.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 11 Jul 1999 02:34:38 GMT
From: tgy@chocobo.org (Neko)
Subject: Re: Changing case local-specifically
Message-Id: <7m8vru$9uk$0@216.39.141.200>
On 10 Jul 1999 20:46:55 -0400, Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
>
> >> my @left = map chr, ord('A') .. 0xFF;
> >> my @right = map {$_ ne uc $_ ? uc : lc} @left;
> >> eval "sub TR { \$_[0] =~ tr/@left/@right/ }";
>
>having finally looked at that trick closely i wonder if you are setting
>$" to '' before you build the TR? otherwise, you will get a space char
>interpolated between each char in @left and @right. it shouldn't affect
>the functionality but it does make for a longer tr/// and a slightly
>slower execution, i would imagine.
My original feeling was that the extra spaces would not be a terrible
penalty. I now wonder if I was being unnecessarily lazy.
--
Neko | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=
------------------------------
Date: 10 Jul 1999 22:54:07 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Changing case local-specifically
Message-Id: <slrn7og5a7.h7.abigail@alexandra.delanet.com>
Larry Rosler (lr@hpl.hp.com) wrote on MMCXL September MCMXCIII in
<URL:news:MPG.11f19e74e1b458c989c9b@nntp.hpl.hp.com>:
-- In article <x7r9mgovwg.fsf@home.sysarch.com> on 10 Jul 1999 20:46:55 -
-- 0400, Uri Guttman <uri@sysarch.com> says...
-- > >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
-- >
-- > >> my @left = map chr, ord('A') .. 0xFF;
-- > >> my @right = map {$_ ne uc $_ ? uc : lc} @left;
-- > >> eval "sub TR { \$_[0] =~ tr/@left/@right/ }";
-- >
-- > having finally looked at that trick closely i wonder if you are setting
-- > $" to '' before you build the TR? otherwise, you will get a space char
-- > interpolated between each char in @left and @right. it shouldn't affect
-- > the functionality but it does make for a longer tr/// and a slightly
-- > slower execution, i would imagine.
--
-- Never having interpolated an array in that context, I was curious about
-- the same thing. This is a "double-quoteISH" context, but does that mean
-- that the implicit join is with $" or with ""?
--
-- I decided that it didn't matter at all. The tr/// may be longer, but
-- after compilation that ends up as a 256-character lookup table no matter
-- what the contents of the tr/// look like. Every one of the spaces (if
-- they are there, and I'm not sure how to find out whether they are or
-- not) ends up creating one entry in the table, namely that for " ". So
-- there is no effect on the execution time whatever.
I'm not quite sure what you mean by "double-quoteISH". The behaviour of
interpolation inside "" is pretty clear. But it's easy to find out how
@right and @left are interpolated:
#!/opt/perl/bin/perl -w
my @right = @left = 'a' .. 'd';
eval "sub TR { print '@right\n'; \$_[0] =~ tr/@left/@right/}";
&TR ($");
__END__
a b c d
Looks to me the spaces get there.
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== 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: Sun, 11 Jul 1999 03:56:42 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Changing case local-specifically
Message-Id: <378815CF.31C99873@home.com>
Larry Rosler wrote:
>
> > >> eval "sub TR { \$_[0] =~ tr/@left/@right/ }";
>
> Never having interpolated an array in that context, I was curious about
> the same thing. This is a "double-quoteISH" context, but does that mean
^^^
huh?
> that the implicit join is with $" or with ""?
You've never interpolated an array inside double-quotes?
> I decided that it didn't matter at all. The tr/// may be longer, but
> after compilation that ends up as a 256-character lookup table no matter
> what the contents of the tr/// look like. Every one of the spaces (if
> they are there, and I'm not sure how to find out whether they are or
> not) [snip]
@list = 1 .. 3;
$" = ':';
$_ = "@list\n";
eval "tr/@list/a|b|c/;";
print;
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: 10 Jul 1999 22:56:22 -0500
From: Tye McQueen <tye@metronet.com>
Subject: Re: Global variables from a module
Message-Id: <7m94l6$e8q@fumnix.metronet.com>
[Follow-ups set since you should never post to a *.misc
group if you are also posting to a more specific group.]
Mike Machado <mike@innercite.com> writes:
) I set my $var = "something" in the module and put $var in the
) @EXPORT and the @EXPORT_OK but that did not work. In this example how
) could I get
) just '$var' avaiable in the user script easily.
Okay, I'm really getting sick of these questions with vague
descriptions and no real code, sample output, error messages,
etc.
If you code looks something like:
my $var= "something";
@EXPORT_OK= qw($var);
then the C<my> part is your problem. See a very recent thread on
this same problem for more information.
) I am trying to set a variable in my module and have it avaiable in the
) user script without having to go $Package::var
If you indeed did
my $var= "something";
then C<$Package::var> won't work either. Did you try it?
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: 11 Jul 1999 01:38:42 GMT
From: Tom Mornini <tmornini@netcom9.netcom.com>
Subject: Re: Help -- Weird Increments (MacPerl)
Message-Id: <7m8sj2$g2h@dfw-ixnews21.ix.netcom.com>
johnny99 <john@your.abc.net.au> wrote:
: Can someone
: instead tell me in a little more detail how to do the
: equivalent of this:
: data.txt consists of a number
: I get the number from data.txt
: I do stuff to it in Perl and get a new number
: I replace the entire contents of data.txt with the new
: number
open (IN,'file.txt') || die "Cannot open file for input";
$number=<>;
close IN;
$number=chomp($number)+1; # Add 1 to $number
open (OUT,'>file.txt') || die "Cannot open file for output";
print OUT $number;
close OUT;
: I'm a little bemused that this task is so hard -- that I
: have to do all this "rewind the file to the right place"
: stuff. As soon as I've read the file, it's history. I want
: to trash it and write a new one, or do the equivalent of a
: "save as". Was the writer of this script being extra careful
: for some reason to do with UNIX, or am I missing something
: obivous because it's late?
That's not so hard, is it?
The person who wrote the script either:
1) Had more requirements than you do
2) Did not have a clue
-- Tom Mornini
-- InfoMania
------------------------------
Date: Sat, 10 Jul 1999 03:03:54 +0200
From: Mattias <mattias.arvidsson@post.utfors.se>
To: Scientia <scientia@XXXtechnologist.com>
Subject: Re: Help: creating files through a CGI
Message-Id: <37869BFA.617F5A6@post.utfors.se>
Scientia wrote:
> Help: creating files through a CGI
>
> Hello
>
> Abstract: my CGI is supposed to create new files (not existing files)
> but I am not able to make it work!
>
> I mean this: imagine that someone visits my site
> and I want him to write some informations.
> For reasons that I can't explain here, I need that
> the CGI creates a file within my directory where such informations
> must be stored (the name of the files depends on the informations
> themselves).
> Of course, the visitor is not aware that the CGI is creating a file:
> he simply fills some fields in a form.
>
> My Perl program is not able to create such file on my web directory!
> However, I have Win95/DOS and ActivePerl and in this case the file is
> created with no problems.
> For example:
> open (outf,">created.txt");
> print outf "Hello\n";
> This works perfectly in ActivePerl with Win95/DOS.
>
> My provider is always busy and he never replies me,
> so I must solve this problem by myself (with your help :-).
> I can easily program in PERL (as I know also other languages).
> But unfortunately I do not know UNIX or LINUX
> and I do not even know what is running on my web server!
> I guess UNIX, as I can read this informations:
> SERVER_SOFTWARE = Apache/1.3.3 (Unix)
> I understand that in UNIX and LINUX a file must be created
> with the command "touch filename", so I tried to do that
> from my Perl program:
> system "touch created.txt";
> but nothing happens;
> I also chmod-ed it:
> system "chmod 777 created.txt"
> but nothing happens.
> My CGI runs with no errors, but the file is not created!
> Somewhere I read that I should make the entire directory
> readable/writable, but this is not a good idea.
>
> So, what can I do?
>
> Final question: commands like "chmod 777" are the same
> for UNIX and LINUX?!
>
> Thanks
> Fabrizio
>
> You can e-mail to:
> scientia@technologist.com
--------8<---------
On webhotels....
Almost always your cgi-scripts are banned from creating files ..by the
server-settings.
for some lame security reasons. You must upload empty files.
and...
Linux is a Unix(with correct case!) clone..
--
Br.
Dr. W.
------------------------------
Date: Sun, 11 Jul 1999 02:55:38 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How secure is my Perl code on the web?
Message-Id: <Pine.HPP.3.95a.990711024926.11135A-100000@hpplus03.cern.ch>
On Sat, 10 Jul 1999, Brian Wagener wrote:
> I understand what you mean, but in this case it everything to do with using
> a scripting language like Perl. So can you or not see the cgi code that is
> being used on the web.
Yes, no, maybe.
I know that mine is safe. That's why I set up a symlink, to let others
see it as text/plain.
[Tip: don't hang the entire previous posting on the end of your usenet
contributions. It makes you look like a devotee to some newly-arrived
anti-usenet software, that would wish to assimilate you. And the
entire Internet. But it shall not succeed.]
------------------------------
Date: Sun, 11 Jul 1999 02:04:50 GMT
From: Patrick Timmins <ptimmins@itd.sterling.com>
Subject: Re: How secure is my Perl code on the web?
Message-Id: <7m8u3u$it1$1@nnrp1.deja.com>
In article <7m8ort$ga7$1@news.fsu.edu>,
"Brian Wagener" <wagener@cs.fsu.edu:NOSPAM> wrote:
> I understand what you mean, but in this case it everything to do with
using
> a scripting language like Perl. So can you or not see the cgi code
that is
> being used on the web.
I don't think you understand what he means. If you tell your webserver
to display a cgi script instead of executing it, it probably will. In
this case, I think *you* are your own biggest security risk, because
*you* don't know what you're doing.
I feel sorry for Florida State U. (or whomever you work for).
Go back to Active Server Pages and IIS ... oops ... better not ...
that's scripting too ... you could screw that up as well.
Good luck!
$monger{Omaha}[0]
Patrick Timmins
ptimmins@itd.sterling.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sat, 10 Jul 1999 23:22:25 +0100
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: one-file Perl for Win32
Message-Id: <3787C7A0.AE1AE24D@patriot.net>
I can't get a clear picture of what it is that you want to do, but I think
that you can install ActiveState's ActivePerl on one machine and run
your remote commands against the other machines.
Could you email me and give me a better idea of what you are trying
to do?
Carv
Jeff Robertson wrote:
> I need to either build or find an installation of Perl for Windows NT and
> Windows 95 that consists of nothing but the interpreter, PERL.EXE. No .DLLs,
> no modules. The reason I want to do this is because I want to call Perl from
> batch files that are going to run on a lot of 95 and NT machines that have
> no Perl installed. I want the batch file to be able to call PERL.EXE from a
> network share, like this:
>
> \\MY_NT_SERVER\MY_SHARE\PERL.EXE -e "print qq(Hello world\n)"
>
> I have found that the normal Perl distributions for Win32 require certain
> .DLLs in order for the interpreter to work, and thus I have had to put the
> DLLs on the network and add the shared directory into the %PATH% variable.
> This is a problem under Win95 where the DOS prompt (and thus the batch file)
> has limited space for environment variables.
>
> So what I want is a PERL.EXE that will run all by itself, with no other
> files required. I assume that the best way to do this is to build it from
> the sources, but I have little experience compiling anything under NT or 95.
> Any advice or help would be appreciated, especially if someone has already
> done what I want to do.
------------------------------
Date: 10 Jul 1999 21:23:13 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: PERLFUNC: tr/// - transliterate a string
Message-Id: <x7oghkou7y.fsf@home.sysarch.com>
>>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:
>>>>> "David" == David Cassell <cassell@mail.cor.epa.gov> writes:
>>> DESCRIPTION
>>> The transliteration operator
David> , also known as the translation operator to those Perl
David> troublemakers who are just bucking Larry and Tom.
RLS> Although gnu-sed calls it transliterate... cf. "man sed" on this Linux
RLS> system:
RLS> y/source/dest/
RLS> Transliterate the characters in the pattern space
RLS> which appear in source to the corresponding charac-
RLS> ter in dest.
i tried to corner larry (wall) on this at yapc will little success. he
squirmed his way out and the mistaken transliterate is being kept in by
tom.
as i have noted before, solaris sed says y/// is transform. but the gnu
tr utility says translate (so gnu is inconsistant on this point). and
solaris's bsd sed calles it transform but refers to translation
tables. solaris tr refers to translations. solaris's bsd tr says
translate (so probably bsd flavors also say it). pl/i had this function
way back in the 1960's and it is called translate. up to a year or so
ago, perl called it translate.
so other than tom's personal taste and his convincing an indifferent
larry about it, it would still be translate. it should go back to
translate but since tom controls the docs, it will be almost impossible
to do other than to replace him with a clone.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Sun, 11 Jul 1999 01:04:52 GMT
From: fireball402@my-deja.com
Subject: Problem with sleeping script
Message-Id: <7m8qjg$hs4$1@nnrp1.deja.com>
Hi,
I have the following problem for a script I am executing via the web.
I need to let it sleep for 30 seconds or so, if I do this the browser
hangs during the time it sleeps, so I closed the STDOUT.
Now the script isn't doing anything anymore after the sleep command
while it does everything if i close the STDOUT and leave the sleep
command away.
I thought the apache server timed out and killed the process but that
isn't the case because I tried to let it sleep only a second what
didn't work either.
I don't need any output back to the browser of the part after the sleep
command, so I thought maybe open a child process would help, but the
browser is hanging and waiting for the child process to complete too if
i call it like this :
exec "perl OTHERSCRIPT";
If I close the STDOUT of the child process I have the same problem as
before , the process is terminated.
Does anyone have an idea how to make this work ?
Thanks in advance,
Chris.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sun, 11 Jul 1999 03:21:32 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Problem with sleeping script
Message-Id: <Pine.HPP.3.95a.990711031158.11135C-100000@hpplus03.cern.ch>
On Sun, 11 Jul 1999 fireball402@my-deja.com wrote:
> Hi,
Grunted...
> I have the following problem for a script I am executing via the web.
Perl is just a programming language. Wouldn't c.i.w.authoring.cgi be
more appropriate for your purpose?
> I need to let it sleep for 30 seconds or so,
Do you really? What was your reaction when you read the related item in
Nick Kew's CGI FAQ?
> Now the script isn't doing anything anymore after the sleep command
> while it does everything if i close the STDOUT and leave the sleep
> command away.
I suppose it's too much to ask you to reveal the problem that you're
trying to solve, rather than merely showing us the half-formed
non-solution that has been devised to some unstated problem?
> I thought the apache server timed out and killed the process but that
> isn't the case because I tried to let it sleep only a second what
> didn't work either.
uh-uh.
> command, so I thought maybe open a child process would help,
What was your reaction, then, to that part of the CGI FAQ?
> Does anyone have an idea how to make this work ?
Make _what_ work? You seem to have omitted to mention the important
part, i.e what you're trying to achieve, and have only listed all the
things that the FAQ already told you wouldn't work.
> Sent via Deja.com http://www.deja.com/
Oh, right.
> Share what you know. Learn what you don't.
Hmmm.
--
The British attitude is essentially that it is better to have
100% of nothing than 25% of something. - D.Hansen, uk.railway
------------------------------
Date: 10 Jul 1999 22:45:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Problem with sleeping script
Message-Id: <slrn7og4q0.h7.abigail@alexandra.delanet.com>
fireball402@my-deja.com (fireball402@my-deja.com) wrote on MMCXL
September MCMXCIII in <URL:news:7m8qjg$hs4$1@nnrp1.deja.com>:
{}
{} I have the following problem for a script I am executing via the web.
{}
{} [ bla bla bla bla ]
{}
{} Does anyone have an idea how to make this work ?
Call tech support of your servers vendor. Server - program interaction
is *NOT* a Perl issue.
Abigail
--
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))
-----------== 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: 11 Jul 1999 03:12:16 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Simulating CRON
Message-Id: <slrn7og2ns.j2.efflandt@efflandt.xnet.com>
On Sat, 10 Jul 1999 23:16:08 GMT, Jonathan Chum <jchum@jps.net> wrote:
>Is there a way so that I can run specific cgi programs without the use
>of CRON?
>Techdevelopers
>http://www.techdevelopers.com
>CGI, ASP, DHTML, FLASH, and more
If you run a program or script from cron, then it isn't really CGI since
it is not responding to a web browser. Running a background process would
be unreliable because if the server is restarted, your script is dead.
Whereas, cron will run it regardless of what happens in the meantime.
What is wrong with using cron anyway?
--
David Efflandt efflandt@xnet.com http://www.xnet.com/~efflandt/
http://www.de-srv.com/ http://cgi-help.virtualave.net/
------------------------------
Date: Sun, 11 Jul 1999 13:54:34 +1000
From: "Pen and Ron Savage" <rpsavage@ozemail.com.au>
Subject: Re: Simulating CRON
Message-Id: <gDUh3.1951$1u.19038@ozemail.com.au>
From my notes...
1
At http://maxx.mc.net/~jlh/nttools.htm you will find a set of tools
called AINTX. One of the tools in there is a REAL cron daemon that works
exactly as you would expect a real crond to work. It makes me happy, and
makes my life so much easier. And, it's free. There are also numerous
other tools included in there that make NT more usable (more like Unix).
See http://www.rcbowen.com/imho/NT/tools.html for other tools like it
that make life more bearable on NT.
2
I wrote one when I was looking for the same thing. I've made
it freely available.
Go to www.skwc.com/essent, and scroll til you see it.
(No, not me.)
3
cron.pl is an all-Perl solution that uses a Unix-like crontab file. You can
set it up to run as an NT Service and use it like a Unix cron. Works
nicely.
You can grab it at http://www.dnaco.net/~btb/perl/.
4
You'll find a Perl script that emulates the Unix cron utility at
http://www.megadodo.demon.co.uk/perl
It only schedules to the nearest minute, but it shouldn't be too hard to
adapt to something smaller
--
Cheers
ron@savage.net.au
pen@savage.net.au
http://savage.net.au/
Jonathan Chum wrote in message <3787d3fa.4099597@news.jps.net>...
>Is there a way so that I can run specific cgi programs without the use
>of CRON?
>Techdevelopers
>http://www.techdevelopers.com
>CGI, ASP, DHTML, FLASH, and more
------------------------------
Date: Sun, 11 Jul 1999 01:29:08 GMT
From: nkaiser@my-deja.com
Subject: Use a Perl Module w/o Installing It?
Message-Id: <7m8s0s$iaj$1@nnrp1.deja.com>
Hello -
I have a Perl program which will be installed on many Unix machines. It
uses the "Storable" Perl module. However, many of these machines will
not have this module installed...and I will not have root access. Is
it possible to somehow bundle this module and reference it that way?
Also, can the "Storable" module be used on a Windows machine?
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sat, 10 Jul 1999 17:45:06 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: variable "$foo" will not stay shared
Message-Id: <2te8m7.3p9.ln@magna.metronet.com>
random static (rand@localhost.localdomain) wrote:
: i'm getting warnings
: saying `Variable "$foo" will not stay shared at...' when calling a
: subroutines in a homebrew module at various places.
: what does this warning mean?
All of the messages that perl might issue are described in
perldiag.pod, so you just go look it up:
------------------------
=item Variable "%s" will not stay shared
(W) An inner (nested) I<named> subroutine is referencing a lexical
variable defined in an outer subroutine.
When the inner subroutine is called, it will probably see the value of
the outer subroutine's variable as it was before and during the
*first* call to the outer subroutine; in this case, after the first
call to the outer subroutine is complete, the inner and outer
subroutines will no longer share a common value for the variable. In
other words, the variable will no longer be shared.
Furthermore, if the outer subroutine is anonymous and references a
lexical variable outside itself, then the outer and inner subroutines
will I<never> share the given variable.
This problem can usually be solved by making the inner subroutine
anonymous, using the C<sub {}> syntax. When inner anonymous subs that
reference variables in outer subroutines are called or referenced,
they are automatically rebound to the current values of such
variables.
------------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
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 V9 Issue 106
*************************************