[18549] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 717 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 19 09:36:29 2001

Date: Thu, 19 Apr 2001 06:36:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <987687371-v10-i717@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 19 Apr 2001     Volume: 10 Number: 717

Today's topics:
    Re: returning tied scalar (Mark Jason Dominus)
    Re: returning tied scalar <rick.delaney@home.com>
    Re: returning tied scalar <gellyfish@gellyfish.com>
        Run script as a daemon ? (Gil G.)
    Re: Run script as a daemon ? <bcoon@sequenom.com>
    Re: Run script as a daemon ? (Gil G.)
    Re: Run script as a daemon ? <bcoon@sequenom.com>
    Re: Run script as a daemon ? (Gwyn Judd)
    Re: Run script as a daemon ? (Tad McClellan)
    Re: Sending data from CGI script to other application (Alan Barclay)
        Sending Requests from Client to Server using Sockets <Lyle_Goldman@ibi.com>
    Re: Sending Requests from Client to Server using Socket nobull@mail.com
    Re: Sending Requests from Client to Server using Socket <Lyle_Goldman@ibi.com>
        Setting download name of a file <tguirado@iterra-team.com>
    Re: Setting download name of a file nobull@mail.com
        Short Simple Cookie question <bcoon@sequenom.com>
    Re: Short Simple Cookie question <tlav1@mediaone.net>
        Slighty OT: Perl Books... <robbie@totaln.com>
    Re: Slighty OT: Perl Books... <yf32@cornell.edu>
    Re: Slighty OT: Perl Books... <robbie@totaln.com>
    Re: So what do YOU use Perl for? <danny@lennon.postino.com>
    Re: So what do YOU use Perl for? (Abigail)
        Starting a perlscript in another perlscript <simon@super-simon.com>
    Re: Starting a perlscript in another perlscript <tony_curtis32@yahoo.com>
    Re: Starting a perlscript in another perlscript <simon@super-simon.com>
    Re: Starting a perlscript in another perlscript <christoph@schaper-edv.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 15 Apr 2001 22:54:01 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: returning tied scalar
Message-Id: <3ada268a.1406$8@news.op.net>

In article <9bd66g$b8r$1@news.netmar.com>,  <miko@NO_SPAMidocs.com> wrote:
> my ($name, $email) = myfunction('miko');
> print $email;
>
>At the print command the STORE sub of the object $email is tied to is fired,
>does some groovy stuff, and returns whatever it returns.
>
>Is such a thing possible?

Sorry, it isn't.

One alternative is:

        my ($name, $email);
        myfunction(\$name, \$email, 'miko');
        print $email;           # calls (tied $email)->FETCH;


-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


------------------------------

Date: Mon, 16 Apr 2001 03:50:09 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: returning tied scalar
Message-Id: <3ADA6F2E.525DC562@home.com>

miko@NO_SPAMidocs.com wrote:
> 
> I'm writing a function where it would be really useful if the function could
> return a tied scalar.  I.e., the variable which is on the left side of the
> assignment essentially becomes the tied variable.  Something like this:
> 
>  my ($name, $email) = myfunction('miko');
>  print $email;

If you are willing to use package variables, you can return references
to the tied scalars and write

    local ($name, $email);
    (*name, *email) = myfunction('miko');

Then $name and $email would be aliases of the tied scalars created in
myfunction().

-- 
Rick Delaney
rick.delaney@home.com


------------------------------

Date: 16 Apr 2001 10:22:10 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: returning tied scalar
Message-Id: <9beh4i$s5p$5@plutonium.btinternet.com>

miko@no_spamidocs.com wrote:
> 
> At the print command the STORE sub of the object $email is tied to is fired,
> does some groovy stuff, and returns whatever it returns.
> 

I think you meant FETCH.

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


------------------------------

Date: Tue, 17 Apr 2001 21:53:38 GMT
From: gil@nospam-keskydee.com (Gil G.)
Subject: Run script as a daemon ?
Message-Id: <3adcbabc.350986@news-server>

Hello,

How do I make a script run in the background? 
(on Unix)

Thanks, sincerely,

Gil.
---------------
Need a Perl programmer?
http://keskydee.com/freelance.php


------------------------------

Date: Tue, 17 Apr 2001 15:03:00 -0700
From: Bryan Coon <bcoon@sequenom.com>
Subject: Re: Run script as a daemon ?
Message-Id: <3ADCBD94.F2B2781B@sequenom.com>

