[16869] in Perl-Users-Digest
Perl-Users Digest, Issue: 4281 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 11 03:05:25 2000
Date: Mon, 11 Sep 2000 00:05:09 -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: <968655908-v9-i4281@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 11 Sep 2000 Volume: 9 Number: 4281
Today's topics:
Re: .NET in One Day (David H. Adler)
@$$myarray[1]? <fritz@mpsco.com>
Re: @$$myarray[1]? (Eric Bohlman)
Re: @$$myarray[1]? (Randal L. Schwartz)
Re: @$$myarray[1]? (Eric Bohlman)
File:Find - Why don't directories have trailing slash? <abuse@localhost.com>
Re: File:Find - Why don't directories have trailing sla (Eric Bohlman)
Good perl stuff pohanl@my-deja.com
Re: Job Offers: Web Designers & Programmers (David H. Adler)
Re: Need help with Win32::Console input <elephant@squirrelgroup.com>
Re: Qualifications for new Perl programmer????? <elephant@squirrelgroup.com>
Re: Qualifications for new Perl programmer????? (Gwyn Judd)
Re: Qualifications for new Perl programmer????? <elephant@squirrelgroup.com>
Re: Qualifications for new Perl programmer????? <christopher_j@uswest.net>
regular expression syntax pkobor@pfksystems.com
Re: Some question in using Perl Cookie from a PERL begi <elephant@squirrelgroup.com>
starting new processes <havanka.harri@nokia.com>
Re: use strict: why? (Ilya Zakharevich)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Sep 2000 05:26:21 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: .NET in One Day
Message-Id: <slrn8ror7t.ebf.dha@panix6.panix.com>
On 08 Sep 2000 22:31:09 GMT, Drew Simonis <care227@attglobal.net> wrote:
>"Interactive Software Engineering, Inc." wrote:
>>
>> NET IN ONE DAY: The Multi-Language Platform for the Age of the Internet
>> A one-day course by Bertrand Meyer
>
>What exactly does this drivel mean? Keep your spam to yourself.
Agreed.
>dha???
What??? It's not a job posting... What, you expect me to deal with
*every* inappropriate post here? Are you *nuts*?? :-)
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Your question doesn't make any sense. You might as well ask whether
it is possible to grow vegetables from a painting, without becoming
Wednesday first. - Abigail, c.l.p.misc
------------------------------
Date: Sun, 10 Sep 2000 21:40:47 -0700
From: Fritz Madden <fritz@mpsco.com>
Subject: @$$myarray[1]?
Message-Id: <39BC624F.8D0AAC5E@mpsco.com>
can anyone explain this piece of code?
@$$myarray[1]
Example:
foreach $value (@myvalues) {
print "@$$value[1]\n";
}
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: 11 Sep 2000 05:59:39 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: @$$myarray[1]?
Message-Id: <8phscb$kk7$2@slb1.atl.mindspring.net>
Fritz Madden (fritz@mpsco.com) wrote:
: can anyone explain this piece of code?
: @$$myarray[1]
:
: Example:
: foreach $value (@myvalues) {
: print "@$$value[1]\n";
: }
It's a two-level dereference followed by an array index. Due to Perl's
precedence rules, the expression is parsed more-or-less inside out:
$value is the value stored in $value (duh!), which happens to be a
reference to a scalar.
$$value is the value of the scalar referenced by $value. It happens to
be a reference to an array.
@$$value is the name of the array.
@$$value[1] is the second element of the array.
perldoc perlref if the above isn't clear to you.
------------------------------
Date: 10 Sep 2000 23:03:36 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: @$$myarray[1]?
Message-Id: <m14s3nwjlz.fsf@halfdome.holdit.com>
>>>>> "Eric" == Eric Bohlman <ebohlman@netcom.com> writes:
Eric> @$$value[1] is the second element of the array.
And wrongly, I might add. :) Should be $$$value[1].
Syntax like that should be shot. :)
$$value->[1] is cleaner. Still odd (a scalar reference to a scalar?)
but at least you won't get the evil stacked values.
--
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: 11 Sep 2000 06:27:46 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: @$$myarray[1]?
Message-Id: <8phu12$kk7$5@slb1.atl.mindspring.net>
Randal L. Schwartz (merlyn@stonehenge.com) wrote:
: >>>>> "Eric" == Eric Bohlman <ebohlman@netcom.com> writes:
:
: Eric> @$$value[1] is the second element of the array.
:
: And wrongly, I might add. :) Should be $$$value[1].
:
: Syntax like that should be shot. :)
I guess I can only deal with one level of indirection at a time...
Yes, of course that's an array slice; I guess I was so puzzled as to
*why* anyone would use that sort of indirection that I was focused on the
indirection itself and couldn't see the other problem; I'm reminded of
the story in _The Psychology of Computer Programming_ where someone kept
thinking that a word in an article was misspelled even though it wasn't
because a different word in the same position of the next paragraph *was*
misspelled. I wonder if there's an actual limit to the number of
simultaneous bugs one can detect in a given-sized chunk of code.
------------------------------
Date: Mon, 11 Sep 2000 13:50:46 +0800
From: "multiplexor" <abuse@localhost.com>
Subject: File:Find - Why don't directories have trailing slash?
Message-Id: <8phrfd$h1c$1@horn.hk.diyixian.com>
I am running ActivePerl and Win98. I found that the following code gives me
the directories without trailing slash:
####
use File::Find;
my (@files);
find(\&wanted, '../');
sub wanted {
push @files, $File::Find::name;
}
####
I feel it is difficult to distinguish between file and directory without the
slash, because a file without an extension looks like a directory. Are there
any reasons for this? What can I do if I really want directories having
trailing slash?
Thanks for any help.
------------------------------
Date: 11 Sep 2000 06:02:38 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: File:Find - Why don't directories have trailing slash?
Message-Id: <8phshu$kk7$3@slb1.atl.mindspring.net>
multiplexor (abuse@localhost.com) wrote:
: I am running ActivePerl and Win98. I found that the following code gives me
: the directories without trailing slash:
:
: ####
: use File::Find;
:
: my (@files);
: find(\&wanted, '../');
:
: sub wanted {
: push @files, $File::Find::name;
: }
: ####
:
: I feel it is difficult to distinguish between file and directory without the
: slash, because a file without an extension looks like a directory. Are there
: any reasons for this? What can I do if I really want directories having
: trailing slash?
The reason is that a trailing slash isn't actually part of a directory's
name. Using one is just a convention for human readability. If you want
one, use the -d test to determine if the name is a directory name, and
then tack on slash if it is.
------------------------------
Date: Mon, 11 Sep 2000 05:57:11 GMT
From: pohanl@my-deja.com
Subject: Good perl stuff
Message-Id: <8phs7j$bb6$1@nnrp1.deja.com>
Hello. It seems there is a disparate amount of discussions here
about many topics. Wouldn't it be great if people
can instantantly create a discussion forum for information,
troubleshooting, and other goodies for their particular topic?
Also, there seems to be basic terminology used here that newbies
would like to know the glossary definitions of. (like DB_File,
chomp, perldoc, Larry Wall, etc). Wouldn't it be great if there
was a dynamic glossary where people can just add their terminology?
Also, wouldn't it be great if in the discussion forum mentioned above,
all the terms defined in the glossary are instantly linked, so
that people can click on it to read the definition they are not
familiar with?
Well, I would like to announce that this technology exists, and it
is FREE! So if you ever, on the whim, want to start a web-based
discussion for ANY topic you choose, and have an automatic glossary
associated with it, just do this....
http://edepot.com/cgi-bin/forums.pl?code=TOPICNAME
TOPICNAME will be the name of your forum...
(Sorry, you can't have spaces in the TOPICNAME)
for example...
A discussion forum for Perl
http://edepot.com/cgi-bin/forums.pl?code=Perl
or
http://edepot.com/cgi-bin/forums.pl?code=PerlLanguage
or a forum for cats...
http://edepot.com/cgi-bin/forums.pl?code=Cat
or a forum for IBM...
http://edepot.com/cgi-bin/forums.pl?code=IBM
ANY TOPIC you choose (just no spaces in the name).
Instantly, a glossary will be created for that forum,
so you can enter special terminology for that topic.
...
If you wish to only use the eGlossary, you can do this...
http://edepot.com/cgi-bin/eglossary.pl?book=TOPICNAME
for example...
http://edepot.com/cgi-bin/eglossary.pl?book=Notebooks
would create a special glossary for your use on the topic of Notebooks.
Feel free to use the discussion forum or eglossary for any topic
you choose. If you have a website, simply make a link like above,
and you can have a free permanent discussion forum or eglossary.
Obviously, they are made in perl...
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 11 Sep 2000 05:46:04 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: Job Offers: Web Designers & Programmers
Message-Id: <slrn8roscs.ebf.dha@panix6.panix.com>
On Sun, 10 Sep 2000 20:33:30 +0300, jobs2001 <jobs2001@gmx.net> wrote:
>Job Offers: Web Designers & Programmers
>
>Vacancies
>
>a world wide operating software company, with
>branches in Eastern, North, South Europe, invites
>applications for the following positions in
>
>
>Web Designers
>
>The ideal candidates should have experiences with
>some of the latest web technologies and design applications,
>like Frontpage, Golive, DreamWeaver, Photoshop, Flash,
>DHTML, CSS, XML, Java Script, Java, ASP, CGI, Perl, PHP3 etc.
>
>
>Programmers
>
>The ideal candidates should have experiences in some
>of the following fields: Win32, C/C++, ASP, Java,
>Java Script, XML, DHTML, MS SQL, Access/VB,
>web database/servers, MFC, Visual C/InterDev,
>Win NT/2000, MacOS, Linux and CGI.
>
>
>Positions are available on part time, full time (also remotely)
>and contract basis.
>
>
>Applications
>
>Interested applicants should forward a CV,
>a detailed description of their skills, experiences
>and of the past projects they have worked on and
>their duties in these projects via
You have posted a job posting or a resume in a technical group.
Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.
Had you read and understood the Usenet user manual posted frequently
to "news.announce.newusers", you might have already known this. :)
Please do not explain your posting by saying "but I saw other job
postings here". Just because one person jumps off a bridge, doesn't
mean everyone does. Those postings are also in error, and I've
probably already notified them as well.
If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.
There is a Perl Jobs Announce list that may be more helpful to you. See
<http://www.pm.org/mailing_lists.shtml> for details.
Yours for a better usenet,
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Hello breasts! - subbes
------------------------------
Date: Mon, 11 Sep 2000 15:08:19 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Need help with Win32::Console input
Message-Id: <MPG.1426f7ae98bcae33989771@localhost>
Randy <randy_734@my-deja.com> wrote ..
>I'm stuck trying to take either mouse or keyboard input on NT. If the
>user begins typing rather than mousing, I don't want to lose the first
>character.
>
>This snippet almost works:
you might think so
>$conI = Win32::Console->new(STD_INPUT_HANDLE);
>$m = $conI->Mode ;
>$m = ($m | ENABLE_MOUSE_INPUT) ;
>$conI->Mode($m) ;
>while (1) {
> @k = $conI->Input ;
> if ($k[1] == 1) { # a key press
^^^^^^^^^^..this is checking the second element of the Input
list which is the keydown/keyup thing
> $conI->WriteInput(@k) ; # attempt to put key back in buffer
^^^^^^^^^^..this doesn't actually print anything to the
screen
> last ;
^^^^..this exits the while loop so only the first char is
processed by Win32::Console
> }
> if ($k[0] == 2 & $k[3]==1) { # mouse click
> print "Mouse click row $k[2]\a" ;
> # continue in mouse_handler
> }
>}
on the first keyboard press you end up here - outside of the loop .. and
it's all over from there
>chomp ($infile = <STDIN>) ;
>The WriteInput seems to always put a ` (a backtick) in the input
>buffer rather than the key pressed. I've tried using PeekInput
>instead of Input but can't seem to get it to see the mouse clicks.
I didn't see this backtick behaviour with the example that you posted
above
>Any suggestions are appreciated.
yeah .. start here (paste it back together)
http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/winbas
e/conchar_4p6c.htm
and learn how the API works .. then use the Perl interface in
Win32::Console
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Mon, 11 Sep 2000 15:33:04 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <MPG.1426fd79598c517b989773@localhost>
Peter Gregefalk <gregefalk@cadvision.com> wrote ..
>Anybody with experience with hiring Perl programmers or even programmers
>with experience of what employers are looking for in a new Perl
>programmer?
>
>I would like to find out the most common qualifications looked after in
>a Perl programmer in the field of Web applications. I know it's
>impossible to generalize everybody's needs into a somewhat short list.
>But if there is something that comes to your mind when thinking about
>this, please send a respond.
I've recently been on a bit of a recruitment drive for just such an
apple .. one thing's fer sure - pickin's is scarce
I'm not a big believer in 'qualifications' in the conventional sense of
the word .. but I did ask that everyone complete the following quick
quiz .. I sprung it on the candidates and they had to complete it
without referring to any references
regulars in this group will be saddened to learn that out of 9
unsuccessful candidates I received just three correct answers in total
(not three correct quizzes .. but three correct answers) .. and that was
despite the fact that I basically gave away all the builtin variable
related answers in the wording of the question
I found the person I was looking for in the local Perl Mongers group ..
yay (hi Tony if you're reading ;) .. who breezed through all 8 without
incident
here's the quiz (feel free to use it) .. the answers should be obvious
Questions.
1. Give one short example each demonstrating appropriate uses
for 'my' and 'local'.
2. Explain the bearing that the builtin input record separator
variable $/ has on the diamond operator <>.
3. Rewrite the following code so that it successfully does what
it's trying to do ?
$x = (STDIN);
print 'You just typed $x/n';
4. On a Win32 system what is the difference in what $x contains
after each of the following lines of code ?
$x = system( 'dir' );
$x = `dir`;
5. How are the two builtin functions 'shift' and 'pop' related
to each other ? And how are they different ?
6. Explain the difference between variables beginning with '@'
and variables beginning with '%'.
7. Assuming the following initialisation:
@x = ( 'one', 'two', 'three' );
What would the output of the following statement be ?
print @x[0..$#x];
And how would be a better way of writing the same thing ?
Bonus point for explaining how the builtin output field
separator variable $, could affect output here ?
8. Assuming the same initialisation as (7) above what will be the
difference in output between the following two lines of code ?
print @x;
print "@x";
Bonus point for explaining why ?
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Mon, 11 Sep 2000 06:05:10 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <slrn8rotnf.1bt.tjla@thislove.dyndns.org>
I was shocked! How could jason <elephant@squirrelgroup.com>
say such a terrible thing:
>Peter Gregefalk <gregefalk@cadvision.com> wrote ..
>>Anybody with experience with hiring Perl programmers or even programmers
>>with experience of what employers are looking for in a new Perl
>>programmer?
>>
>>I would like to find out the most common qualifications looked after in
>>a Perl programmer in the field of Web applications. I know it's
>>impossible to generalize everybody's needs into a somewhat short list.
>>But if there is something that comes to your mind when thinking about
>>this, please send a respond.
>
>I've recently been on a bit of a recruitment drive for just such an
>apple .. one thing's fer sure - pickin's is scarce
>
>I'm not a big believer in 'qualifications' in the conventional sense of
>the word .. but I did ask that everyone complete the following quick
>quiz .. I sprung it on the candidates and they had to complete it
>without referring to any references
>
>regulars in this group will be saddened to learn that out of 9
>unsuccessful candidates I received just three correct answers in total
>(not three correct quizzes .. but three correct answers) .. and that was
>despite the fact that I basically gave away all the builtin variable
>related answers in the wording of the question
>
>I found the person I was looking for in the local Perl Mongers group ..
>yay (hi Tony if you're reading ;) .. who breezed through all 8 without
>incident
>
>here's the quiz (feel free to use it) .. the answers should be obvious
>
>Questions.
>
>1. Give one short example each demonstrating appropriate uses
> for 'my' and 'local'.
{
my $greeting = 'hello';
local $\ = "\n";
print $greeting;
}
>2. Explain the bearing that the builtin input record separator
> variable $/ has on the diamond operator <>.
This is the character (or group of characters that the input operator
'<>' seperates records on).
>3. Rewrite the following code so that it successfully does what
> it's trying to do ?
>
> $x = (STDIN);
> print 'You just typed $x/n';
$x = <STDIN>;
print "You just typed $x\n";
>4. On a Win32 system what is the difference in what $x contains
> after each of the following lines of code ?
>
> $x = system( 'dir' );
$x contains the return value (an integer) of the 'dir' command.
> $x = `dir`;
$x contains the output of the 'dir' command.
>5. How are the two builtin functions 'shift' and 'pop' related
> to each other ? And how are they different ?
They operate by taking elements from the end of an array. They are
different in which end they take elements from (pop takes them from the
back, shift from the front).
>6. Explain the difference between variables beginning with '@'
> and variables beginning with '%'.
A variable name starting with @ signifies that it is an array type, a %
signifies it is a hash.
>7. Assuming the following initialisation:
>
> @x = ( 'one', 'two', 'three' );
>
> What would the output of the following statement be ?
>
> print @x[0..$#x];
It would print the content of @x.
> And how would be a better way of writing the same thing ?
print @x;
> Bonus point for explaining how the builtin output field
> separator variable $, could affect output here ?
print() takes a list and prints them on the standard output (by
default). Each element is printed seperated by the string in $, eg. if
you set $, = ',' then it would seperate the elements with commas.
>8. Assuming the same initialisation as (7) above what will be the
> difference in output between the following two lines of code ?
>
> print @x;
>
> print "@x";
>
> Bonus point for explaining why ?
The second will have the output seperated by spaces*. No I don't know
why**.
It's good to know I'll be in demand when I graduate :)
* I cheated on this one, but I really did know all the others
** I know now it is because an interpolated array is converted
internally to join (using $" as the string to join with. $" defaults to
a space).
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Education is what survives when what has been learnt has been forgotten.
-- B.F. Skinner
------------------------------
Date: Mon, 11 Sep 2000 17:52:26 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <MPG.14271e29eb5e2ff9989774@localhost>
Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote ..
>It's good to know I'll be in demand when I graduate :)
*8^)
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Sun, 10 Sep 2000 23:52:03 -0700
From: "Christopher M. Jones" <christopher_j@uswest.net>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <oi%u5.1721$ko1.564001@news.uswest.net>
"jason" <elephant@squirrelgroup.com> wrote:
> I've recently been on a bit of a recruitment drive for just such an
> apple .. one thing's fer sure - pickin's is scarce
>
> I'm not a big believer in 'qualifications' in the conventional sense of
> the word .. but I did ask that everyone complete the following quick
> quiz .. I sprung it on the candidates and they had to complete it
> without referring to any references
>
> regulars in this group will be saddened to learn that out of 9
> unsuccessful candidates I received just three correct answers in total
> (not three correct quizzes .. but three correct answers) .. and that was
> despite the fact that I basically gave away all the builtin variable
> related answers in the wording of the question
Oooo, ouch that's harsh. I guess that's why a lot of job
postings have fairly unreasonably high required skill levels
(for that pay anyway), to try to weed out the wannabes. I
suppose programming and webdev are somewhat similar, there's
a vast imbalance of people calling themselves programmers
compared to people who can actually program their way out of
a wet paper sack. And it seems like every other geek with a
copy of Frontpage and MS Paint decides to call themselves a
web designer / graphic artist these days.
There's one good way to avoid getting unfairly pegged as
someone who doesn't know their stuff, and that is to have
a gallery of examples (as well as a good history of all
your past work _if_ you can show it).
------------------------------
Date: Mon, 11 Sep 2000 06:49:10 GMT
From: pkobor@pfksystems.com
Subject: regular expression syntax
Message-Id: <8phv92$edv$1@nnrp1.deja.com>
I need a little help with regexp.
I want to split $content with multiple lines of html text into three
strings, the first with everything up to the first occurrence of <ul>,
the second with everything that follows <ul> until the next </ul>, and
the third with everything after the </ul>.
soemthing like:
($precontent, $alist, $postcontent) =
($content =~ /(.*)<ul>(.*)<\/ul>(.*)/s);
but I'm not sure what to put in place of the (.*)'s
Thanks,
Peter
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 11 Sep 2000 15:21:41 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Some question in using Perl Cookie from a PERL beginner
Message-Id: <MPG.1426fad2f8ad5eaf989772@localhost>
Kit <2kman@lovecat.com> wrote ..
>Dear all, I am beginner of using Perl and have some question when using
>cookie. Hope you can help me to solve it.
>
>Firstly, I pass value "apple" to aa.cgi through index.html. When going
>to bb.cgi, it would load the value (i.e. 'apple') in cookie 'aaa' and do
>
>something. When going to cc.cgi, the value in cookie 'aaa' ( ie 'apple')
>
>would be reset. The coding is described as following:-
>
># In aa.cgi >>
>#!/usr/bin/perl
>$in1=new CGI;
>$cookie=$in1->cookie(-name=>'aaa', -value=>"$var1");
>print $in1->header(-cookie=>$cookie);
>
>
># In bb.cgi >>
>#!/usr/bin/perl
>$get1=new CGI;
>$var1=$get1->cookie(-name=>"aaa");
>
># In cc.cgi >>
>#!/usr/bin/perl
>$out=new CGI;
>$cookie=$out->cookie(-name=>'aaa', -value=>"");
>print $out->header(-cookie=>$cookie);
>
>1. Would it either create new cookie in browser or add the value into
>current portal cookie?
as was recently discovered in this newsgroup .. this depends on which
version of CGI::Cookie you're using
another part of cookies that you might not be aware of (other than
'name' and 'value') is 'path' .. this tells the browser when to return
the cookie to the server
if you don't provide a path value yourself then the CGI::Cookie module
will create one for you .. the default value for this path has changed a
few times and does not always match the documentation
so .. best bet is to include the path explicitly yourself .. ie.
$cookie = $out->cookie( -name => 'aaa', -value => "", -path = '/');
this will set the path of that cookie to '/' which means that the
browser will send back that cookie with ALL scripts executed on the
server
you could also set it to $ENV{SCRIPT_NAME} in which case the browser
would only send it back for THAT script .. ie. for the xx.cgi program
that the cookie was set in
and that's the answer to your question
a new cookie will be created if the path setting prevents the browser
from sending back the cookie that another script set (this would be the
$ENV{SCRIPT_NAME} example above) .. but the same cookie will be updated
if the path setting allows the browser to send back the same cookie
(this would be the '/' example above)
>2. Since I don't set the expiry date, I assume the cookie would be
>deleted once closing browser. If someone has stolen the cookies before
>closing browser, would the guy can copy the cookie file to her/his PC
>and then directly type the path of bb.cgi with getting the value 'apple'
>without calling aa.cgi or index.html?
yes - you're correct - when the browser closes the cookie will be
removed from memory because you have not set an expiry date
I don't know what you mean by 'stolen' ? .. people don't steal cookies -
you send them to them
I think the question that you're looking for is "don't trust cookies for
anything more than convenience, they are not secure"
>3. When access cc.cgi, I assume the value of cookie (i.e. aaa) would
>be clear. But I found that if the guy has not access cc.cgi to clear
>the value but access aa.cgi with re-type new value such as 'orange'.
>When the guy access bb.cgi, it seems to use the previous value 'apple'
>not 'orange'. Why ?
don't know without knowing more about how you're setting these cookies
>4. How do I set more secure for avoiding someone to get the value in
>cookie "aaa' ?
assuming that you're talking about someone in between the server and
your target user - then you could use an SSL certificate to secure the
session which would prevent people from intercepting the information
sent between the server and your target user
but if you're talking about the target user saving the cookie despite
the fact that you set no expiry - then there's no way to guarantee that
they don't save it .. you send it to them - it's theirs to save
>5. Would Perl have allowed to use Session ID rather than cookie?
if you're talking about the SessionID like the one that ASP in Microsoft
IIS uses - then that is actually implemented using cookies underneath
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Mon, 11 Sep 2000 06:01:26 GMT
From: "Harri Havanka" <havanka.harri@nokia.com>
Subject: starting new processes
Message-Id: <Wy_u5.9000$AM5.159585@news1.nokia.com>
I have problem:
I have to start new process, if their count is <5.
How I check this? I want only check count of
mysubprocess.pl, not all processes.
Fork-function seems little
bit weird for me..
Thanks for your help..
------------------------------
Date: 11 Sep 2000 04:34:05 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: use strict: why?
Message-Id: <8phnbt$4b$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Uri Guttman
<uri@sysarch.com>],
who wrote in article <x7g0n9io4t.fsf@home.sysarch.com>:
> you are missing the point. in your mind, separate the way you access a
> value (lexical or symbolic) from the value itself. local affects the
> value only and not the variable. so if you have access to the value you
> can localize it. a slice has access to the values of a lexical so local
> can work on those values.
Recently, I finally understood why there is some opposition in allowing
local() to work on lexical variables. Here is how access to
symbol-table variable is performed:
a pointer to a glob (stored in the code tree) ====> (0)
SV structure of a glob (has a pointer to ...) ====> (1)
XPVGV structure of a glob (has a pointer to ...) ====> (A)
a table consisting of pointers to a scalar, array etc ====> (B)
a pointer to a scalar ====> (C)
SV structure (containing a pointer to a table which
decribes the value of the variable) ====> (D)
"value"
local *var changes the pointer used on the step "A" of the
translation, local $var changes the pointer used on the step "C".
Note that there is another way to change the value of the variable, it
is overwriting the info used on the step "D".
Lexicals are accessed differently:
an offset (stored in the code tree) ====> (0)
an entry in the "scratchpad" table of the current scope ====> (C)
[the rest is the same]
(this entry is alread a pointer to a scalar). Again, to local()ize
the value, you can either change the entry used on the step "C", or
change the SV structure (step "D"). Complications:
a) localizing-via-step "D" would make the semantic of existing
references to localized variables different:
$var = 3;
$ref = \$var;
local $var = 11;
print $$ref;
b) On the other hand, there is some code which assumes that
variables having a flag IsALexicalVar may be accessed from the
scratchpad. Thus localizing-via-step-C, in other words,
modifying the scratchpad to have a pointer to a completely new
variable, may confuse Perl;
c) Anyway, localizing conflicts with clearing of lexical at the end
of the scope - in which order the things should be
de-localization/clearing be done?
Ilya
------------------------------
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 4281
**************************************