[13945] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1355 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 12 00:05:33 1999

Date: Thu, 11 Nov 1999 21:05:16 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942383116-v9-i1355@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 11 Nov 1999     Volume: 9 Number: 1355

Today's topics:
    Re: A Big Thanks... (Kragen Sitaker)
        Aack Auto-Responder... <genpenn@hotmail.com>
    Re: Aack Auto-Responder... (Kragen Sitaker)
    Re: Can Perl Modules help me? <randys@NOSPAMamigo.net>
    Re: Connect msql database using perl <randys@NOSPAMamigo.net>
    Re: CSV Parsing Revisited (long - 98 lines) (Abigail)
    Re: CSV Parsing Revisited (long - 98 lines) <jeff@vpservices.com>
    Re: Filehandle Question (Sam Holden)
    Re: Filehandle Question (Sam Holden)
    Re: Filehandle Question (Sam Holden)
    Re: freeing memory <lr@hpl.hp.com>
    Re: freeing memory (Kragen Sitaker)
    Re: freeing memory (Tad McClellan)
        function: full(\*FILEHANDLE) <jeffp@crusoe.net>
    Re: function: full(\*FILEHANDLE) (Eric Bohlman)
    Re: Generating pi (Abigail)
        GURU HELP NEEDED FOR NEWBIE (Kragen Sitaker)
    Re: Help needed fast please <randys@NOSPAMamigo.net>
    Re: help with hash?  (Abigail)
    Re: Help with Stoopid Nutscrape (Netscape) (Abigail)
    Re: Help with Stoopid Nutscrape (Netscape) (Abigail)
    Re: How to encrypt a web log-in, and work w/accounts in (Nick S.)
    Re: How to encrypt a web log-in, and work w/accounts in (Sam Holden)
        How to use stat () ? <Achin@inprise.com>
    Re: How to use stat () ? (Sam Holden)
    Re: Need Help with Named Pipes Please (Kragen Sitaker)
    Re: OO question again <jtolley@bellatlantic.net>
    Re: output a binary file to browser from perl script (Kragen Sitaker)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 12 Nov 1999 04:34:46 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: A Big Thanks...
Message-Id: <GNMW3.442$YI2.14778@typ11.nn.bcandid.com>

In article <382B6731.774ACA05@globalexpos.co.nz>,
Andrew Broadley  <expoinfo@globalexpos.co.nz> wrote:
>Id just like to say its damn great the fact that people from around the
>world are able to help out others like this all the time..
>
>Great job people..
>
>I wish there was a way to thank you all :o)

- post on appropriate newsgroups;
- help by answering questions, but only those you can answer correctly;
- reduce the size of your .signature by a factor of seven
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Thu, 11 Nov 1999 23:09:21 -0500
From: "Joe Dalton" <genpenn@hotmail.com>
Subject: Aack Auto-Responder...
Message-Id: <3tMW3.303$ZU3.19733@wagner.videotron.net>

i'm looking for a perl script called Aack Auto-Responder... can anyone
help??

i would be also interested in any information on a perl script that can
handle incoming mails (using a .forward file) and do things like auto
respond to mails that have a specific subject.. or things like that...


Werden






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

Date: Fri, 12 Nov 1999 04:40:30 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Aack Auto-Responder...
Message-Id: <2TMW3.461$YI2.26152@typ11.nn.bcandid.com>

In article <3tMW3.303$ZU3.19733@wagner.videotron.net>,
Joe Dalton <genpenn@hotmail.com> wrote:
>i'm looking for a perl script called Aack Auto-Responder... can anyone
>help??

No.  Please don't post here unless you have a question (or an answer)
about programming in Perl.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Thu, 11 Nov 1999 20:38:12 -0700
From: "Randy Smith" <randys@NOSPAMamigo.net>
Subject: Re: Can Perl Modules help me?
Message-Id: <382b3874@news.amigo.net>