Do you mean as a unix command?  If so, 'program.pl &' will do it.  But
if you are looking for perl stuff (since you are posting to a perl group
I hope this is the case) you can use system(), exec(), or if you want to
get really fancy you can use some posix stuff to spin off a process that
will not cause your original thread to wait for completion:

sub forkJob {
  my $pid = fork;
  die "Can't fork: $!" unless defined $pid;
  if ($pid == 0) {
    if (POSIX::setsid == -1) {
      die "can't setsid: $!";
    }
    open STDOUT, ">/dev/null";
    open STDIN, ">/dev/null";
    exec "somereallycoolprogram.pl";
    die "Can't exec $!";
  }
}

Hope that helps ya out.
Bryan

"Gil G." wrote:

> Hello,
>
> How do I make a script run in the background?
> (on Unix)
>
> Thanks, sincerely,
>
> Gil.
> ---------------
> Need a Perl programmer?
> http://keskydee.com/freelance.php



------------------------------

Date: Tue, 17 Apr 2001 23:42:23 GMT
From: gil@nospam-keskydee.com (Gil G.)
Subject: Re: Run script as a daemon ?
Message-Id: <3adcd3a1.3167306@news-server>

Thanks, very interesting. The problem is that I have a perl script
with an infinite loop but I want the program to give me back the
shell...

I will certainly use your code, how would I incorporate it in the
program so that I have only "someprettycoolprogram.pl" starting it's
infinite loop (separate process) and get the prompt back?

Sincerely,

Gil.


On Tue, 17 Apr 2001 15:03:00 -0700, Bryan Coon <bcoon@sequenom.com>
wrote:

>Do you mean as a unix command?  If so, 'program.pl &' will do it.  But
>if you are looking for perl stuff (since you are posting to a perl group
>I hope this is the case) you can use system(), exec(), or if you want to
>get really fancy you can use some posix stuff to spin off a process that
>will not cause your original thread to wait for completion:
>
>sub forkJob {
>  my $pid = fork;
>  die "Can't fork: $!" unless defined $pid;
>  if ($pid == 0) {
>    if (POSIX::setsid == -1) {
>      die "can't setsid: $!";
>    }
>    open STDOUT, ">/dev/null";
>    open STDIN, ">/dev/null";
>    exec "somereallycoolprogram.pl";
>    die "Can't exec $!";
>  }
>}
>
>Hope that helps ya out.
>Bryan
>
>"Gil G." wrote:
>
>> Hello,
>>
>> How do I make a script run in the background?
>> (on Unix)
>>
>> Thanks, sincerely,
>>
>> Gil.
>> ---------------
>> Need a Perl programmer?
>> http://keskydee.com/freelance.php
>



------------------------------

Date: Tue, 17 Apr 2001 16:50:09 -0700
From: Bryan Coon <bcoon@sequenom.com>
Subject: Re: Run script as a daemon ?
Message-Id: <3ADCD6B1.9AE9F58F@sequenom.com>

"Gil G." wrote:

> Thanks, very interesting. The problem is that I have a perl script
> with an infinite loop but I want the program to give me back the
> shell...
>
> I will certainly use your code, how would I incorporate it in the
> program so that I have only "someprettycoolprogram.pl" starting it's
> infinite loop (separate process) and get the prompt back?
>
> Sincerely,
>
> Gil.
>

You can use it almost as is... but this particular example calls a separate
script.  In effect, you would place this code in a new file (forkJob.pl if
you like), and put your 'infiniteloop.pl' script in instead of
someprettycoolprogram.pl.  This will execute your infinite loop as a
background process and return the command prompt to you.



------------------------------

Date: Wed, 18 Apr 2001 04:35:37 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Run script as a daemon ?
Message-Id: <slrn9dq6cc.cm4.tjla@thislove.dyndns.org>

In article <3adcd3a1.3167306@news-server>,
Gil G. <gil@nospam-keskydee.com> wrote:
>Thanks, very interesting. The problem is that I have a perl script
>with an infinite loop but I want the program to give me back the
>shell...

If you put the line:

fork && exit;

at the top of your script it will then return you to the shell and run
in the background. This is not truly "daemonising" your script though.
The question is answered more fully in the faq:

perldoc -q 'daemon'

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
There's nothing like the face of a kid eating a Hershey bar.


------------------------------

Date: Tue, 17 Apr 2001 18:43:44 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Run script as a daemon ?
Message-Id: <slrn9dphp0.se.tadmc@tadmc26.august.net>

