[11358] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4957 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 26 11:19:37 1999

Date: Fri, 26 Feb 99 08:10:00 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 26 Feb 1999     Volume: 8 Number: 4957

Today's topics:
        " in between `` or in open <thel@serop.abb.se>
    Re: " in between `` or in open <thel@serop.abb.se>
    Re: " in between `` or in open (Pedro Miguel A. C. Raposo)
    Re: " in between `` or in open <thel@serop.abb.se>
        "Learning Perl" <bgarrett@hamilton.net>
    Re: "Learning Perl" (Tad McClellan)
    Re: "Learning Perl" droby@copyright.com
    Re: "Learning Perl" (Randal L. Schwartz)
    Re: "Learning Perl" (Abigail)
    Re: "Learning Perl" <droby@copyright.com>
    Re: "Learning Perl" <jeff@vpservices.com>
    Re: "Learning Perl" (brian d foy)
    Re: "Learning Perl" <droby@copyright.com>
        '&&' '||' vs 'and' 'or' (Was: Re: map + grep replacemen (Larry Rosler)
        'x' operator to pre-extend a string <mikeryan@acm.org>
        ****Cookies!!!!!!!!!!!!!!!******* <Webmaster@Freeness.net>
    Re: ****Cookies!!!!!!!!!!!!!!!******* <gsx97@usa.net>
    Re: ****Cookies!!!!!!!!!!!!!!!******* (I R A Aggie)
    Re: ****Cookies!!!!!!!!!!!!!!!******* (Don Groves)
        .nexrc and vi <asim@cse.buffalo.edu>
    Re: .nexrc and vi <tchrist@mox.perl.com>
    Re: /i in regexp kills performance. (Bart Lateur)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 23 Feb 1999 10:39:17 +0100
From: Thomas Eliasson <thel@serop.abb.se>
Subject: " in between `` or in open
Message-Id: <36D27744.6CCBC235@serop.abb.se>

Hi!
I can't figure out how to create a string which contains a ", and then
use the string
in a backtick 'call' or in a open call.

I've tried to do this (I've simplified things a little, so, yes I need
the $ARGS variable):
$LOG=$ARGV[1];
$ARGS="-u -m\"$LOG\"";
`ci $ARGS $FILE`;

What I have is a logmessage with whitespace, e.g. "new file", to be used
when checking in
a file with GNU RCS. I'm using perl 5 on an NT machine.

I've searched through the FAQ:s, and this newsgroup, but couldn't find
any help.

Thanks for YOUR help!
:-)
/Thomas



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

Date: Wed, 24 Feb 1999 12:14:30 +0100
From: Thomas Eliasson <thel@serop.abb.se>
Subject: Re: " in between `` or in open
Message-Id: <36D3DF15.36BB4373@serop.abb.se>

I've now tried this on a Unix machine (HP-Unix), and it works fine.

Is this a Perl bug on NT, or is it a different behaviour due to the
shell processor?
The Perl version is 5.003 on both NT and Unix.

/Thomas

Thomas Eliasson wrote:

> Hi!
> I can't figure out how to create a string which contains a ", and then
> use the string
> in a backtick 'call' or in a open call.
>
> I've tried to do this (I've simplified things a little, so, yes I need
> the $ARGS variable):
> $LOG=$ARGV[1];
> $ARGS="-u -m\"$LOG\"";
> `ci $ARGS $FILE`;
>
> What I have is a logmessage with whitespace, e.g. "new file", to be used
> when checking in
> a file with GNU RCS. I'm using perl 5 on an NT machine.
>
> I've searched through the FAQ:s, and this newsgroup, but couldn't find
> any help.
>
> Thanks for YOUR help!
> :-)
> /Thomas



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

Date: Wed, 24 Feb 1999 12:47:49 GMT
From: Pedro.Raposo@tmn.pt (Pedro Miguel A. C. Raposo)
Subject: Re: " in between `` or in open
Message-Id: <7b0slb$ruk$1@duke.telepac.pt>

In article <36D3DF15.36BB4373@serop.abb.se>, Thomas Eliasson <thel@serop.abb.se> wrote:
>I've now tried this on a Unix machine (HP-Unix), and it works fine.
>
>Is this a Perl bug on NT, or is it a different behaviour due to the
>shell processor?
>The Perl version is 5.003 on both NT and Unix.
>
>/Thomas
>
>Thomas Eliasson wrote:
>

Nope.
Just tried the code on my NT running ActiveState Perl, and it works ... well, 
sort of ...

