[25994] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8213 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 29 11:05:21 2005

Date: Wed, 29 Jun 2005 08:05:07 -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           Wed, 29 Jun 2005     Volume: 10 Number: 8213

Today's topics:
        CGI output to null? <thom@softhome.net>
    Re: CGI output to null? <tintin@invalid.invalid>
    Re: CGI output to null? <thom@softhome.net>
    Re: CGI output to null? <noreply@gunnar.cc>
    Re: CGI output to null? <thom@softhome.net>
        problem in passing parameters in function defined in pe <vikrantREMOVE@DELETEsaysnetsoftDDDD.com>
    Re: problem in passing parameters in function defined i <jurgenex@hotmail.com>
    Re: problem in passing parameters in function defined i <noreply@gunnar.cc>
    Re: problem in passing parameters in function defined i <vikrantREMOVE@DELETEsaysnetsoftDDDD.com>
    Re: problem in passing parameters in function defined i <sherm@dot-app.org>
        SOAP::Lite proxied <scobloke2@infotop.co.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 29 Jun 2005 10:09:30 +0000 (UTC)
From: Thom White <thom@softhome.net>
Subject: CGI output to null?
Message-Id: <d9ts0q$mq3$2@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com>

Hi, I hope someone can help with this - I'm rubbish at programming, and 
I'm stuck......

I use a (perl) CGI script to collect form data on our website, and email 
it to me. When it collects the data, it shows a thankyou.html page to 
the visitor. No problem.

Now, I want to alter this script so that it doesn't send anything back 
(it will be accessed from an HTML email), but if I strip out the:

print "Location: /thanks.html", "\n\n";

 ..line, I get an Internal Server Error.

Is there a way I can satisfy the script's need to reply, but send the 
information to Null, or whatever? Help?

Thom


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

Date: Wed, 29 Jun 2005 22:23:12 +1200
From: "Tintin" <tintin@invalid.invalid>
Subject: Re: CGI output to null?
Message-Id: <mEuwe.11247$U4.1434158@news.xtra.co.nz>


"Thom White" <thom@softhome.net> wrote in message 
news:d9ts0q$mq3$2@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
> Hi, I hope someone can help with this - I'm rubbish at programming, and 
> I'm stuck......
>
> I use a (perl) CGI script to collect form data on our website, and email 
> it to me. When it collects the data, it shows a thankyou.html page to the 
> visitor. No problem.
>
> Now, I want to alter this script so that it doesn't send anything back (it 
> will be accessed from an HTML email), but if I strip out the:
>
> print "Location: /thanks.html", "\n\n";
>
> ..line, I get an Internal Server Error.
>
> Is there a way I can satisfy the script's need to reply, but send the 
> information to Null, or whatever? Help?

Not a Perl question (apart from the use of 'print', which I'm sure you can 
handle).

print "Content-Type: text/plain\n\n";




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

Date: Wed, 29 Jun 2005 10:44:12 +0000 (UTC)
From: Thom White <thom@softhome.net>
Subject: Re: CGI output to null?
Message-Id: <d9tu1s$63c$2@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com>

Tintin wrote:

>>Is there a way I can satisfy the script's need to reply, but send the 
>>information to Null, or whatever? Help?

> Not a Perl question (apart from the use of 'print', which I'm sure you can 
> handle).
> 
> print "Content-Type: text/plain\n\n";

Thanks - I'll give it a go.

Thom



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

Date: Wed, 29 Jun 2005 14:26:58 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: CGI output to null?
Message-Id: <3ificmFl7ro7U1@individual.net>

Tintin wrote:
> "Thom White" wrote:
>> I use a (perl) CGI script to collect form data on our website, and email 
>> it to me. When it collects the data, it shows a thankyou.html page to the 
>> visitor. No problem.
>>
>> Now, I want to alter this script so that it doesn't send anything back (it 
>> will be accessed from an HTML email), but if I strip out the:
>>
>> print "Location: /thanks.html", "\n\n";
>>
>> ..line, I get an Internal Server Error.
>>
>> Is there a way I can satisfy the script's need to reply, but send the 
>> information to Null, or whatever? Help?
> 
> Not a Perl question (apart from the use of 'print', which I'm sure you can 
> handle).
> 
> print "Content-Type: text/plain\n\n";

That results in blank page, doesn't it?

I think it's this the OP is after:

     print "Status: 204 No Content\n\n";

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Wed, 29 Jun 2005 13:25:57 +0000 (UTC)
From: Thom White <thom@softhome.net>
Subject: Re: CGI output to null?
Message-Id: <d9u7h5$c6f$1@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com>

Gunnar Hjalmarsson wrote:

>>> Is there a way I can satisfy the script's need to reply, but send the 
>>> information to Null, or whatever? Help?

>> Not a Perl question (apart from the use of 'print', which I'm sure you 
>> can handle).
>>
>> print "Content-Type: text/plain\n\n";
> 
> 
> That results in blank page, doesn't it?
> 
> I think it's this the OP is after:
> 
>     print "Status: 204 No Content\n\n";

This also results in a blank page.

Meh, I've stopped fighting it - I've gone back to letting the form 
return an HTML response.