Gil G. <gil@nospam-keskydee.com> wrote:
> Subject: Run script as a daemon ?


Perl FAQ, part 8:

   "How do I fork a daemon process?"


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 15 Apr 2001 20:42:55 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: Sending data from CGI script to other application
Message-Id: <987367331.715009@elaine.furryape.com>

In article <3ACD20DC.98F6CFFC@qwest.net>,
A_Geekette  <moiraine{NOSPAM}@qwest.net> wrote:
>Part of the problem is forking.  Under -wT forking is bad.

Where did you get this idea? fork cannot generate any warnings, nor can
it utilize tainted data, so under -wT forking is prefectly acceptable.


------------------------------

Date: Mon, 16 Apr 2001 20:02:06 GMT
From: Lyle Goldman <Lyle_Goldman@ibi.com>
Subject: Sending Requests from Client to Server using Sockets
Message-Id: <2dIC6.7894$FY5.665055@www.newsranger.com>


Hello. I wrote a simple TCP client and server application. The server
is supposed to get a line of text from the client and send it back to the
client. Unfortunately, the server never seems to receive the line of text, so
all I get is deadlock. What am I doing wrong?

- Lyle Goldman

Here is the server code:
________________________________________________________________________________
#!/usr/local/bin/perl -w
use strict;

use Socket;

use vars qw($remote $port $iaddr $paddr $proto);

$remote = $ARGV[0] || 'localhost';
$port = 9000;
$iaddr = inet_aton($remote) or die "No host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');

while(print("Enter line to send.\n"), my $input = <STDIN>) {
socket SOCKET, PF_INET, SOCK_STREAM, $proto or die "socket: $!";
connect SOCKET, $paddr or die "connect: $!";

print SOCKET $input or die "print: $!";

while(my $line = <SOCKET>) {
print $line;
};

close SOCKET or die "close: $!";
};
________________________________________________________________________________

Here is the client code:
________________________________________________________________________________
#!/usr/local/bin/perl -w
use strict;

use Socket;

use vars qw($remote $port $iaddr $paddr $proto);

$remote = $ARGV[0] || 'localhost';
$port = 9000;
$iaddr = inet_aton($remote) or die "No host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');

while(print("Enter line to send.\n"), my $input = <STDIN>) {
socket SOCKET, PF_INET, SOCK_STREAM, $proto or die "socket: $!";
connect SOCKET, $paddr or die "connect: $!";

print SOCKET $input or die "print: $!";

while(my $line = <SOCKET>) {
print $line;
};

close SOCKET or die "close: $!";
};
________________________________________________________________________________




------------------------------

Date: 17 Apr 2001 08:22:29 +0100
From: nobull@mail.com
Subject: Re: Sending Requests from Client to Server using Sockets
Message-Id: <u9u23nkj5n.fsf@wcl-l.bham.ac.uk>

Lyle Goldman <Lyle_Goldman@ibi.com> writes:

> Hello. I wrote a simple TCP client and server application. The server
> is supposed to get a line of text from the client and send it back to the
> client. Unfortunately, the server never seems to receive the line of text, so
> all I get is deadlock. What am I doing wrong?

Posting the client code twice to the newsgroup rather than posting the
server code and the client code.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Tue, 17 Apr 2001 15:12:23 GMT
From: Lyle Goldman <Lyle_Goldman@ibi.com>
Subject: Re: Sending Requests from Client to Server using Sockets
Message-Id: <r3ZC6.368$D4.31132@www.newsranger.com>

On 17 Apr 2001 08:22:29 +0100, nobull@mail.com wrote:
>
> Lyle Goldman <Lyle_Goldman@ibi.com> writes:
>
> >	Hello. I wrote a simple TCP client and server application. The server
> > is supposed to get a line of text from the client and send it back to the
> > client. Unfortunately, the server never seems to receive the line of text,
> > So all I get is deadlock. What am I doing wrong?
>
> Posting the client code twice to the newsgroup rather than posting the
> server code and the client code.
>
>-- 

Sorry about that! Also, sorry if the indentation is bad. The news
service that I am using doesn't seem to like leading spaces.

- Lyle Goldman

Here is the server code:
________________________________________________________________________________
#!/usr/local/bin/perl -w
use strict;

use Socket;

use vars qw($port);

$| = 1;

$port = 9417;