I changed te code to use a more obvious command on the NT platform:

$LOG=$ARGV[1];
$FILE = "out.txt";

$ARGS="\"$LOG\"";
`copy $ARGS $FILE`;

I think the answer is in the way you call the script.

If you call it like this

NTShell> perl script.pl arg0 in txt

It's obvious that $ARGV[1] gets "in", and not "in txt"; the "txt" part goes 
into $ARGV[2]

Now, if you call it like 

NTShell> perl script.pl arg0 "in txt"

the NT shell will pass "in txt" as $ARGV[1] (quotes removed by the shell), 
and ($ARGV[1] eq "in txt") holds true ...

If it works in HP, the probably the space on the filename was quoted ...

Hope this helped.

Pedro Miguel Raposo

>> Hi!
>> I can't figure out how to create a string which contains a ", and then
>> use the string
>> in a backtick 'call' or in a open call.
>>
>> I've tried to do this (I've simplified things a little, so, yes I need
>> the $ARGS variable):
>> $LOG=$ARGV[1];
>> $ARGS="-u -m\"$LOG\"";
>> `ci $ARGS $FILE`;
>>
>> What I have is a logmessage with whitespace, e.g. "new file", to be used
>> when checking in
>> a file with GNU RCS. I'm using perl 5 on an NT machine.
>>
>> I've searched through the FAQ:s, and this newsgroup, but couldn't find
>> any help.
>>
>> Thanks for YOUR help!
>> :-)
>> /Thomas
>


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

Date: Thu, 25 Feb 1999 09:26:58 +0100
From: Thomas Eliasson <thel@serop.abb.se>
Subject: Re: " in between `` or in open
Message-Id: <36D50952.75601B2C@serop.abb.se>

Thanks!

I've been investigating this further myself, and it seems to be a bug in 5.003. I tried it
at home where I have 5.005_2 and it worked fine, and now I've installed 5.004_4 here at
work, at now it works just fine here too!

/Thomas

"Pedro Miguel A. C. Raposo" wrote:

> In article <36D3DF15.36BB4373@serop.abb.se>, Thomas Eliasson <thel@serop.abb.se> wrote:
> >I've now tried this on a Unix machine (HP-Unix), and it works fine.
> >
> >Is this a Perl bug on NT, or is it a different behaviour due to the
> >shell processor?
> >The Perl version is 5.003 on both NT and Unix.
> >
> >/Thomas
> >
> >Thomas Eliasson wrote:
> >
>
> Nope.
> Just tried the code on my NT running ActiveState Perl, and it works ... well,
> sort of ...
>
> I changed te code to use a more obvious command on the NT platform:
>
> $LOG=$ARGV[1];
> $FILE = "out.txt";
>
> $ARGS="\"$LOG\"";
> `copy $ARGS $FILE`;
>
> I think the answer is in the way you call the script.
>
> If you call it like this
>
> NTShell> perl script.pl arg0 in txt
>
> It's obvious that $ARGV[1] gets "in", and not "in txt"; the "txt" part goes
> into $ARGV[2]
>
> Now, if you call it like
>
> NTShell> perl script.pl arg0 "in txt"
>
> the NT shell will pass "in txt" as $ARGV[1] (quotes removed by the shell),
> and ($ARGV[1] eq "in txt") holds true ...
>
> If it works in HP, the probably the space on the filename was quoted ...
>
> Hope this helped.
>
> Pedro Miguel Raposo
>
> >> Hi!
> >> I can't figure out how to create a string which contains a ", and then
> >> use the string
> >> in a backtick 'call' or in a open call.
> >>
> >> I've tried to do this (I've simplified things a little, so, yes I need
> >> the $ARGS variable):
> >> $LOG=$ARGV[1];
> >> $ARGS="-u -m\"$LOG\"";
> >> `ci $ARGS $FILE`;
> >>
> >> What I have is a logmessage with whitespace, e.g. "new file", to be used
> >> when checking in
> >> a file with GNU RCS. I'm using perl 5 on an NT machine.
> >>
> >> I've searched through the FAQ:s, and this newsgroup, but couldn't find
> >> any help.
> >>
> >> Thanks for YOUR help!
> >> :-)
> >> /Thomas
> >



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

Date: Tue, 23 Feb 1999 20:31:30 -0800
From: Bill Garrett <bgarrett@hamilton.net>
Subject: "Learning Perl"
Message-Id: <36D3809D.FC88254A@hamilton.net>

#!/usr/local/bin/perl -w
print "What is your name? ";
$name = <STDIN>;
chomp ($name);
print "Hello, $name!\n";