Peter <peterclones@yahoo.com> wrote in message
news:HTCW3.257$zG1.12024@news1.mts.net...
: I've made a web chatroom using Perl cgi and it works fine, but it gets
: sluggish as more people enter the room of course.  The script I have
writes
: messages to a common text file, then is read by all the users every few
: seconds.  I don't know anything about modules, so I'm wondering if there's
: someway modules could speed up this process?  If so, which ones should I
be
: looking at and how can I get help implementing them.  Just need to be
: pointed in the right direction.
You should look at CGI.pm to do the cgi stuff but I'm not sure how much it
will help (if it helps at all). If your chat is seeing lots of traffic, you
might want to consider using a client/server system (with the server written
in some compiled language like C or C++). Perl is good at a lot of things
but, in most cases, speed is not one of them.

Randy




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

Date: Thu, 11 Nov 1999 19:20:05 -0700
From: "Randy Smith" <randys@NOSPAMamigo.net>
Subject: Re: Connect msql database using perl
Message-Id: <382b2627@news.amigo.net>

First, you need DBI and DBD::msql. Check the msql site for where to get
these. (DBI is on the CPAN.) Then run 'perldoc DBI' to see how to use DBI.

Randy

Ong <news@my-net.com> wrote in message news:80ans0$8r2$1@news5.jaring.my...
: I am currently involve in web database development. The database that I am
: going to use is msql. Can u guys tell me how to connect to this database
: using perl? What are the important statement that are needed before
: extracting the data from the database using sql? Example for Win32:ODBC,
the
: starting statement required are as below:
:
: use Win32::ODBC;
: $db = new Win32::ODBC("My-Net");
: $db->Sql($sql);
:
: Kindly guide. Thank you.
:
:




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

Date: 11 Nov 1999 20:36:18 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: CSV Parsing Revisited (long - 98 lines)
Message-Id: <slrn82mveu.lmh.abigail@alexandra.delanet.com>