socket SERVER, PF_INET, SOCK_STREAM, getprotobyname('tcp')
or die "socket: $!";
setsockopt SERVER, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)
or die "setsockopt: $!";
bind SERVER, sockaddr_in($port, INADDR_ANY)
or die "bind: $!";
listen SERVER, SOMAXCONN
or die "listen: $!";

print "Server started on port $port\n";

while(my $paddr = accept CLIENT, SERVER) {
my ($port, $iaddr) = sockaddr_in($paddr);
my $name = gethostbyaddr($iaddr, AF_INET);

print "connection from $name [", inet_ntoa($iaddr), "] at port $port\n";

my $line;
if($line = <CLIENT>) {
print "Received line: $line";
print CLIENT $line or die "print: $!";
};
close CLIENT or die "close client: $!";
};

close SERVER or die "close server: $!";
________________________________________________________________________________

Here is the client code.
________________________________________________________________________________
#!/usr/local/bin/perl -w
use strict;

use Socket;

use vars qw($remote $port $iaddr $paddr $proto);

$| = 1;

$remote = $ARGV[0] || 'localhost';
$port = 9417;
$iaddr = inet_aton($remote) or die "No host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');

while(print("Enter line to send.\n"), my $input = <STDIN>) {
socket SOCKET, PF_INET, SOCK_STREAM, $proto or die "socket: $!";
connect SOCKET, $paddr or die "connect: $!";

print SOCKET $input or die "print: $!";

while(my $line = <SOCKET>) {
print $line;
};

close SOCKET or die "close: $!";
};
________________________________________________________________________________




------------------------------

Date: Tue, 17 Apr 2001 10:26:09 +0200
From: "T. GUIRADO" <tguirado@iterra-team.com>
Subject: Setting download name of a file
Message-Id: <9bgv0h$2mm$1@s1.read.news.oleane.net>

Hi everybody,

I'm trying to use a CGI to download a file.
For security reasons, the link to download the file does not point on the
file but on a CGI script that reads the file and returns it to the browser.
But when the download window pops up, the download file name is the name of
the CGI and not the real name of the file. But it downloads the good file.
So I have the good file downladed but it is named as downloadFile.pl
How can I make the file keeping its name ?
I don't know if it is a Perl or HTML problem.

Thanks for any kind of help.

--
T. GUIRADO
ITERRA TEAM
Tel : 02 54 50 60 70
tguirado@iterra-team.com




------------------------------

Date: 17 Apr 2001 08:42:26 +0100
From: nobull@mail.com
Subject: Re: Setting download name of a file
Message-Id: <u9snj7kj2c.fsf@wcl-l.bham.ac.uk>

"T. GUIRADO" <tguirado@iterra-team.com> writes:

> I'm trying to use a CGI to download a file.
> For security reasons, the link to download the file does not point on the
> file but on a CGI script that reads the file and returns it to the browser.
> But when the download window pops up, the download file name is the name of
> the CGI and not the real name of the file. But it downloads the good file.
> So I have the good file downladed but it is named as downloadFile.pl
> How can I make the file keeping its name ?
> I don't know if it is a Perl or HTML problem.

No it isn't related to either. (It's HTTP).  However the fact that
it's not Perl related does not prevent it being frequetly asked and
answered here.  You should have used a Usenet search engine before you
posted.

Following the new convention for this newsgroup I'll post the answer
in comp.infosystems.www.authoring.cgi (eventually).

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Tue, 17 Apr 2001 14:46:56 -0700
From: Bryan Coon <bcoon@sequenom.com>
Subject: Short Simple Cookie question
Message-Id: <3ADCB9D0.BE974DEC@sequenom.com>

What is the best or most popular variant of Cookie to use with perl?
HTML::Cookie, CGI::Cookie, etc....?

I just need to use it for user/password verification storage after a
successful login, and it needs to be browser independent (or at least as
much as possible).

CGI::Cookie says it is for Netscape (HTTP/1.1), Im not sure if HTTP/1.1
is the same for IE or what.  If it is I think CGI::Cookie would be fine,
but can anyone give me the lowdown here?

Thanks,
Bryan

P.S.  I checked usenet, cpan, and perldoc



------------------------------

Date: Tue, 17 Apr 2001 22:13:48 GMT
From: ted <tlav1@mediaone.net>
Subject: Re: Short Simple Cookie question
Message-Id: <3ADCEB0D.A4C936DE@mediaone.net>

Did you check the cookie section of CGI.pm?  I think this will solve your
problem almost effortlessly.

