[16572] in Perl-Users-Digest
Perl-Users Digest, Issue: 3984 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 11 09:15:39 2000
Date: Fri, 11 Aug 2000 06:15:29 -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: <965999729-v9-i3984@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 11 Aug 2000 Volume: 9 Number: 3984
Today's topics:
Perl/CGI suitable for this? <smcintyre@xrce.SPAM.xerox.com>
Re: Perl/CGI suitable for this? <elephant@squirrelgroup.com>
Re: Perl/CGI suitable for this? <stumo@bigfoot.com>
Re: Perl/CGI suitable for this? nobull@mail.com
Pipe on WinNT <pgunreben@lucent.com>
Re: Pipe on WinNT <christopher_j@uswest.net>
Re: Pipe on WinNT <pgunreben@lucent.com>
Re: Problem installing Regexp.pm (Martien Verbruggen)
Problem redirecting error messages to a file : v5.6.0 <maheshasolkar@engineer.com>
Re: problems with ^= nobull@mail.com
Re: problems with ^= (Anno Siegel)
Re: Problems with adding 1 (Tim Hammerquist)
Re: Problems with adding 1 <elephant@squirrelgroup.com>
Re: Problems with adding 1 (Randal L. Schwartz)
Re: Problems with adding 1 <elephant@squirrelgroup.com>
Re: Putting data into a form. (David Efflandt)
Re: Putting data into a form. <tfm@sei.cmu.edu>
Re: reg expressions - protect html <nickco3@yahoo.co.uk>
s/// and symbolic references <daniel@blackomega.com>
Re: script for getting modem to make internet connectio <gellyfish@gellyfish.com>
Re: Sendmail delivery failures <gellyfish@gellyfish.com>
Sharing a cookie between two domains..? (Mat)
Re: Sharing a cookie between two domains..? <elephant@squirrelgroup.com>
Re: undef multiple variables (Anno Siegel)
Re: undef multiple variables nobull@mail.com
Re: Uploading Images <stumo@bigfoot.com>
Were are all the executibles? john_s_brown@my-deja.com
Re: Were are all the executibles? (Andreas Kahari)
Re: Were are all the executibles? <tripix@metaverse.fsnet.co.uk>
Re: what does foreach (0...10) do ??? <gellyfish@gellyfish.com>
Re: What is "pack()" used for? (Anno Siegel)
Re: What is "pack()" used for? nobull@mail.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 11 Aug 2000 09:39:23 +0100
From: "Dr Stuart McIntyre" <smcintyre@xrce.SPAM.xerox.com>
Subject: Perl/CGI suitable for this?
Message-Id: <965983164.10198.0.nnrp-12.d4f05889@news.demon.co.uk>
Could Perl do this for me:
On client machine, a Java applet connects to a remote server via SSL.
On the remote machine, a CGI script recieves a url from the Java applet
(via the SSL connection), retrives the relevant page (in clear), and
returns
it (again, via SSL).
?
I know Java so I can write the client side, but I don't know anything about
Perl.
I don't know Perl so I don't know whether it would take me a decent
book and five minutes to write the Perl (I supect the code would be shorter
than this message!), or will I be forced to spend five years in a Perl
Monastery studying the arcane arts...
Stuart
------------------------------
Date: Fri, 11 Aug 2000 10:09:58 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Perl/CGI suitable for this?
Message-Id: <MPG.13fe6e5b416dcb029896a1@localhost>
Dr Stuart McIntyre wrote ..
>Could Perl do this for me:
>
> On client machine, a Java applet connects to a remote server via SSL.
>
> On the remote machine, a CGI script recieves a url from the Java applet
> (via the SSL connection), retrives the relevant page (in clear), and
>returns
> it (again, via SSL).
correct me if I'm wrong .. but the Java part of things is essentially
irrelevant to this Perl question .. because you're essentially asking
"
can a Perl program be called via an SSL encrypted HTTP request over CGI
and retrieve a text file from the local filesystem and return the
contents of that text file back to the client over the SSL encrypted
HTTP socket
"
to which the answer is yes .. this is trivial
if any part of that is incorrect - specifically the "from the local
filesystem" then Perl can almost certainly still do it but how much work
is involved depends on what exactly you're doing
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Fri, 11 Aug 2000 11:08:13 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Re: Perl/CGI suitable for this?
Message-Id: <8n0jjd$na4$1@supernews.com>
Dr Stuart McIntyre <smcintyre@xrce.SPAM.xerox.com> wrote in message
news:965983164.10198.0.nnrp-12.d4f05889@news.demon.co.uk...
> Could Perl do this for me:
>
> On client machine, a Java applet connects to a remote server via SSL.
>
> On the remote machine, a CGI script recieves a url from the Java applet
> (via the SSL connection), retrives the relevant page (in clear), and
> returns
> it (again, via SSL).
>
Yes, there shouldn't be any major problem there - I'd imagine you'd be able
to find a module that did 99% of what you want - however, it's unlikely
you'd find one specifically mentioned in a book, you'd probably just have to
read the book to get a general idea and the module documentation to find a
specific one. www.cpan.org will have the module if there is one. You could
use the CGI module to get the url from the Java applet, that's a standard
module that comes with most perl distributions, but you might have to find
and install yourself the one for getting the web page given the URL.
> ?
>
> I know Java so I can write the client side, but I don't know anything
about
> Perl.
>
> I don't know Perl so I don't know whether it would take me a decent
> book and five minutes to write the Perl (I supect the code would be
shorter
> than this message!), or will I be forced to spend five years in a Perl
> Monastery studying the arcane arts...
I picked up Perl pretty quickly from a background in Java - it's probably
easier to go that way round, as perl is far more forgiving than Java is, and
the looping constructs etc. are very similar. The one thing that you would
probably have no background on is regular expressions - I'm not sure whether
they'd be relevant in this case, probably not unless you want to use them to
check the url that the script has been sent is valid.
Stuart
------------------------------
Date: 11 Aug 2000 12:53:46 +0100
From: nobull@mail.com
Subject: Re: Perl/CGI suitable for this?
Message-Id: <u9wvhoui7p.fsf@wcl-l.bham.ac.uk>
"Dr Stuart McIntyre" <smcintyre@xrce.SPAM.xerox.com> writes:
> Could Perl do this for me:
>
> On client machine, a Java applet connects to a remote server via SSL.
>
> On the remote machine, a CGI script recieves a url from the Java applet
> (via the SSL connection), retrives the relevant page (in clear), and
> returns
> it (again, via SSL).
Yes, sure you sould write a Perl script to do this but why not just
use HTTPS?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 11 Aug 2000 13:34:15 +0200
From: Peter Gunreben <pgunreben@lucent.com>
Subject: Pipe on WinNT
Message-Id: <3993E4B7.F5738FC6@lucent.com>
Hi,
I'm currently trying to port some perl scripts to
WinNT (ActivePerl5.09). The mechanism to catch a
pipe worked well under UNIX, but it seems that
it doesn't work under WinNT. Does anyone know how
to overcome this issue.
Example:
open(UP,"update.pl |") || die "Can't spawn update";
while($i = <UP>) {
print "Got $i\n";
}
close(UP);
Behavior:
The second script "update.pl" is executed just normal
and runs without any problems. The above script waits
until the "update.pl" exits but it doesn't receive any
input from <UP>.
Can anyone help
------------------------------
Date: Fri, 11 Aug 2000 04:49:21 -0700
From: "Christopher M. Jones" <christopher_j@uswest.net>
Subject: Re: Pipe on WinNT
Message-Id: <%KRk5.19$WW5.35608@news.uswest.net>
My first instinct would be to say install Linux.
;)
------------------------------
Date: Fri, 11 Aug 2000 14:13:37 +0200
From: Peter Gunreben <pgunreben@lucent.com>
Subject: Re: Pipe on WinNT
Message-Id: <3993EDF1.AE06AF1C@lucent.com>
Good comment :-|
I like Linux but in this case I have no choice.
Is there any other way to start a 2nd script
and to bind it's output to a filehandle such that
I can use the select procedure?
What is really important is that the 1st script must
not stop while the 2nd script is running. The output
of the 2nd script shall be read by the 1st script at
the latest when the 2nd exits.
Any Idea?
"Christopher M. Jones" wrote:
>
> My first instinct would be to say install Linux.
>
> ;)
------------------------------
Date: 11 Aug 2000 12:30:26 GMT
From: mgjv@martien.heliotrope.home (Martien Verbruggen)
Subject: Re: Problem installing Regexp.pm
Message-Id: <slrn8p7sfu.ee0.mgjv@martien.heliotrope.home>
On 10 Aug 2000 16:18:56 -0000,
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> <jknight_30@my-deja.com> wrote in comp.lang.perl.misc:
>
> >After running Makefile.PL and make I get the following error:
>
[snip]
>
> You will have to persuade the make process to add -DPERL_POLLUTE to
> the cc flags. I seem to remember that ./Makefile.PL -POLLUTE does
> that.
perl Makefile.PL POLLUTE=1
# perldoc ExtUtils::MakeMaker
Martien
--
Martien Verbruggen |
Interactive Media Division | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd. | password?
NSW, Australia |
------------------------------
Date: 11 Aug 2000 12:52:24 GMT
From: "Mahesh Asolkar" <maheshasolkar@engineer.com>
Subject: Problem redirecting error messages to a file : v5.6.0
Message-Id: <8n0su8$8mo$1@news.netmar.com>
Hi,
I have a couple of small perl scripts which involve redirecting error messages
to a file...
One is exec.pl ...
#!/usr/local/bin/perl -w
my $CmdStr1 = "my.pl > lst1";
my $CmdStr2 = "my.pl >& lst2";
system ("$CmdStr1");
system ("$CmdStr2");
.. and other my.pl ...
#!/usr/local/bin/perl -w
print "An STDOUT String1\n";
print STDERR "An STDERR String2\n";
print "An STDOUT String3\n";
print STDERR "An STDERR String4\n";
Upon executing exec.pl, these are the responses that I get on two
versions of perl (on two different OSs).
On perl version 5.005_03 built for i386-linux, (Exactly the way I want)
An STDERR String2
An STDERR String4
(Lst1 has only the STDOUT messages & Lst2 has both STDERR & STDOUT
messages)
And on perl v5.6.0 built for 9000/777-hpux, (Error. Functionality, not
as desired)
An STDERR String2
An STDERR String4
sh: lst2: Generated or received a file descriptor number that is not valid.
(Lst1 has only the STDOUT messages. Script exits before generating Lst2
due to an error)
------------------------------------------------------------------------
I think the problem lies in the '&' in $CmdStr2. If that is removed,
all's well - except the functionality - because I want all the STDERR
& STDOUT messages to go into the lst files. Is there any way I can get
response on v5.6.0 similar to the 5.005_03?
I have an idea that perl 5.6.0 treats file descriptors differently as
compared to its predecessors - as real variables. But I am not sure if
this problem is related to that fact.
- Mahesh
----- Posted via NewsOne.Net: Free Usenet News via the Web -----
----- http://newsone.net/ -- Discussions on every subject. -----
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
------------------------------
Date: 11 Aug 2000 12:44:52 +0100
From: nobull@mail.com
Subject: Re: problems with ^=
Message-Id: <u93dkcvx6z.fsf@wcl-l.bham.ac.uk>
toddbe@my-deja.com writes:
> I'm running this bit of code on an HPUX 10.20 system
Probably on a 64-bit platform
> and a linux system and get very different resaults.
Probably on a 32-bit platform.
> $h0 += 9804392444;
> $h1 += 15433492645;
>
> $h1 ^= $h0; #$h1 goes to 0 on linux
Bitwise operators force floating point numbers into integers.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 11 Aug 2000 12:12:50 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: problems with ^=
Message-Id: <8n0qk2$8gs$1@lublin.zrz.tu-berlin.de>
<nobull@mail.com> wrote in comp.lang.perl.misc:
>toddbe@my-deja.com writes:
>
>> I'm running this bit of code on an HPUX 10.20 system
>
>Probably on a 64-bit platform
>
>> and a linux system and get very different resaults.
>
>Probably on a 32-bit platform.
>
>> $h0 += 9804392444;
>> $h1 += 15433492645;
>>
>> $h1 ^= $h0; #$h1 goes to 0 on linux
>
>Bitwise operators force floating point numbers into integers.
Yes, but I have often wondered[1] what this means in a case like 1E123,
that is, a float that represents an integer number too big for the
native integer format.
Anno
[1] Well, obviously I haven't wondered often enough to go and check.
------------------------------
Date: Fri, 11 Aug 2000 07:39:37 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Problems with adding 1
Message-Id: <slrn8p7c15.2sk.tim@degree.ath.cx>
Bart Lateur <bart.lateur@skynet.be> wrote:
> thirdgc@my-deja.com wrote:
> >I am trying to open a file and raise the number by one, but instead of
> >raising it one, it changes the number to one.
>
> Ah, an access counter. Here a simple one:
>
> open FILE, ">>counter.file";
> print FILE, "*";
>
> Every time, one character is added to the file. You can count visitors
> by taking the length ofthe file. Hey, how many visitors were you
> expecting anyway? ;-)
Nice simple solution, but doesn't it get a bit unwieldy when hits get
into the thousands? If not just inefficient? With not too many more
lines of code, here's a much more robust example:
: open HITS, "+< $hitfile" or die "Can't open $hitfile: $!\n";
: chomp($hits = <HITS> || 0);
: seek HITS, 0, 0;
: print HITS ++$hits, "\n";
: close HITS or die "Can't close $hitfile: $!\n";
and $hits contains the hit count.
TMTOWTDI =)
--
-Tim Hammerquist <timmy@cpan.org>
I don't want to belong to any club
that would have me as a member.
-- Groucho Marx
------------------------------
Date: Fri, 11 Aug 2000 07:55:12 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Problems with adding 1
Message-Id: <MPG.13fe4ec5f6f8f2d9896a0@localhost>
Tim Hammerquist wrote ..
>Bart Lateur <bart.lateur@skynet.be> wrote:
>> thirdgc@my-deja.com wrote:
>> >I am trying to open a file and raise the number by one, but instead of
>> >raising it one, it changes the number to one.
>>
>> Ah, an access counter. Here a simple one:
>>
>> open FILE, ">>counter.file";
>> print FILE, "*";
>>
>> Every time, one character is added to the file. You can count visitors
>> by taking the length ofthe file. Hey, how many visitors were you
>> expecting anyway? ;-)
>
>Nice simple solution, but doesn't it get a bit unwieldy when hits get
>into the thousands? If not just inefficient? With not too many more
>lines of code, here's a much more robust example:
>
>: open HITS, "+< $hitfile" or die "Can't open $hitfile: $!\n";
>: chomp($hits = <HITS> || 0);
>: seek HITS, 0, 0;
>: print HITS ++$hits, "\n";
>: close HITS or die "Can't close $hitfile: $!\n";
>
>and $hits contains the hit count.
>
>TMTOWTDI =)
you're not showing any locking of that file .. which is kind of
important with this sort of thing
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 11 Aug 2000 04:28:56 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Problems with adding 1
Message-Id: <m1bsz0dojr.fsf@halfdome.holdit.com>
>>>>> "jason" == jason <elephant@squirrelgroup.com> writes:
jason> you're not showing any locking of that file .. which is kind of
jason> important with this sort of thing
That's why you should always search the CPAN first, which
comes up with this very straightforward solution:
use File::CounterFile;
$newvalue = File::CounterFile->new("name_goes_here")->inc;
There. Short, sweet, flocked, etc.
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Fri, 11 Aug 2000 11:32:48 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Problems with adding 1
Message-Id: <MPG.13fe81c4d57978499896a4@localhost>
Randal L. Schwartz wrote ..
>>>>>> "jason" == jason <elephant@squirrelgroup.com> writes:
>
>jason> you're not showing any locking of that file .. which is kind of
>jason> important with this sort of thing
>
>That's why you should always search the CPAN first, which
>comes up with this very straightforward solution:
>
> use File::CounterFile;
> $newvalue = File::CounterFile->new("name_goes_here")->inc;
>
>There. Short, sweet, flocked, etc.
brilliant - is there ANYTHING that hasn't already been written .. I hope
the originator's still reading *8^)
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Fri, 11 Aug 2000 06:36:35 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Putting data into a form.
Message-Id: <slrn8p77nd.94h.efflandt@efflandt.xnet.com>
On Thu, 10 Aug 2000 20:29:24 GMT, emavres@yahoo.com <emavres@yahoo.com> wrote:
>I would like to get data from a file and place it into a form on an HTML
>page when the user selects a button. I know how to get form data using
>perl but cant figure out how to write data into some of the form
>elements. The form only has text fields.
On a system with Perl type: perldoc CGI
You can fill data into the form by setting the -value or -default
depending upon the type of field. But fields of the same name submitted
to the script will inherit their submitted values instead of defaults,
unless you use -override=>1.
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Fri, 11 Aug 2000 08:33:21 -0400
From: Ted Marz <tfm@sei.cmu.edu>
Subject: Re: Putting data into a form.
Message-Id: <3993F291.68F7CB38@sei.cmu.edu>
There is a value="<value>" attribute of the <INPUT> tag.
For selection type items, this specifies the value returned when the
item is selected.
For others, it gives the default value of the field.
It is applicable to
Button, checkbox, file, hidden, password, radio, reset, submit and
text input types, and the <textarea> form tag.
Get a HTML reference and look it up yourself.
Ted
emavres@yahoo.com wrote:
>
> I would like to get data from a file and place it into a form on an HTML
> page when the user selects a button. I know how to get form data using
> perl but cant figure out how to write data into some of the form
> elements. The form only has text fields.
>
> Thanks
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Fri, 11 Aug 2000 09:52:21 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: reg expressions - protect html
Message-Id: <3993BEC5.872D0D6C@yahoo.co.uk>
"Godzilla!" wrote:
> Which is an inherent margin of error. You are suggesting
> a CPU is capable of only handling one task at a time.
> I am skeptical, of course.
LOL! Yes, they do. Just one thing at a time I'm afraid.
> CPUs are well noted for multi-tasking
No they aren't. Operating systems are well noted for multitasking, that
is they switch between jobs rapidly to give the *appearance* of doing
more than one thing at a time. CPUs don''t even do that - it's just one
thing at a time.
For someone who shoots her mouth off so much, your lack of technical
savvy is truly astounding.
------------------------------
Date: Fri, 11 Aug 2000 13:43:10 +0100
From: "Daniel Foster" <daniel@blackomega.com>
Subject: s/// and symbolic references
Message-Id: <8n0se4$8je$1@newsg4.svr.pol.co.uk>
I'm trying to parse a text file and insert the value of any named
variables where they appear in the text file, and print the result.
This is actually being called from CGI, but I don't think that's
relevant. Here's some code...
while (<$element_filehandle>) { #previously opened correctly
my $testvar = 'test';
s/(\$)(\w+)/$$2/g;
print;
print " $testvar";
}
Running this over a line in the text file like 'Testvar holds
$testvar' produces the string 'Testvar holds 143572 test', with the
143572 (I assume the memory address $2 is in) changing every time it's
called (going up by 10) and the word 'test' being printed out by the
second print. Changing the second part of the regex to $2 simply
prints 'Testvar holds testvar', as you'd expect
Changing the regex to s/(\$\w+)/$$1/g; doesn't make any difference
(except to the number printed).
Am I taking entirely the wrong approach to this or am I nearly there?
---
"I have issues with babies - they're like tiny little
drunk old men."
- Urban Gothic
Daniel Foster - daniel@blackomega.com
------------------------------
Date: 8 Aug 2000 22:17:30 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: script for getting modem to make internet connection.
Message-Id: <8mptda$178$1@orpheus.gellyfish.com>
On Tue, 8 Aug 2000 11:12:07 +1000 Brent wrote:
> In article <slrn8oun6e.ej.efflandt@efflandt.xnet.com>, efflandt@xnet.com
> says...
>> On Tue, 8 Aug 2000 09:49:46 +1000, Brent <brentmi@bigpond.com> wrote:
>> >Hi there I was wondering if anyone new if there was something in perl
>> >that could be used to talk to a modem and dial an internet connection.
>> >Is there a module or something I can call to start with?
>> >
>> >The result I'm looking for is something that can dial multiple POPs one
>> >after the other and once a connection is made I want to do some other
>> >stuff to check links, mail, ping times etc, log the events then
>> >disconnect and do the next.
>>
>> What OS? In Linux it would be easy, but I would not know how to bring up
>> various connections in Windows.
>>
>>
> yes this would be under NT4.
You might be able to find some module that will work with RAS in the Win32::*
namespace or you might be able to automate the RAS Dialler with OLE.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 8 Aug 2000 21:24:58 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sendmail delivery failures
Message-Id: <8mpqaq$13q$1@orpheus.gellyfish.com>
On Mon, 07 Aug 2000 14:26:35 -0700 Robert wrote:
> Hello,
>
> I am using a Perl "Mailing List" script for sending emails to a
> list of addresses. The script uses sendmail to send out to all
> the addresses, but is there a way of logging which emails in the
> list are invalid? In other words, can Perl, or sendmail, capture
> mail delivery failure notifications in any way?
>
You may be able to use an option to sendmail to set it to print errors
rather than sending a mail message. You can find the option in the
sendmail manpage.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Fri, 11 Aug 2000 11:27:32 GMT
From: mat@designsolution.co.uk (Mat)
Subject: Sharing a cookie between two domains..?
Message-Id: <3993e311.14003035@news.btconnect.com>
Hi,
I am having a few problems trying to share a cookie between
two domains using Matt Wrights cookie.lib. As far as I can
understand, this is possible by using the function
&SetCookieDomain('.host.xxx').
Any ideas where I am going wrong..?
Snippet of script (setupcookie.pl) on www.madeupdomain-a.com
require "cookie.lib";
$cart = "Hello";
$Cookie_Domain = ".cookiedomain.com";
$TestCookie_URL = "http://www.cookiedomain.com/cgi-bin/viewcookie.pl";
print "Content-type: text/html\n"; # Content header
&SetCookieDomain($Cookie_Domain);
&SetCookies(test,$cart);
# see $TestCookie_URL for path. When cookie updated relocate to the
new domain
print "Location: $TestCookie_URL\n\n";
Snippet of script (viewcookie.pl) on www.cookiedomain.com
require "cookie.lib";
$cart = "Failed"; # $cart will get overwritten if cookie can be read
if (&GetCookies(test))
{
$cart = "$Cookies{test}"; # If cookie can be retrieved, $cart
will NOW contain "Hello"
}
print "Content-type: text/html\n\n"; # Content header
print $cart;
Any ideas or pointers will be dangdiddly fantastic..!
Mat.
------------------------------
Date: Fri, 11 Aug 2000 11:36:49 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Sharing a cookie between two domains..?
Message-Id: <MPG.13fe82b68daf5df09896a6@localhost>
Mat wrote ..
> I am having a few problems trying to share a cookie between
>two domains using Matt Wrights cookie.lib. As far as I can
>understand, this is possible by using the function
>&SetCookieDomain('.host.xxx').
>
> Any ideas where I am going wrong..?
if there's one thing that this newsgroup certainly is NOT it's a support
forum for Matt Wright's attempts at programming .. ask Matt Wright if
you have a problem with something that he supplied
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 11 Aug 2000 11:15:26 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: undef multiple variables
Message-Id: <8n0n8e$8cg$1@lublin.zrz.tu-berlin.de>
jason <elephant@squirrelgroup.com> wrote in comp.lang.perl.misc:
>Lauren Smith wrote ..
>>
>>Sanjay Krishna <krishnasanjay@hotmail.com> wrote in message
>>news:8mvl38$k33$1@nnrp1.deja.com...
>>> How do I undef multiple with a single line ?
>>>
>>> ex: undef($a, $b,$c,$d);
>>> doesn't work. Is there an alternative ?
>>
>>Use lexical variables.
>>
>>See the documentation for strict: 'perldoc strict'
>
>I'm not sure how that helps - or how you can deduce that $a, $b, $c and
>$d are not already lexicals
Well, a my() declaration resets its variables each time it is executed,
so it may help:
for ( ... ) {
my ( $a, $b);
# $a and $b are undefined here each time through, despite the next line
($a, $b) = (1, 2);
...
}
As a side note, if $a and $b *aren't* lexicals, it is best to avoid
these names because of their special significance in sort.
Anno
------------------------------
Date: 11 Aug 2000 12:48:46 +0100
From: nobull@mail.com
Subject: Re: undef multiple variables
Message-Id: <u9ya24uig1.fsf@wcl-l.bham.ac.uk>
jason <elephant@squirrelgroup.com> writes:
> Lauren Smith wrote ..
> >
> >Sanjay Krishna <krishnasanjay@hotmail.com> wrote in message
> >news:8mvl38$k33$1@nnrp1.deja.com...
> >> How do I undef multiple with a single line ?
> >>
> >> ex: undef($a, $b,$c,$d);
> >> doesn't work. Is there an alternative ?
> >
> >Use lexical variables.
> >
> >See the documentation for strict: 'perldoc strict'
>
> I'm not sure how that helps - or how you can deduce that $a, $b, $c and
> $d are not already lexicals
It is a resonable guess (say, 95%) that the reason Sanjay has got
himself into a situation where he wants to undef multiple variables is
because he's not scoping his variables properly.
Yes sure there's a 5% chance that Sanjay is actually asking the right
question but when there's a 95% chance that someone is asking the
wrong question and that question has already been answered it is
probably a good idea to answer the question that he probably should
have asked too.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 11 Aug 2000 11:26:08 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Re: Uploading Images
Message-Id: <8n0kav$nmu$1@supernews.com>
<centelec@my-deja.com> wrote in message news:8mv4sc$7uc$1@nnrp1.deja.com...
>
>
> I am writing a Perl script to upload images, jpegs or gifs. This
> is to be used for forum users that don't have web sites or web space.
> The script works as far as uploading the file but you cannot view the
> image after its uploaded. I downloaded it back to my computer and tried
> to open it with Adobe Photoshop. Got the following error:
>
> "Could not open the document because an unknown or invalid JPEG
> marker
> type is found."
>
> I'm sure it is a formating problem but not sure how to fix it.
> The uploading section of the script is as follows:
>
> use CGI;
> open (OUTFILE, ">$basedir$fileName") || die "Can't open photo
> file!\n";
> print "$basedir/$fileName<br>";
> while (my $bytesread = read($file, my $buffer, 1024)) {
> print OUTFILE $buffer;
> }
>
> My server is using Windows NT.
This is the key - you need to do
binmode OUTFILE;
before you start writing to it - otherwise it treats it as a text file, and
because windows and unix handle new line characters differently, it'd
convert from one to the other and mess up the file.
------------------------------
Date: Fri, 11 Aug 2000 10:50:28 GMT
From: john_s_brown@my-deja.com
Subject: Were are all the executibles?
Message-Id: <8n0lpj$apk$1@nnrp1.deja.com>
Why is Perl a scripting language? Why one can't make executibles (this
is, *.exe files)? Wouldn't compiling be much more intelligent than
interpreting? That way anybody could drive a perl program without
having perl interpreter!
Thanks for answering!
John S. Brown.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 11 Aug 2000 13:21:44 +0100
From: andkaha@hello.to.REMOVE (Andreas Kahari)
Subject: Re: Were are all the executibles?
Message-Id: <3993e1c8@merganser.its.uu.se>
In article <8n0lpj$apk$1@nnrp1.deja.com>, <john_s_brown@my-deja.com> wrote:
>Why is Perl a scripting language? Why one can't make executibles (this
>is, *.exe files)? Wouldn't compiling be much more intelligent than
>interpreting? That way anybody could drive a perl program without
>having perl interpreter!
>
>Thanks for answering!
>
> John S. Brown.
See perlfaq3: How can I compile my Perl program into byte code or C?
/A
--
# Andreas Kähäri, <URL:http://hello.to/andkaha/>.
# ...brought to you from Uppsala, Sweden.
# All junk e-mail is reported to the appropriate authorities.
# Criticism, cynicism and irony available free of charge.
------------------------------
Date: Fri, 11 Aug 2000 12:30:18 +0100
From: Wayne Keenan <tripix@metaverse.fsnet.co.uk>
Subject: Re: Were are all the executibles?
Message-Id: <3993E3CA.B1852452@metaverse.fsnet.co.uk>
john_s_brown@my-deja.com wrote:
>
> Why is Perl a scripting language? Why one can't make executibles (this
> is, *.exe files)? Wouldn't compiling be much more intelligent than
> interpreting? That way anybody could drive a perl program without
> having perl interpreter!
>
> Thanks for answering!
>
> John S. Brown.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
But didn't you know? EVERYONES got a Perl interpreter! ;)
Wayne
------------------------------
Date: 8 Aug 2000 21:15:58 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: what does foreach (0...10) do ???
Message-Id: <8mpppu$12u$1@orpheus.gellyfish.com>
On 08 Aug 2000 17:37:17 +0100 nobull@mail.com wrote:
> Jonathan Stowe <gellyfish@gellyfish.com> writes:
>
>> On Tue, 08 Aug 2000 08:38:11 GMT, Steve Button Wrote:
>> > Notice the three dots instead of two. It seems to work, but why??
>>
>> Read about the 'Range Operators' in the perlop manpage -
>
> Good advice, perhaps _you_ should.
>
I dont think I will *again* today thank you - there is perhaps a slight
ambiguity in the document that you have interpreted differently from me.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 11 Aug 2000 08:59:56 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: What is "pack()" used for?
Message-Id: <8n0fac$85r$1@lublin.zrz.tu-berlin.de>
Russ Jones <russ_jones@rac.ray.com> wrote in comp.lang.perl.misc:
>Bart Lateur wrote:
>>
>> Javier Hijas wrote:
>>
>> >Ok, I know what it does, but I wonder when may I need it.
>>
>> Converting plain, human form data into binary structures. unpack() does
>> the reverse.
>>
>> For example, if you explicitely want to process binary files, unpack()
>> will help in turning the rawbytes into numbers. See the module
>> Image::Size for examples. pack() is usefule if you want to generate such
>> binary files.
>>
>
>IP addresses, too. get*byname() and get*byaddr() use packed binary
>fields.
>
>$ip = "127.0.0.1";
>@octets = split('\.',$ip,4);
>$dns_name = gethostbyaddr(pack('C4',@octets),2);
>
>($oct1,$oct2,$oct3,$oct4) =
>unpack('C4',gethostbyname("my.server.com"));
>$ip = "$oct1.$oct2.$oct3.$oct4"
These particular transformations (and some more) are also available as
ready-to-use functions inet_aton and inet_ntoa, which are in the Socket
modules. Usually a tried and tested solution is preferable over
an ad-hoc one.
Anno
------------------------------
Date: 11 Aug 2000 12:45:11 +0100
From: nobull@mail.com
Subject: Re: What is "pack()" used for?
Message-Id: <u91yzwvx6g.fsf@wcl-l.bham.ac.uk>
Javier Hijas <jhijas@yahoo.es> writes:
> Ok, I know what it does, but I wonder when may I need it.
Binary files, networks, syscalls or libraries without an XS interface.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3984
**************************************