When I run this script from the web chmoded at 755 I get this error
message:
Errors:
Use of uninitialized value at
/data1/hypermart.net/garretts/aperl/hellonm.pl line 4.
Use of uninitialized value at
/data1/hypermart.net/garretts/aperl/hellonm.pl line 5.
[Tue Feb 23 21:15:38 1999] access to
/data1/hypermart.net/garretts/aperl/hellonm.pl failed for
204.214.132.94, reason: malformed header from script. Bad header=What is
your name? Hello, !
What could be the problem?
I have noticed that when I add the print "Content-type: text/plain\n\n";

I get something like this loading up
What is your name? Hello, !
</noscript>
<!-- -->
</noscript>
<SCRIPT LANGUAGE="JavaScript">

<!--
browser = (((navigator.appName == "Netscape") &&
(parseInt(navigator.appVersion) >= 2 )) || ((navigator.appName ==
"Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 2
)));
if (browser) {
if (self.height) {
   if (parseInt(self.height) < 167) {
      var height = '167';
   }
} else {
   var height = '167';
}
if (!self.url) {
   self.url = '';
}
if (parent.name != 'test') {
   test =
window.open("http://click.go2net.com/magic/adpopup?site=HM&shape=banner&border=1&area=users.Directories_Search_Engines_and_ISPs.Web_Developer",
"test", "resizable=yes,width=520,height=" + self.height);
   // setTimeout("test.opener = self;", 3000);
   // test.opener = self;
}
}
//-->

</SCRIPT>

This looks like the code that is automatically inserted to all of my
pages since my pages are hosted on hypermart a place that requires you
to put banner ads on your pages.

When i put in the print "Content-type: txt/html\n\n";
I get a page that just says:
What is your name? Hello, !

It never promps me for my name.
Thanks,

Jason



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

Date: Tue, 23 Feb 1999 18:42:08 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: "Learning Perl"
Message-Id: <gceva7.lr6.ln@magna.metronet.com>

Bill Garrett (bgarrett@hamilton.net) wrote:
: #!/usr/local/bin/perl -w
: print "What is your name? ";
: $name = <STDIN>;
          ^^^^^^^
: chomp ($name);
: print "Hello, $name!\n";

: When I run this script from the web chmoded at 755 I get this error
                         ^^^^^^^^^^^^

: When i put in the print "Content-type: txt/html\n\n";
: I get a page that just says:
: What is your name? Hello, !

: It never promps me for my name.


   Because that is not how you do input/output under the Common
   Gateway Interface.

   "Learning Perl" is about Perl.

   Other books are about other things, like CGI.

   None of the examples there will work correctly in a CGI environment.


   You need to know the Common Gateway Interface to do web stuff.

   You can do CGI with any programming language (though some have
   libraries that make it easier).

   Many people choose to use Perl, but Perl and the WWW are not
   joined at the hip or anything.

   Perl had a wide following before the WWW was even _invented_.



   To find out about CGI, see:

       http://www.smithrenaud.com/public/CGI_MetaFAQ.html



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 25 Feb 1999 15:20:06 GMT
From: droby@copyright.com
Subject: Re: "Learning Perl"
Message-Id: <7b3pmq$umb$1@nnrp1.dejanews.com>

In article <gceva7.lr6.ln@magna.metronet.com>,
  tadmc@metronet.com (Tad McClellan) wrote:
>
>    Perl had a wide following before the WWW was even _invented_.
>

How wide?  WWW is indeed younger than Perl, but only by a few years, and it
does predate Perl4.  WWW is not so new anymore.

I know I never used Perl3.

But my first use of Perl4.036 had nothing to do with WWW.

--
Don Roby

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 25 Feb 1999 10:08:41 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: "Learning Perl"
Message-Id: <m13e3u1hli.fsf@halfdome.holdit.com>

>>>>> "droby" == droby  <droby@copyright.com> writes:

droby> How wide?  WWW is indeed younger than Perl, but only by a few
droby> years, and it does predate Perl4.

How do you figure?  Mosaic, the first real browser that people outside
 .ch used, wasn't version 1.0 until late 1993.  By that time, Perl4 had
already been long frozen, having emerged in jan 91 (based
predominantly on Perl3 from early 1990).  In fact, Perl5 was just
starting to come on the scene in early-mid 94, around the time of the
NCSA "what's new" page that listed *all* new websites... about 2-5 a
day in that period. :)