Hope this helps,
ted



Bryan Coon wrote:

> What is the best or most popular variant of Cookie to use with perl?
> HTML::Cookie, CGI::Cookie, etc....?
>
> I just need to use it for user/password verification storage after a
> successful login, and it needs to be browser independent (or at least as
> much as possible).
>
> CGI::Cookie says it is for Netscape (HTTP/1.1), Im not sure if HTTP/1.1
> is the same for IE or what.  If it is I think CGI::Cookie would be fine,
> but can anyone give me the lowdown here?
>
> Thanks,
> Bryan
>
> P.S.  I checked usenet, cpan, and perldoc



------------------------------

Date: Wed, 18 Apr 2001 01:01:23 GMT
From: "RobbieB" <robbie@totaln.com>
Subject: Slighty OT: Perl Books...
Message-Id: <DH5D6.27020$PF4.45197@news.iol.ie>

Okay, i know there are numerous guides/faqs/tutorials/documents relating to
Perl on the web, I really need a good book...

What I need is a bokk about/that includes:

    Perl/CGI for the Web
    Beginner/Intermediate Level
    Decent amount of information relating to modules (not writing them,
although that would be nice, more info on using them)

I feel a book like that would get me set off down the road of perl, after
which I will buy an advanced book, after which I will learn from this here
newsgroup.

Here is my problem, I live in Ireland so, I will have to order from the web,
I have converted my budget to US Dollars, my Budget must cover shipping etc
etc (I will most likely buy from Amazon.com)


Budget: $120 (must incl. s/h)

Thanks for any and all help guys...

--RobbieB




------------------------------

Date: Tue, 17 Apr 2001 21:14:02 -0400
From: Young Chi-Yeung Fan <yf32@cornell.edu>
Subject: Re: Slighty OT: Perl Books...
Message-Id: <3ADCEA5A.AD2E09EA@cornell.edu>

RobbieB wrote:

> Okay, i know there are numerous guides/faqs/tutorials/documents relating to
> Perl on the web, I really need a good book...
>
> What I need is a bokk about/that includes:
>
>     Perl/CGI for the Web
>     Beginner/Intermediate Level
>     Decent amount of information relating to modules (not writing them,
> although that would be nice, more info on using them)
>
> I feel a book like that would get me set off down the road of perl, after
> which I will buy an advanced book, after which I will learn from this here
> newsgroup.
>
> Here is my problem, I live in Ireland so, I will have to order from the web,
> I have converted my budget to US Dollars, my Budget must cover shipping etc
> etc (I will most likely buy from Amazon.com)
>
> Budget: $120 (must incl. s/h)
>
> Thanks for any and all help guys...
>
> --RobbieB

I have the Perl CD Bookshelf (from O'Reilly), and like it. Well within your
budget, too. Since you're probably going to buy from Amazon.com, here are the
URL's for the current edition, and the one that will come out in May:

http://www.amazon.co.uk/exec/obidos/ASIN/1565924622/
http://www.amazon.co.uk/exec/obidos/ASIN/0596001649/



------------------------------

Date: Wed, 18 Apr 2001 01:23:11 GMT
From: "RobbieB" <robbie@totaln.com>
Subject: Re: Slighty OT: Perl Books...
Message-Id: <306D6.27021$PF4.45185@news.iol.ie>

Thanks for the quick reply man, I might look into that, and, with $50 or so
to spare, can anyone recommend a har copy book that would fulfil my needs as
posted in the first message of this thread?

--Robbie Burke




------------------------------

Date: Tue, 17 Apr 2001 05:30:01 GMT
From: Danny Aldham <danny@lennon.postino.com>
Subject: Re: So what do YOU use Perl for?
Message-Id: <9bgjk2$pdj$1@lennon.postino.com>


In article <3ACFB415.63D2CA91@gmu.edu> you wrote:
> One recurring theme in this newsgroup seems to be that Perl!=CGI and
> that while Perl is often used to write CGI scripts, it can also be used
> to do a lot of other things. I'd be curious to see what non-CGI stuff
> you do with Perl.

I came to perl after writing an industry certification that required
skill with sed and awk. I passed the test, but came out thinking there
had to be a better way. Much like I came out of high school science using
algebra to figure out acceleration and time to impact. In both cases there
was a better way, perl and calculus respespectively.
(But I have trouble putting Newton, Liebniez and Larry Wall in the same 
status. Maybe if we give Larry a couple of hundred years)
 
-- 
Danny Aldham     Providing Certified Internetworking Solutions to Business
www.postino.com  E-Mail, Web Servers, Web Databases, SQL PHP & Perl


------------------------------

Date: Thu, 19 Apr 2001 10:35:11 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: So what do YOU use Perl for?
Message-Id: <slrn9dtfqv.5l9.abigail@tsathoggua.rlyeh.net>

Chris Stith (mischief@velma.motion.net) wrote on MMDCCLXXXVII September
MCMXCIII in <URL:news:tds7ccn0vdtoa6@corp.supernews.com>:
'' 
'' I haven't reinvented the newsreader yet, but i have a Perl script
'' that configures and launches my newsreader for me. 


My newsreader calls a Perl program when I want to post something.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s};;;
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};                # Perl 5.6.0 broke this...
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