Thanks though.

Thom


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

Date: Wed, 29 Jun 2005 19:28:50 +0530
From: Vikrant <vikrantREMOVE@DELETEsaysnetsoftDDDD.com>
Subject: problem in passing parameters in function defined in perl module
Message-Id: <d9u9h7$8eb$1@domitilla.aioe.org>

hi
i have problem is passing variable of a sample.pl file  as a parameters 
to a function defined in sample1.pm.

for example

sample.pl
*******************************************
#!usr/bin/perl
use sample1;
$dd=100;
sample1->Configure($dd);
*******************************************

and sample1.pm
*****************************************
#!usr/bin/perl
	package sample1;
	use Exporter;
	our @ISA=qw(Exporter);
	our @EXPORT=qw(Configure($ddd));

sub Configure($ddd)
{
	print"$ddd";
}	
****************************************
Both are in same directory but running sample.pl does not give any output.

regards


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

Date: Wed, 29 Jun 2005 14:15:58 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: problem in passing parameters in function defined in perl module
Message-Id: <y2ywe.8158$rE6.2946@trnddc06>

Vikrant wrote:
> i have problem is passing variable of a sample.pl file  as a
> parameters to a function defined in sample1.pm.
>
> for example
[...]
> package sample1;

If you had used warnings and strictures then perl would have told you what 
is wrong.

[...]
> sub Configure($ddd)

No idea what this is supposed to do but most likely it doesn't do what you 
think it is doing.
In Perl function arguments can be accessed in @_, not in named variable like 
that. Too much Pascal/Modula programming recently?

> {
> print"$ddd";

print $_[1];
Oh, and also a useless use of quote.
> }

jue 




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

Date: Wed, 29 Jun 2005 16:32:15 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: problem in passing parameters in function defined in perl module
Message-Id: <3ifpnjFkpm0rU1@individual.net>

Vikrant wrote:
> i have problem is passing variable of a sample.pl file  as a parameters 
> to a function defined in sample1.pm.
> 
> for example
> 
> sample.pl
> *******************************************
> #!usr/bin/perl
> use sample1;
> $dd=100;
> sample1->Configure($dd);

You mean

     Configure($dd);

don't you?

> and sample1.pm
> *****************************************
> #!usr/bin/perl
>     package sample1;
>     use Exporter;
>     our @ISA=qw(Exporter);
>     our @EXPORT=qw(Configure($ddd));

How does that $ddd variable come in? If you want to export the 
'Configure' symbol, just say:

     our @EXPORT=qw(Configure);

> sub Configure($ddd)
> {
>     print"$ddd";
> }

Sorry, but I don't understand how you are thinking now. In my world, the 
sub should look something like:

     sub Configure { print shift, "\n" }

HTH

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Wed, 29 Jun 2005 20:02:39 +0530
From: Vikrant <vikrantREMOVE@DELETEsaysnetsoftDDDD.com>
Subject: Re: problem in passing parameters in function defined in perl module
Message-Id: <d9ubhd$afo$1@domitilla.aioe.org>

Thanks for the info . i have just started off with the perl.

vikrant


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

Date: Wed, 29 Jun 2005 09:22:07 -0400
From: Sherm Pendley <sherm@dot-app.org>
Subject: Re: problem in passing parameters in function defined in perl module
Message-Id: <87mzp9s3gg.fsf@dot-app.org>

Vikrant <vikrantREMOVE@DELETEsaysnetsoftDDDD.com> writes:

> sub Configure($ddd)
> {
> 	print"$ddd";
> }

$ddd is not doing what you think it's doing. Subroutine prototypes in Perl
are used very rarely, and even then only declare types, not names. Arguments
are always passed in @_.

With that in mind:

# Unrelated parts of sample1.pm omitted...

our @EXPORT=qw(Configure);

sub Configure {
    my $ddd = shift;
    print $ddd;
}

Have a look at:
    perldoc perlsub
    perldoc -q always

sherm--

-- 
Due to the amount of unreadable gibberish being posted from Google Groups,
I seldom read messages posted from there.

Cocoa/Perl: http://camelbones.sf.net       Hire Me: http://www.dot-app.org


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

Date: Wed, 29 Jun 2005 09:37:03 +0000 (UTC)
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: SOAP::Lite proxied
Message-Id: <d9tq3u$k3n$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com>

I have a SOAP client using SOAP::Lite whose only access to a SOAP 
service is through an HTTP Proxy.

On one Unix system the client will use the proxy if the environment 
variable HTTP_proxy is set. It will authenticate to the proxy if the 
environment variables HTTP_proxy_use and HTTP_proxy_pass are set.

On another Unix system, setting the environment variables seems to have 
no effect.  Same operating system, same versions of Perl (5.8.0) and 
SOAP::Lite ($Id 1.47 in Lite.pm).

I'm using +trace but can't see why the environment variables are not 
used. Any ideas?


With LWP::UserAgent, you can also do things like
   $ua->proxy('http'=>'http://proxy.server:8080');
   $request->proxy_authorization_basic('fred', 'secret');
Is there any way to do something equivalent using SOAP::Lite?


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 8213
***************************************


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