Two years ago, I told people "Perl is twice as old as the web", and it
was accurate.  Now we're down to only "a few years older than the
web", which is still a lifetime in the computer industry.

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 25 Feb 1999 20:32:17 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: "Learning Perl"
Message-Id: <7b4c0h$35c$1@client2.news.psi.net>

Randal L. Schwartz (merlyn@stonehenge.com) wrote on MMIV September
MCMXCIII in <URL:news:m13e3u1hli.fsf@halfdome.holdit.com>:
"" >>>>> "droby" == droby  <droby@copyright.com> writes:
"" 
"" droby> How wide?  WWW is indeed younger than Perl, but only by a few
"" droby> years, and it does predate Perl4.
"" 
"" How do you figure?  Mosaic, the first real browser that people outside
"" .ch used, wasn't version 1.0 until late 1993.  By that time, Perl4 had
"" already been long frozen, having emerged in jan 91 (based
"" predominantly on Perl3 from early 1990).  In fact, Perl5 was just
"" starting to come on the scene in early-mid 94, around the time of the
"" NCSA "what's new" page that listed *all* new websites... about 2-5 a
"" day in that period. :)
"" 
"" Two years ago, I told people "Perl is twice as old as the web", and it
"" was accurate.  Now we're down to only "a few years older than the
"" web", which is still a lifetime in the computer industry.


The ideas of a world wide web go back as far back as 1945. The concept
of the current WWW was born in 1989, the year of perl3. Code was 
available in the beginning of 1990, still the perl3 era.

Perl5 hit the streets on Oct 18, 1994. That's after Netscape released
its first betas. Netscape 1.0 was available before perl 5.001.

Now, I don't know about Mosaic 1.0. But the timestamps on the files
of the XMosaic 1.2 distribution are all from early 1993, which suggest
that Mosaic 1.0 dates from 1992.

"Twice as old as the web", sure, in 1991. Now it's "2 years older as
the web, and not half as popular".



Abigail
-- 
perl -wlne '}for($.){print' file  # Count the number of lines.


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

Date: Thu, 25 Feb 1999 20:37:48 GMT
From: Don Roby <droby@copyright.com>
To: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: "Learning Perl"
Message-Id: <7b4car$h49$1@nnrp1.dejanews.com>

[mailed and posted]

In article <m13e3u1hli.fsf@halfdome.holdit.com>,
  merlyn@stonehenge.com (Randal L. Schwartz) wrote:
> >>>>> "droby" == droby  <droby@copyright.com> writes:
>
> droby> How wide?  WWW is indeed younger than Perl, but only by a few
> droby> years, and it does predate Perl4.
>
> How do you figure?  Mosaic, the first real browser that people outside
> .ch used, wasn't version 1.0 until late 1993.  By that time, Perl4 had
> already been long frozen, having emerged in jan 91 (based
> predominantly on Perl3 from early 1990).  In fact, Perl5 was just
> starting to come on the scene in early-mid 94, around the time of the
> NCSA "what's new" page that listed *all* new websites... about 2-5 a
> day in that period. :)
>

I guess I was counting from the beginning of CERN's stuff in 1990 and that
might be a bit early.

But there were actually people outside Switzerland using it pretty early on.
Just not outside the high-energy physics crowd.  I had friends in that crowd,
and they got it in 1991.  The graphical browser ran only on NeXT, but it was
started, and not only in CERN.

So I was aware of the web early in its evolution, and don't think of it as
beginning with NCSA Mosaic, as I actually saw it in 1991.

> Two years ago, I told people "Perl is twice as old as the web", and it
> was accurate.  Now we're down to only "a few years older than the
> web", which is still a lifetime in the computer industry.
>

It was approximate, and the degree of correctness depends heavily on where you
put the birthdate of both.

In my book (as just revised to the HEP release), Perl is about 12 and the web
is about 8.  Both have evolved quite a bit from their origins.

In your book (apparently), Perl is 12 and the web is 7.  We don't disagree
radically.

Alot depends on the definition of birth.  If we measured from conception, we'd
have to ask Larry and Tim.  ;-)

--
Don Roby

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 25 Feb 1999 13:28:43 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: "Learning Perl"
Message-Id: <36D5C08B.F309C3FB@vpservices.com>

Randal L. Schwartz wrote:

> How do you figure?  Mosaic, the first real browser that people outside
> .ch used, wasn't version 1.0 until late 1993.  