------------------------------

Date: Sun, 15 Apr 2001 22:47:50 +0200
From: "Super-Simon" <simon@super-simon.com>
Subject: Starting a perlscript in another perlscript
Message-Id: <9bflij$aet$1@news1.xs4all.nl>

Hi all,

Is it possible to let a Perl-CGI script start another Perl-CGI script? If
it's possible: how????

Please help me,

Simon




------------------------------

Date: 16 Apr 2001 15:53:38 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Starting a perlscript in another perlscript
Message-Id: <874rvo4ld9.fsf@limey.hpcc.uh.edu>

>> On Sun, 15 Apr 2001 22:47:50 +0200,
>> "Super-Simon" <simon@super-simon.com> said:

> Hi all, Is it possible to let a Perl-CGI script start
> another Perl-CGI script? If it's possible: how????

The answer depends on what you mean exactly.  On balance I
think you mean:

    how can a perl program running in a CGI environment
    cause another CGI perl program somewhere else to be
    executed (possibly passing parameters to it)?

If so, take a look at "perldoc lwpcook" for how to
construct and send an HTTP request.  "perldoc CGI" for how
to redirect() to another URL, if your intention is to let
another URL be the generator of your HTTP reply.


hth
t
-- 
Just reach into these holes.  I use a carrot.


------------------------------

Date: Sun, 15 Apr 2001 23:45:48 +0200
From: "Super-Simon" <simon@super-simon.com>
Subject: Re: Starting a perlscript in another perlscript
Message-Id: <9bfov9$192$1@news1.xs4all.nl>

Thanks for passing the right documents! Perldoc lwpcook is just what I
needed!
THANKS!

"Tony Curtis" <tony_curtis32@yahoo.com> wrote in message
news:874rvo4ld9.fsf@limey.hpcc.uh.edu...
> >> On Sun, 15 Apr 2001 22:47:50 +0200,
> >> "Super-Simon" <simon@super-simon.com> said:
>
> > Hi all, Is it possible to let a Perl-CGI script start
> > another Perl-CGI script? If it's possible: how????
>
> The answer depends on what you mean exactly.  On balance I
> think you mean:
>
>     how can a perl program running in a CGI environment
>     cause another CGI perl program somewhere else to be
>     executed (possibly passing parameters to it)?
>
> If so, take a look at "perldoc lwpcook" for how to
> construct and send an HTTP request.  "perldoc CGI" for how
> to redirect() to another URL, if your intention is to let
> another URL be the generator of your HTTP reply.
>
>
> hth
> t
> --
> Just reach into these holes.  I use a carrot.




------------------------------

Date: Tue, 17 Apr 2001 01:36:55 +0200
From: Christoph Schaper <christoph@schaper-edv.de>
Subject: Re: Starting a perlscript in another perlscript
Message-Id: <3ADB8217.FEA25ABF@schaper-edv.de>

Super-Simon wrote:
> 
> Hi all,
> 
> Is it possible to let a Perl-CGI script start another Perl-CGI script? If
> it's possible: how????
> 
> Please help me,
> 
> Simon

if you really mean CGI then the answer is
to redirect the request to another url which contains
another CGI.
simply 
 print "Location: othercgi.cgi\n\n";

but remember
http is a stateless connection.
you get a query and you answer it.
you cannot "change replicators" inbetween.



-- 
Christoph Schaper  Dienstleistungen EDV
email     christoph@schaper-edv.de
homepage  http://www.schaper-edv.de
privat    http://schaper.org/christoph


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.

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 V10 Issue 717
**************************************


home help back first fref pref prev next nref lref last post