Ken Bandes (kbandes@home.com) wrote on MMCCLXIII September MCMXCIII in
<URL:news:8E7B748A7kbandeshomecom@192.168.123.1>:
`` 
`` - CSV has exactly four special characters: quote (\x22), comma (\x2C), 
``   carriage return (\x0D), and linefeed (\x0A).
`` - A record is a sequence of fields separated by commas.  A record is 
``   terminated with a linefeed, or a carriage-return/linefeed pair.  A
``   CSV file is a sequence of records.
`` 
``     while($csv =~ 
``       /
``       (?:"             # quoted field
``        ((?:[^"]*"")*     # non-quotes followed by 2 quotes    
``        [^"]*)"           # non-quotes followed by quote
``       |([^",\r\n]*))   # or non-quoted field
``       (,|\r?\n)        # followed by comma or end of line
``       /xg)

If the standard says \x0A, your regex should use \x0A, as \n doesn't
mean \x0A everywhere.



Abigail
-- 
tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
sub A::TIESCALAR {bless \my $A => A} #  Yet Another silly JAPH by Abigail
sub A::FETCH     {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 12 Nov 1999 01:51:48 GMT
From: Jeff Zucker <jeff@vpservices.com>
To: Ken Bandes <kbandes@home.com>
Subject: Re: CSV Parsing Revisited (long - 98 lines)
Message-Id: <382B726D.BD8C5B5C@vpservices.com>

Ken Bandes wrote:

> But using Text::CSV_XS
> directly, it does not appear to work using the getline method,
> which takes an io handle. 

Hmm, sorry to correct you twice in one day, but that behavior only
occurs if you call Text::CSV_XS->new() with the default values.  It will
correctly parse embedded newlines if you call it like this: 

	my $csv = Text::CSV_XS->new({binary=>1});

From the Text::CSV_XS pod:

# Name:    getline (Instance method)
# ...
#             Note that it may happen that multiple lines are read,
#             if the fields contain line feeds and we are in binary
#             mode. For example, MS Excel creates such files!
# ...
# =item binary
#
# If this attribute is TRUE, you may use binary characters in quoted
fields,
# including line feeds, carriage returns ... By default this feature is
off.

This works with both Text::CSV_XS->parse() and Text::CSV_XS->getline()
and correctly puts the embedded newline in the fields whether they come
from a string in the script or a string in a file.

Text_CSV, however, does not have this feature and does not correctly
handle the newlines.

-- 
Jeff


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

Date: 12 Nov 1999 02:29:53 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Filehandle Question
Message-Id: <slrn82mutb.3gg.sholden@pgrad.cs.usyd.edu.au>

On Fri, 12 Nov 1999 01:31:14 GMT, Thunderdust (TomH) <beans@bedford.net> wrote:
>
>What's a "filehandle variable"? 
>
>Try this, is the filehandle variable STDOUT, or $s?
>
>#################### 
>print STDOUT "Hello ";
>
>$s = "STDOUT";
>print $s "World\n";
>##################3

STDOUT is the filehandle variable.
$s is a symbolic reference. 

Do you think that $s is a sub in this code as well?:

sub foo {print "Hello\n";}
$s = 'foo';
$foo();

use strict and you won't go down such evil paths.

Filehandles not having a symbol out the front means you can get them mixed
up with directory handles as in:

open(A,'>/tmp/test') || die "something is wrong: $!";
opendir(A, '/etc') || die "I hope this isn't a unix...: $!";
print A readdir A;
closedir A;
close A;

But that's the way it is...

-- 
Sam

Just don't create a file called -rf.  :-)
	--Larry Wall


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

Date: 12 Nov 1999 02:35:31 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Filehandle Question
Message-Id: <slrn82mv7u.3gg.sholden@pgrad.cs.usyd.edu.au>

On 12 Nov 1999 02:29:53 GMT, Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
>
>sub foo {print "Hello\n";}
>$s = 'foo';
>$foo();

Damn I tested it, and then forget to cut and paste the changes back...
oh well... making an idiot of myself in clpm is something I have a 
compulstion to do at least weekly it would appear...

-- 
Sam

why can't newbies use hash slices in their hello world programs? :-)
	-- Uri Guttman in <x74skxhve5.fsf@home.sysarch.com>


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

Date: 12 Nov 1999 02:36:56 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Filehandle Question
Message-Id: <slrn82mvaj.3m4.sholden@pgrad.cs.usyd.edu.au>

On 12 Nov 1999 02:35:31 GMT, Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
>On 12 Nov 1999 02:29:53 GMT, Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
>>
>>sub foo {print "Hello\n";}
>>$s = 'foo';
>>$foo();
>
>Damn I tested it, and then forget to cut and paste the changes back...
>oh well... making an idiot of myself in clpm is something I have a 
>compulstion to do at least weekly it would appear...

Damn I then forgot to post the correction... Must be trying to up the
idiot average...

$s()

-- 
Sam

It has been discovered that C++ provides a remarkable facility for
concealing the trival details of a program--such as where its bugs are.
	--David Keppel


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

Date: Thu, 11 Nov 1999 18:37:08 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: freeing memory
Message-Id: <MPG.12951d2fc60a1d0198a1e3@nntp.hpl.hp.com>

In article <80fivu$jlq$1@nnrp1.deja.com> on Thu, 11 Nov 1999 23:20:34 
GMT, timfi@my-deja.com <timfi@my-deja.com> says...
> In article <MPG.1294c15522e557a298a1df@nntp.hpl.hp.com>,
>   Larry Rosler <lr@hpl.hp.com> wrote:
> > In article <80f4an$820$1@nnrp1.deja.com> on Thu, 11 Nov 1999 19:10:24
> > GMT, timfi@my-deja.com <timfi@my-deja.com> says...
> > > What is the best way to free memory for a complex data structure,
> > > i.e. hash of hashes of hashes?

 ...

> >     %hash = ();
> >
> > Alternatively,
> >
> >     undef %hash;
> >
> > But that is slightly misleading, as the hash is still defined, though
> > empty.
> >
> > --

Why does your newsreader strip the trailing blank on the sigdash "\n-- 
\n", and then quote the signature>  You should strip it out yourself.

> Is this also true for references to hashes of hashes?  For instance,
> say I have the following structure:
> 
>   $hashref = {
>        name => "Tom",
>        birthdate => \%birthdate };
> 
> Then would this work?  undef %{$hashref};

Why not?  A hash is a hash is a hash.

The reason clearing a top-level hash gets rid of all the memory used by 
interior data structures is that when the only reference to memory (such 
as an anonymous hash) goes away, the memory is reclaimed for future use.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 12 Nov 1999 03:34:54 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: freeing memory
Message-Id: <yVLW3.250$YI2.12824@typ11.nn.bcandid.com>

In article <80fivu$jlq$1@nnrp1.deja.com>,  <timfi@my-deja.com> wrote:
>Is this also true for references to hashes of hashes?  For instance,
>say I have the following structure:
>
>  $hashref = {
>       name => "Tom",
>       birthdate => \%birthdate };
>
>Then would this work?  undef %{$hashref};

In Perl, things get automatically freed when they are no longer
referenced.  So if %birthdate is no longer referenced (e.g. by being
attached to the symbol %birthdate) then undeffing the %$hashref will
free it.  On the other hand, if %birthdate is still in scope, it won't
be freed until it goes out of scope.


-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Thu, 11 Nov 1999 15:47:12 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: freeing memory
Message-Id: <slrn82maqg.va5.tadmc@magna.metronet.com>

On Thu, 11 Nov 1999 19:10:24 GMT, timfi@my-deja.com <timfi@my-deja.com> wrote:

>What is the best way to free memory for a complex data structure, i.e.
>hash of hashes of hashes?


   %hash = ();   # and let garbage collection do its job


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


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

Date: Thu, 11 Nov 1999 22:32:34 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: function: full(\*FILEHANDLE)
Message-Id: <Pine.GSO.4.10.9911112229280.19132-100000@crusoe.crusoe.net>

Below is a function that returns the closest full line to your current
position in a file.  As a side-effect, it does change your position in the
file.

sub full (*) {
    local *FH = shift;
    return scalar <FH> if tell(FH) == 0;
    seek FH, -length($/), 1;
    <FH>;
    return if eof(FH);
    return scalar <FH>;
}

If this function is in someway broken, please let me know.  It will be
included in an article on PerlMonth about using files and filehandles.

-- 

  MIDN 4/C PINYAN, USNR, NROTCURPI     http://www.pobox.com/~japhy/
  jeff pinyan: japhy@pobox.com     perl stuff: japhy+perl@pobox.com
  "The Art of Perl"               http://www.pobox.com/~japhy/book/      
  CPAN ID: PINYAN  http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
  PerlMonth - An Online Perl Magazine     http://www.perlmonth.com/



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

Date: 12 Nov 1999 04:16:34 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: function: full(\*FILEHANDLE)
Message-Id: <80g4b2$paa$1@nntp1.atl.mindspring.net>

Jeff Pinyan (jeffp@crusoe.net) wrote:
: Below is a function that returns the closest full line to your current
                                       ^^^^^^^
: position in a file.  As a side-effect, it does change your position in the
: file.
: 
: sub full (*) {
:     local *FH = shift;
:     return scalar <FH> if tell(FH) == 0;
:     seek FH, -length($/), 1;
:     <FH>;
:     return if eof(FH);
:     return scalar <FH>;
: }


For a rather specialized and potentially misleading definition of
"closest."  It would be better to describe it as the "next full line
following your current file position." 




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

Date: 11 Nov 1999 21:02:10 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Generating pi
Message-Id: <slrn82n103.lmh.abigail@alexandra.delanet.com>

revjack (revjack@radix.net) wrote on MMCCLXIV September MCMXCIII in
<URL:news:80flkp$p4p$1@news1.Radix.Net>:
;; Anybody ever tool up an algorithm in perl to generate the
;; digits of pi? I've been searching the web for an hour and no
;; dice. Don't see a Math::Pi on CPAN either. Hm.


This will do 400000000 digits.

    use Net::FTP;

    my $ftp = Net::FTP -> new ('ftp.hepl.phys.nagoya-u.ac.jp');
    $ftp -> login (ftp => 'revjack@radix.net') or die;
    $ftp -> cwd ('/pub/data') or die;
    foreach my $i ('01' .. '40') {
        $ftp -> get ("pi$i.dat.gz", "/tmp/pi$i.dat.gz");
        system gunzip => "/tmp/pi$i.dat.gz";
    }
    $ftp -> quit;

    print "3.";
    system "cat /tmp/pi??.dat.gz";
    
    __END__


Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 12 Nov 1999 04:15:39 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: GURU HELP NEEDED FOR NEWBIE
Message-Id: <LvMW3.399$YI2.17761@typ11.nn.bcandid.com>

My PERL script doesn't work.  What's wrong?
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Thu, 11 Nov 1999 20:30:00 -0700
From: "Randy Smith" <randys@NOSPAMamigo.net>
Subject: Re: Help needed fast please
Message-Id: <382b368b@news.amigo.net>


Chris <chris@chrismail.connectfree.co.uk> wrote in message
news:382a87d4.0@news2.cluster1.telinco.net...
: I have made some changes to the help I was last given like putting html in
: and it dosen't work plus the other file hasn't been helped with the files
: are below ( I have maked my changes) HELP ME PLEASE!!
:
: sign_up.pl ----
: #########################
:
: #!/usr/bin/perl -wT
:
: use strict;
: use CGI qw(:standard);
: use Fcntl qw(:flock);
:
: $ENV{qw(PATH IFS)} = '' x 2;
Did you forget a " in this line?

Randy

<snip Lots of code>




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

Date: 11 Nov 1999 21:48:10 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: help with hash? 
Message-Id: <slrn82n3iu.lmh.abigail@alexandra.delanet.com>

Tim Condit (timc@ans.net) wrote on MMCCLXIII September MCMXCIII in
<URL:news:Pine.GSO.3.95.991111192115.20546G-100000@arsenic.aa.ans.net>:
?? 
?? Hello, 
?? 
?? I've got a problem with this script, and would appreciate some help. What
?? I want it to do is allow the user to input a query, and a variable number
?? of answers. I've been through both Learning Perl and Programming Perl, but
?? really don't understand how to do this. For a single instance of the hash,
?? ie: one key, I get the behavior I expect. Adding another hash element
?? doesn't work quite as well.
?? 
?? Here's a trimmed down version:
?? 
?? #!/usr/local/bin/perl -w
?? 
?? $version = 'hashOfArrays.01';
?? $datafile = "/timc/data/$version";
?? 
?? print "New entry? ";
?? chomp ($new = <STDIN>);
?? 
?? dbmopen(%ASCEND, "$datafile", 0644) or die \
??     "Couldn't open $version: $!\n";
?? 
?? while ($new eq "y") {
??     
??     print "Please enter query: ";
??     chomp ($query = <STDIN>);
??     
??     $continue = "y";
??     while ($continue eq "y") {
??         print "Please enter answer: ";
??         chomp ($answer = <STDIN>);
??         
??         $ASCEND{$query} = push (@answer, $answer);
??         print "Continue? ";
??         chomp ($continue = <STDIN>);
??     }
??     
??     print "Another new? ";
??     chomp ($new = <STDIN>);
?? }
?? 
?? print "Query: \n\t", keys %ASCEND, "\n";
?? print "Answer(s): \n";
?? for ($i = 0; $i <= $#answer; $i++) {
??     print "\t$answer[$i]\n";
?? }
?? 
?? dbmclose(%ASCEND);
?? 
?? 
?? 
?? And here's some output:
?? 
?? arsenic:~/play/db> ./hashOfArrays.01
?? New entry? y

   [Snip]

?? Query: 
??         drinkingdriving
?? Answer(s): 
??         kool-aid
??         orange juice
??         mountain dew
??         honda
??         ford
??         chevy
?? 
?? Drinking and driving don't mix! How can I sort this out, so I have two
?? discrete hashes? 


Well, why would you need 2 distinct hashes? All you are doing is
keeping the number of answers in each category in a hash. After
your session, the hash will have two entries:
     drinking => 3,
     driving  => 3

It's printing out both keys, it's printing out the list of answers.

I'm not sure what you want.



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


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 11 Nov 1999 21:57:03 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Help with Stoopid Nutscrape (Netscape)
Message-Id: <slrn82n45r.lmh.abigail@alexandra.delanet.com>

Andrew Broadley (expoinfo@globalexpos.co.nz) wrote on MMCCLXIII September
MCMXCIII in <URL:news:382B3D98.C1C6B43A@globalexpos.co.nz>:
%% 
%% When i print out on my perl script... IE is fine.. but Netscape only
%% prints the HTML code... why is that ?

Not a Perl issue. 

%% --

A 28 line signature? You're a rude idiot.


Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 11 Nov 1999 22:19:22 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Help with Stoopid Nutscrape (Netscape)
Message-Id: <slrn82n5gq.lmh.abigail@alexandra.delanet.com>

Andrew Broadley (expoinfo@globalexpos.co.nz) wrote on MMCCLXIV September
MCMXCIII in <URL:news:382B624E.23C018E6@globalexpos.co.nz>:
;; 
;; --
;; E-mail me on my cellphone:
;; 
;; 0212956648@messagetracker.co.nz


Maybe we should all email him that 28 line signatures is rude...


Abigail
-- 
perl -wle '$, = " "; print grep {(1 x $_) !~ /^(11+)\1+$/} 2 .. shift'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 11 Nov 1999 20:45:05 -0800
From: nickysantoro@yahoo.com (Nick S.)
Subject: Re: How to encrypt a web log-in, and work w/accounts in Perl cgi?
Message-Id: <nickysantoro-1111992045050001@adsl-216-103-86-109.dsl.snfc21.pacbell.net>

Okay, use the htpasswd to authenticate a login...but then how do you
identify them in subsequent pages? Set a cookie if authentication passes
and then just allow access w/ this identification (most logical) ? Pass in
a string to each cgi argument that identifies them as 'joe-user'? I always
see long alphanumeric strings in the urls of sites like hotmail or my
yahoo. But they also set cookies I know. What are these two things doing? 

Thanks

In article <382AFFB9.EA9BB31C@ptc.com>, Seshadri <seshadri@ptc.com> wrote:

> On a similar prob. before, I'd used "htpasswd" in the apache/bin
directory to create
> a passwd.txt containing the username and their encrypted passwords. The
encrypted
> passwd, as far as I know, cannot be decrypted back to the original passwd. To
> authenticate, I'd used "crypt" function in perl.. you can find info.
about it at a
> number of places.
> 
> Also, I wouldn't use cookies for authentication, ever.... unless security is a
> non-issue!
> 
> Hope this helps.
> 
> - Sesh
> 
> Nick wrote:
> 
> > Hello, I was wondering how to create accounts a while ago, and while I
> > couldn't find any prewritten scripts, I figured it couldn't be too hard.
> > Basically set up a passwd file and use a cgi log in page for the login...but
> > is it essentail that this is encrypted and how would you do that with Perl?
> > Also, once the user is logged in, bascially I just want them to be
able to access
> > and change their account details, essentailly just one or two files of text.
> > Is the best way to do this is set a cookie and use that or is there some way
> > that you have a 'cookie' of sorts in every link for any of the
'actions' that
> > the user may need to do.
> > Thanks for any info.


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

Date: 12 Nov 1999 04:53:00 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: How to encrypt a web log-in, and work w/accounts in Perl cgi?
Message-Id: <slrn82n79n.5ck.sholden@pgrad.cs.usyd.edu.au>

On Thu, 11 Nov 1999 20:45:05 -0800, Nick S. <nickysantoro@yahoo.com> wrote:
>Okay, use the htpasswd to authenticate a login...but then how do you
>identify them in subsequent pages? Set a cookie if authentication passes
>and then just allow access w/ this identification (most logical) ? Pass in
>a string to each cgi argument that identifies them as 'joe-user'? I always
>see long alphanumeric strings in the urls of sites like hotmail or my
>yahoo. But they also set cookies I know. What are these two things doing? 

You would read the documentation for your webserver which would tell you
how to get the login of the authenticated user... 

This has nothing to do with perl, and even though I know the answer I refuse
to answer it in this forum.

-- 
Sam

comments on data are usually much more helpful than on algorithms
	--Rob Pike


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

Date: Fri, 12 Nov 1999 10:08:30 +0800
From: Adrian Chin <Achin@inprise.com>
Subject: How to use stat () ?
Message-Id: <382B769E.3469A9F9@inprise.com>

Subject:
             How to use stat function ?
        Date:
             Tue, 09 Nov 1999 11:59:14 +0800
       From:
             Adrian Chin <Achin@inprise.com>
 Organization:
             Inprise
 Newsgroups:
             comp.lang.perl.misc




Hi

I am confused on how stat () actually works.

I have :

    $mode = (stat $file) [2];

it prints out :

mode = 16893 for a directory which is drwxrwxr-x
mode = 33261 for a file which is -rwxr-xr-x

How come 9 and 8 existed in the mode result ?


Thanks
Adr





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

Date: 12 Nov 1999 02:42:41 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: How to use stat () ?
Message-Id: <slrn82mvlc.3m4.sholden@pgrad.cs.usyd.edu.au>

On Fri, 12 Nov 1999 10:08:30 +0800, Adrian Chin <Achin@inprise.com> wrote:
>Subject:
>             How to use stat function ?
>        Date:
>             Tue, 09 Nov 1999 11:59:14 +0800
>       From:
>             Adrian Chin <Achin@inprise.com>
> Organization:
>             Inprise
> Newsgroups:
>             comp.lang.perl.misc

Why does all that appear outside the header... I think you need
to fix whatever you are using to post...

>Hi
>
>I am confused on how stat () actually works.
>
>I have :
>
>    $mode = (stat $file) [2];
>
>it prints out :
>
>mode = 16893 for a directory which is drwxrwxr-x
>mode = 33261 for a file which is -rwxr-xr-x
>
>How come 9 and 8 existed in the mode result ?

Becasue you printed out the decimal value.

13893 dec = 40775 oct
33261 dec = 100755 oct

-- 
Sam

The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny ..."
	--Isaac Asimov 


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

Date: Fri, 12 Nov 1999 03:38:07 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Need Help with Named Pipes Please
Message-Id: <zYLW3.260$YI2.11253@typ11.nn.bcandid.com>

In article <382B1618.E61C3886@stud.umist.ac.uk>,
FASE Andrew  <andrew.fase@stud.umist.ac.uk> wrote:
>Can anyone give me any advice or help please?? i would be very gratfull

suggestion #1: don't say "doesn't work".  Get an error message and
include it in the post.
suggestion #2: include your code, but not more than about 20 lines' worth.
suggestion #3: are you checking the return value from open()?
suggestion #4: do you know what directory your CGI script is running in?
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Fri, 12 Nov 1999 01:26:19 GMT
From: James Tolley <jtolley@bellatlantic.net>
Subject: Re: OO question again
Message-Id: <3820E051.3B2303E0@bellatlantic.net>

Thomas Schmickl wrote:
> 
> James Tolley schrieb:
> 
> > If you think you'll be adding features to your
> > code in the future such that you'll want to change
> > the way these variables are stored, it's a good
> > idea to encapsulate them behind get/set methods.
> > If you think the module will remain essentially
> > the same forever, then by all means, stay with the
> > direct access method.
> 
> I have learned in between that you can call a sub in different contexts, f. ex. the scalar and the array context.
> 
> In my case it would be the most easy thing to call a subroutine in an array-  or an reference-of-an-array context, which will work I think.
> 

A reference is a scalar. It doesn't matter what it's referring to. You
_could_ do something like this, but it would be incredibly bad design.

$value = $obj->get_whatever();
@array = $obj->get_whatever(); $ref = $array[0];

> 
> The second thing is, if Tk takes an reference to an hash-value to read/write from/to it, is there a way that it uses the reference of an Get/Set-subroutine the same way ? I think not, but maybe there is one ?
> 

Nope. Your best bet along these lines is tie().

hth,

James


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

Date: Fri, 12 Nov 1999 04:16:55 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: output a binary file to browser from perl script
Message-Id: <XwMW3.405$YI2.21974@typ11.nn.bcandid.com>

In article <80fgeu$hjd$1@nnrp1.deja.com>,  <abnerstransky@my-deja.com> wrote:
>I'm trying to write a script that will send a gzip'd file to the
>browser via http only when the user has entered a password correctly. I
>don't want a simple Location:http://etcetc tag, because I don't want
>the URL to be accessible. So how do I output a 2meg gzip file - that
>is, read it from the directory and spit it out to the browser?

open() it, read() it in chunks, and print the results.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

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


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