Well, I guess it depends what you mean by a real browser, but lynx, the
gopher-www kludge, the NJIT browser, and a number of others were in use
outside of .ch in 1992.  By early 1993, I and many others had websites
running. I believe there were about 1,000 of them then, before Mosaic
was popularly available (tho it and other earlier graphics browsers were
availble in X-windows before then).  If you exclude non-graphics
versions of browsers, maybe you should also exclude versions of perl
before Tk :-)

But, then again, I also used perl before I used the web and my guess is
that many of those early websites and gopher/webs were done by japhs.

-- 
     Jeff Zucker          Co-coordinator, UNICEF Voices of Youth
         \/                           http://www.unicef.org/voy/
        -<>-           
         /\                 CTO, Virtual Production Services LLC
 jeff@vpservices.com             http://www.vpservices.com/jeff/


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

Date: Thu, 25 Feb 1999 17:55:13 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: "Learning Perl"
Message-Id: <comdog-ya02408000R2502991755130001@news.panix.com>

In article <7b4car$h49$1@nnrp1.dejanews.com>, Don Roby <droby@copyright.com> posted:

> In article <m13e3u1hli.fsf@halfdome.holdit.com>,
>   merlyn@stonehenge.com (Randal L. Schwartz) wrote:
> > >>>>> "droby" == droby  <droby@copyright.com> writes:
> >
> > droby> How wide?  WWW is indeed younger than Perl, but only by a few
> > droby> years, and it does predate Perl4.
> >
> > How do you figure?  Mosaic, the first real browser that people outside
> > .ch used, wasn't version 1.0 until late 1993.  By that time, Perl4 had
> > already been long frozen, having emerged in jan 91 (based
> > predominantly on Perl3 from early 1990).  In fact, Perl5 was just
> > starting to come on the scene in early-mid 94, around the time of the
> > NCSA "what's new" page that listed *all* new websites... about 2-5 a
> > day in that period. :)

> I guess I was counting from the beginning of CERN's stuff in 1990 and that
> might be a bit early.

even if you count the Web beginning in 1989, Perl is still older than
the web.  i even have a picture of Randal singing happy tenth birthday to
Larry's answering machine, and that was in 1998!

<URL:http://www.brian-d-foy.com/happy_bday_perl.html>

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: Fri, 26 Feb 1999 12:22:32 GMT
From: Don Roby <droby@copyright.com>
Subject: Re: "Learning Perl"
Message-Id: <7b63m2$fj$1@nnrp1.dejanews.com>

In article <comdog-ya02408000R2502991755130001@news.panix.com>,
  comdog@computerdog.com (brian d foy) wrote:
>
> even if you count the Web beginning in 1989, Perl is still older than
> the web.  i even have a picture of Randal singing happy tenth birthday to
> Larry's answering machine, and that was in 1998!
>

Indeed.  I certainly didn't claim that Perl was younger than the web, just
that it wasn't quite so much older as was being stated.

So when do we call Tim Berners-Lee's answering machine?

--
Don Roby

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 24 Feb 1999 07:49:02 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: '&&' '||' vs 'and' 'or' (Was: Re: map + grep replacement for this foreach)
Message-Id: <MPG.113dbf4959b4c067989682@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7b13rc$neu$1@camel18.mindspring.com>, on Wed, 24 Feb 1999 
10:01:08 -0500 Allan@due.net says...
 ...
> I am curious as to the what others think about using "and" to execute two
> bits of code and ignoring the evalution.  Is this considered using "and" in
> a void context?  Is this generally concered good/poor programming style?

I like to use 'and' and 'or' to signify conditional change in flow of 
control (the result of the expression is typically discarded), compared 
to '&&' and '||' to signify logical conjunction or disjunction  (the 
result of the expression is then tested or assigned).  The relative 
precedences enhance the clarity of these locutions.

$Live_long and prosper();

$Eat && $well or die;

-- 
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 23 Feb 1999 00:59:54 +0000
From: Michael Ryan <mikeryan@acm.org>
Subject: 'x' operator to pre-extend a string
Message-Id: <36D1FD81.38ABEC27@acm.org>

camel book, 2d ed., page 541:
"Pre-extending a string with the x operator ..."
which got me thinking because i couldn't find an example except the $^M
allocation.

is the proper syntax pre-extending something like:

$s = 'a' x ( 1 << 16 )
$s = ""  # $s is still large
$s = "first element" . "second element"
print $s  # which should print "first elementsecond element"

is it better to tr/a//d the string to clear it?

is the recipe completely different?

thank you
//michael

--
:: michael ryan, mikeryan@acm.org
:: cell: 650 245 4812
:: e-page: 6502454812@paging.cellone-sf.com
::




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

Date: Sun, 21 Feb 1999 18:47:09 -0500
From: "Dani Koesterich" <Webmaster@Freeness.net>
Subject: ****Cookies!!!!!!!!!!!!!!!*******
Message-Id: <7aq73a$pjq$1@oak.prod.itd.earthlink.net>

Can someone explain cookies to me?
All I need to know is how to take information from the QUERY_STRING, and
store it in a cookie, then be able to retreive it.  How do I do all of the
above in CGI?

Dani Koesterich





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

Date: Mon, 22 Feb 1999 11:47:58 -0500
From: "J. Parsons" <gsx97@usa.net>
Subject: Re: ****Cookies!!!!!!!!!!!!!!!*******
Message-Id: <7as1oh$o3r@news1.snet.net>

Cookies are a sweet snack that date back far longer than computers. Cookies
should be taken in carefully, as they are full of calories. Now, here's the
big problem: You only burn about 75 calories an hour sitting in front of a
computer. One cookie can contain far more calories than that.

In order to burn off these excess calories, you will need to rapidly type
keys such as the asterisk or the exclamation point. Judging by the subject
of your post, you should do fine.

Many have introduced low fat and low calorie cookies, but for the most
part -- they have not been a big hit.

There are many more issues concerning cookies such as sugar content and your
glycemic index, tooth decay, and packaging that is unsafe for the ozone.


We will address these issues at another time.



Dani Koesterich wrote in message
<7aq73a$pjq$1@oak.prod.itd.earthlink.net>...
>Can someone explain cookies to me?
>All I need to know is how to take information from the QUERY_STRING, and
>store it in a cookie, then be able to retreive it.  How do I do all of the
>above in CGI?
>
>Dani Koesterich
>
>
>




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

Date: 22 Feb 1999 04:16:41 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: ****Cookies!!!!!!!!!!!!!!!*******
Message-Id: <slrn7d1mm2.cki.fl_aggie@enso.coaps.fsu.edu>

On Sun, 21 Feb 1999 18:47:09 -0500, Dani Koesterich
<Webmaster@Freeness.net> wrote:

+ Can someone explain cookies to me?

Its amazing what you can find in your cookies file:

<url:http://www.netscape.com/newsref/std/cookie_spec.html>

+ All I need to know is how to take information from the QUERY_STRING, and
+ store it in a cookie, then be able to retreive it.  How do I do all of the
+ above in CGI?

You may even want to take a gander at the CGI.pm instructions...

James


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

Date: Sun, 21 Feb 1999 19:43:40 -0800
From: see@my.sig (Don Groves)
Subject: Re: ****Cookies!!!!!!!!!!!!!!!*******
Message-Id: <MPG.113a724b9cb2508c98977b@news.europa.com>

In article <7aq73a$pjq$1@oak.prod.itd.earthlink.net>, 
Webmaster@Freeness.net spoke thusly:
> Can someone explain cookies to me?
> All I need to know is how to take information from the QUERY_STRING, and
> store it in a cookie, then be able to retreive it.  How do I do all of the
> above in CGI?
> 
> Dani Koesterich

I'm no Perl expert, Dani, but I've lurked here long enough to be able to 
help you with a couple of things: (1) A cutesy subject line like yours is 
the number one way to guarantee that you will *not* receive a polite, 
helpful response from this group, and (2) asking a CGI question here is 
the number two way.  Try comp.infosystems.www.authoring.cgi
-- 
Don Groves (groves_acm_org)
Replace underscores to get my email address


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

Date: Wed, 24 Feb 1999 16:16:58 -0500
From: Asim Suter <asim@cse.buffalo.edu>
Subject: .nexrc and vi
Message-Id: <Pine.GSO.3.96.990224161408.3385A-100000@pollux.cse.Buffalo.EDU>


Can anybody provide me a representative ~/.nexrc file
for use by vi editor ( which is supposedly to be used
for better Perl editing)

Asim



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

Date: 24 Feb 1999 14:53:47 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: .nexrc and vi
Message-Id: <36d474eb@csnews>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Asim Suter <asim@cse.buffalo.edu> writes:
:Can anybody provide me a representative ~/.nexrc file
:for use by vi editor ( which is supposedly to be used
:for better Perl editing)

set exrc
"map = :s/$/ $/$r 74|F s
$xx0
"set number
set ruler
set notimeout
"
set sections=bpAfSeAhBhChRSRERh
set paragraph=PsPeXXFSFELsLeLiFEFSILIpplpipspBhChPLPPPQPP\ 
set extended showmode
"	for better regexps
"
set altwerase
set filec=\	
set cedit=\	
"
set terse
"	because we prefer terse error messages,
set writeany autowrite
"	because we want to write out our file whenever we can,
"	like on a :tag, :stop, or :next
set tabstop=8 
"	so tabs look right for us 
set shiftwidth=4
"	so ^T and << are smaller 
set report=1
"	so we our told whenever we affect more than 1 line 
"set nomesg
"	because being talked to during an edit is aggravating
set autoindent
"	so i don't have to tab in 
set redraw 
"
set tildeop
"optimize
"	keep the screen tidy
"
"
"	INPUT MACROS that i always want active
"
map!  :stop
"	so i can stop in input mode.  note that autowrite is set, so 
"map!  :stop!
"	will stop me without writing.
"	commented out cause causes bug 
"
map!  O
"	lets me do kindof a negative carriage return in input mode.
map!  bi
"	non-destructive ^W
map!  Ea
"	and its inverse
"
"	ARROW MACROS next four let arrows keys work in insert mode; 
map! OA ka
map! OB ja
map! OC lli
map! OD i
"
" 	Who says you can't emulate emacs in vi? :-)
"
map!  i
map!  lli
map!  I
map!  A
"
"
"	EXCHANGE MACROS -- for exchanging things
"
map v xp
"	exchange current char with next one in edit mode
map V :m+1
"	exchange current line with next one in edit mode
map!  hxpa
"	exchange last typed char with penultimate one in insert mode
map = {\p
"	edit previously editted file
"
"
"
"	other macros
"
"map  :w
"	write out the file
"
map * i
"	split line
"
map g G
"	because it's easier to type
"
"map  :stop!
"	unconditional stop
map ' `
"	so we return to exact position, not just ^ on 'a or ''
map Y y$
"	so Y is analagous to C and D
map  ddu
"	single-line redraw
map  :n +/
"	go to next file in arg list, same position 
"	useful for "vi +/string file1 file2 file3"
"
"
"	META MACROS, all begin with meta-key '\' ; more later in file
"
map 	 \
"	so can use both ^I and \ for meta-key
"
map \/ d$Po/\<pA\>"wdd@w
"	find current word, uses w buffer
"
map \C ok:co.:s/./ /g
o80a :-1s;^;:s/;
:s;$;//;
"mdd@m:s/\(.\)./\1/g
:s;^;:-1s/^/;
"mdd@mjdd
"	center text.  there's a better way, but i lost the short version.
"
"	INVERT CASE ON WORDS -- V is like W, v is like w.  3V is fine, but only to EOL.
"	uses both register n and mark n.
map \v ywmnoP:s/./\~/g0"nDdd`n@n
"	abc -> ABC    ABC->abc
map \V yWmnoP:s/./\~/g0"nDdd`n@n
"	abc.xyz -> ABC.XYZ    ABC.XYZ->abc.xyz
"
"
"	EXECUTION MACROS --	these two are for executing existing lines.  
"
map \@ "mdd@m
"	xqt line as a straight vi command (buffer m, use @@ to repeat)
map \! 0i:r!"ndd@n
"	xqt line as :r! command (buffer n, use @@ to repeat)
"
map \t :r!cat /dev/tty
"	read in stuff from X put buffer
"	
"	c-hacking exrc source, useful on c programs et al, but not text
"
"set tags=tags\ /mnt/tchrist/tmptags\ /usr/lib/tags
"	/tmp/tags is so can make tmp tag file of r/o src dirs
"	by "set d = $cwd;cd;ctags -twd $d/*.[ch];mv tags tmptags;cd $d'
"
"
"	BLOCK MACROS -- these help when dealing with C blocks
"
"	this will begin a block, leaving in insert mode
map!  /}a
"	and this  will take you past its end, leaving in insert mode
"
" 	this will shift the body of a block but not its outer part
map \S >%<<%<<
"
"
"	LINT MACRO.  deletes all text from "lint output:" and below, (if any)
"	replacing it with lint output in pretty block comment form.  could
"	do sed work myself, but this is faster.  
"
"	the map! is for subsequent map, not by people, 
"	tho /^Lo would make sense.
"	this is one of those famous time/space tradeoffs 
"
map! o __END__ ###
map \l Goo

/o
jdG:w
/o
:r!perl -wc %|& splain
?
jme
map \e yypk:.s/.* line ([0-9]+).*/me\1Gk/
"mdd@m
"
"	indent this for me
"
map \i :%!indent -i4
"
"	COMMENTING MACROS -- these are actually pretty amazing
"
"	from edit mode, this comments a line
"map  ^i/* A */^
"
"	and this undoes it
"map  :s/\/\* \([^*]*\) \*\//\1
"
"	this next one defeats vi's tail-recursion defeatism
"	called by 2 maps following this one 
"map!  :unmap! 
"
"	while in insert mode, this will put you "inside" a comment
"map!  :map!  aoa /*  */hhi
"
"	while in edit mode, this begins a block comment -- ^N to escape
"map \c	O/* *  
*/k:map! 
 
*  
A
"
"	and this is for adding more lines to a block comment -- ^N to escape
"map \o	:map!  
*  
A
"
"
"	this stuff (probably) only works with UW vi.  commented out.
"
"set tagstack
"	so we can :tag and :pop deeper than 1 level
"set filestack
"	so we can tag lookup on files and pop off
"set path=/mnt/tchrist
"	so we can say "vi foo" or ":n foo" and look all those places
"	if the file is relative and not in .
"set ?S1200:window=8
"	if (speed==1200) set window=8
"	cause the default is too much.
"set ?Tcitc:fastfg
"	if (term==citc) set fastfg
"	
"	c-hacking exrc source that only works with UW vi
"
"set tagprefix
"	allows abbreviated tags.  better than std taglength
"
"
" 	things i want active when editing text not programs
"	
"set ignorecase
"
"	cause this is test
set wraplen=75
"set wrapmargin=5
"	this sets autowrap 5 from right margin
"
"
map _ i_ll
"	this character will now be underlined when less'd, rn'd, etc.
"
"	SPELL MACROS
"
map \s :wgo:$r!spell %
"	spell the file, placing errors at bottom, use \w to find
map \n Gdd\/
"	for find next spelling error
"
"
"	FORMATING MACROS
"
map \P :.,$!fmt -75
"	format thru end of document
map \p !}fmt -75
"	format paragraph
map \f 1G/---j:.,$!fmt -75
"	format message
"
map \r 1G/^-/:r!snipquote $editalt /^-/jma
"	read in @, quoted (for MH replies, who link @ to current file)
map \d :s/$/ $/$r 74|? 
s
$xx0
"
"
map!  {} O
"
"

" for when terminals have the damn escape key in the wrong place
map! ` 
abbr interphase interface
abbr wtih with
abbr tihs this
-- 
"C is not a big language, and it's not well served by a big book." (Brian W.
Kernighan and Dennis M. Ritchie, in "The C programming Language", Prentice
Hall 1988)


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

Date: Mon, 22 Feb 1999 22:45:39 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: /i in regexp kills performance.
Message-Id: <36d8ceb9.2566370@news.skynet.be>

Zack wrote:

>I noticed this in doing some search timing.
>
>Iterating through a file, looking for matches.....20,000 entries:
>
>	### Takes over 19 seconds to complete
>	if ($LINE =~ /(test)/i) { print "Match\n"; }
>
>	### Takes only 3 seconds to complete.
>	if ($LINE =~ /(test)/) { print "Match\n"; }
>
>WOW.  Is this a bug in perl?

WOW indeed.

I would expect

	/(test)/i

to be comparable to:

	/([tT)[eE][sS][tT])/

Can you benchmark that with your original data?


I've done a preliminary test, and this is what I got:

open(FILE,'WIN31API.TXT') or die "Can't open file $file: $!\n";
timethese(10, {
  plain  => sub { seek FILE,0,0; 
	while(<FILE>) { print if /SendMessage/ }} ,
  ignoreCase  => sub { seek FILE,0,0; 
	while(<FILE>) { print if /SendMessage/i }} ,
  charClassed => sub { seek FILE,0,0; 	while(<FILE>) { print if
/[sS][eE][nN][dD][mM][eE][sS][sS][aA][gG][gG][eE]/ }} ,
});

     charClassed:  9 secs ( 9.73 usr  0.00 sys =  9.73 cpu)
     ignoreCase: 13 secs (13.57 usr  0.00 sys = 13.57 cpu)
     plain:  5 secs ( 4.73 usr  0.00 sys =  4.73 cpu)


Well... In my case, it's only a 3/1 ratio, but my alternative falls
exactly in the middle between them. It looks like I've done a better job
(at least speedwise) than how //i currently is implemented...	     ;-)

I haven't got a clue about the memory requirements.

	Bart.


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4957
**************************************

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