[13943] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1353 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 11 21:05:33 1999

Date: Thu, 11 Nov 1999 18:05:17 -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: <942372316-v9-i1353@ruby.oce.orst.edu>
Content-Type: text

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

Today's topics:
        A Big Thanks... <expoinfo@globalexpos.co.nz>
    Re: A Big Thanks... <D.Bayne@NmaOssSeyP.aAc.Mnz>
    Re: an error occured while processing this directive (Tad McClellan)
    Re: Apache 1.3.9 and mod_perl 1.21problems <randy@theory.uwinnipeg.ca>
    Re: Can Perl Modules help me? (Abigail)
    Re: CSV Parsing Revisited (long - 98 lines) <cassell@mail.cor.epa.gov>
    Re: Dumb Newbie date question <steve@corp.airmedia.com>
    Re: Dumb Newbie date question (Craig Berry)
    Re: FAQ 4.58: How can I always keep my hash sorted? <cassell@mail.cor.epa.gov>
    Re: FAQ 8.30: How can I convert my shell script to perl <cassell@mail.cor.epa.gov>
    Re: Filehandle Question <cassell@mail.cor.epa.gov>
    Re: Filehandle Question (Thunderdust (TomH))
    Re: freeing memory timfi@my-deja.com
        Generating pi <revjack@radix.net>
    Re: Generating pi (Yanick Champoux)
    Re: Generating pi (Yanick Champoux)
    Re: Generating pi (Ilya Zakharevich)
    Re: Generating pi (Yanick Champoux)
    Re: HELP - Need DBI::Oracle Binaries (?) for Solaris <cassell@mail.cor.epa.gov>
    Re: Help with Stoopid Nutscrape (Netscape) <expoinfo@globalexpos.co.nz>
    Re: Help with Stoopid Nutscrape (Netscape) <expoinfo@globalexpos.co.nz>
    Re: HELP: putting an @array into an %array??? (Tad McClellan)
    Re: How to encrypt a web log-in, and work w/accounts in (Craig Berry)
    Re: Is it true earning while browsing? <cassell@mail.cor.epa.gov>
    Re: Module File:Find problem <cassell@mail.cor.epa.gov>
    Re: Module File:Find problem (Abigail)
    Re: mSQL <lr@hpl.hp.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 12 Nov 1999 14:02:41 +1300
From: Andrew Broadley <expoinfo@globalexpos.co.nz>
Subject: A Big Thanks...
Message-Id: <382B6731.774ACA05@globalexpos.co.nz>


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)


--
<x-rich>Thanks,


Andrew Broadley

Information Technology

GLOBAL EXPOS (NZ) LIMITED


http://www.globalexpos.co.nz

<italic>"Better business using the power of the Internet

and the face-to-face advantage of exhibitions"

</italic>

E-mail me on my cellphone:

0212956648@messagetracker.co.nz

           (max <bold>146</bold> characters)


</x-rich>




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

Date: Fri, 12 Nov 1999 14:04:05 +1300
From: "Duncan Bayne" <D.Bayne@NmaOssSeyP.aAc.Mnz>
Subject: Re: A Big Thanks...
Message-Id: <gIJW3.1871$5W2.40480@news.clear.net.nz>

> 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..

It's posts like these that encourage newbies like myself to contribute to
the community.  If only other groups within society (i.e. non-computer
people) functioned in a similar way.

Right, I'd better be off to flame some Alliance supporters on nz.politics
;-)

Cya,
Duncan Bayne

-----
GCS/d++@s+:+@a--c++ULP+>+++L++>++++EW++N++@o?K?wOM-V?PS+@PE++Y+PGP-t+5X+@R+!
tvb+DI++++D+G--e>++h---@r++x+ - http://www.geekcode.com

This message is personal, and in no way related to the affairs of Massey
University, or to my employment by Massey University.




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

Date: Thu, 11 Nov 1999 09:50:14 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: an error occured while processing this directive
Message-Id: <slrn82llt6.unq.tadmc@magna.metronet.com>

On Thu, 11 Nov 1999 22:18:53 -0600, R C <investor@airmail.net> wrote:

>The location of the FAQs that are being referenced in this newsgroup is
>unknown to me, 


   The FAQs are included with the Perl distribution.

   If you have a properly installed perl, then you have the
   Perl FAQs on your very own hard drive somewhere.

   Find out where.


> so I do not know whether this error message is discussed
>there.


   If you cannot check the FAQs, then you cannot post.

   It is a prerequisite.


>I installed Random Text Displayer from Matt's Script Archive and configured
                                        ^^^^^^^^^^^^^^^^^^^^^

   Those scripts have several security and Y2K problems you know...


>it for my virtual host server which uses Apace and Linux. The script is
>called from an HTML page with URL
>http://www.numeraire.com/quotes/index.shtml , but the only thing that I have
>been able to get it to return is an error message as follows: [an error
>occurred while processing this directive] .


   That message is not from perl, so the perl newsgroup is not the
   right place to ask about it.


>If anyone has a clue to what is going on and how to correct it, please
>contact bob@numeraire.com .


   If you are having trouble with a script written in Perl, you
   should contact the author of the script.

   Your script is worth even less than what you paid for it...


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


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

Date: Thu, 11 Nov 1999 19:46:07 -0600
From: "Randy Kobes" <randy@theory.uwinnipeg.ca>
Subject: Re: Apache 1.3.9 and mod_perl 1.21problems
Message-Id: <80frf5$o8s$1@canopus.cc.umanitoba.ca>


<lmoloch@my-deja.com> wrote in message news:80f7jc$ajj$1@nnrp1.deja.com...
> I have been trying to get apache 1.3.9 to work with mod_perl 1.21
>
> I follow the instructions in the Mod_perl-1.21\INSTALL.win32 file which
> instructs me to:
[snip]
> D:\MOD_PE~1.21>perl Makefile.PL
> Checking if your kit is complete...
> Looks good
> Have D:\perl\lib\MSWin32-x86\Config.pm expected C:\perl\lib\MSWin32-x86
> \Config.pm
> Your perl and your Config.pm seem to have different ideas about the
> architecture
> they are running on.
[snip]
Hi,
    Did you check your Config.pm file? Perhaps there's some
entries in there with the wrong drive letter?
   If not, as Mark suggested in another reply, try the
mod_perl binary on CPAN. I also have a binary at
ftp://theoryx5.uwinnipeg.ca/pub/other/perl-win32-bin-0.2.exe
which is a self-extracting archive of perl5.005_03,
mod_perl-1.21, and apache_1.3.9 - this is a bit newer
than Jeffrey Baker's on CPAN.

best regards,
Randy Kobes






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

Date: 11 Nov 1999 20:03:24 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Can Perl Modules help me?
Message-Id: <slrn82mthe.lmh.abigail@alexandra.delanet.com>

Peter (peterclones@yahoo.com) wrote on MMCCLXIII September MCMXCIII in
<URL: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.


Maybe, maybe not. It all depends on what you are doing.

Note that having X processes all read/write to the same file, will be
slow if you use locking of the entire file. (If you don't lock, well,
all bets are off). Of course, the entire concept of a "chat room using
HTTP" is completely insane when performance matters.

This is not the type of thing you want to use HTTP for.

May I suggest Net::IRC?



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== 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 17:13:59 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
To: Ken Bandes <kbandes@home.com>
Subject: Re: CSV Parsing Revisited (long - 98 lines)
Message-Id: <382B69D7.287847D2@mail.cor.epa.gov>

[courtesy cc emailed to poster]

Ken Bandes wrote:
> 
> The question of how to parse CSV files has been answered by a FAQ,
> a section of the book "Mastering Regular Expressions," and at least
> two CPAN modules.
> 
> The problem is that, for a definition of CSV that I'll describe, none
> of these answers is quite right.
[snip]
> I'm willing to take a stab at rewriting the FAQ, but there are two ways
> I could go:
> 1. rework the existing FAQ entry,
> "How can I split a [character] delimited string except when inside
> [character]? (Comma-separated files)"
> 
> or
> 2.  Write a new FAQ specifically for PC-type CSV files.

I vote for #1 .  This is just another case.  And much of
what is written in the FAQ doesn't need to be changed.  This
is really more of an addendum for the OS-challenged.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 11 Nov 1999 19:15:44 -0500
From: "Steve Protopapas" <steve@corp.airmedia.com>
Subject: Re: Dumb Newbie date question
Message-Id: <80fm3v$rot$1@nnrp03.primenet.com>


<crackbaby1@my-deja.com> wrote in message
news:80f373$741$1@nnrp1.deja.com...
> Just want to know how to create a variable with the current y2k date in
> it.
>
> Ex. 19991111
>
> Currently using
>
> $today_is=>($year,$mon,$mday)=localtime(time);
>
> Thanks
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

On Unix and maybe others? you could do:

my ($year) = localtime =~ /(\d+)$/;




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

Date: Fri, 12 Nov 1999 00:27:05 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Dumb Newbie date question
Message-Id: <s2mnmpjahsq83@corp.supernews.com>

crackbaby1@my-deja.com wrote:
: Just want to know how to create a variable with the current y2k date in
: it.

To get the current y2k date, you'd need to wait either 8-ish weeks or just
over 48 years, depending on your definition of 'k'. :)

If you mean how to get a four-digit year in a string of the form

: Ex. 19991111

that is a bit easier...or at least involves less waiting around.

: Currently using
: 
: $today_is=>($year,$mon,$mday)=localtime(time);

That doesn't even compile.  What are you *really* using?

Here's a low-annoyance technique, no manual bumping of month number and so
forth required:

  use POSIX;
  $today_is = strftime '%Y%m%d', localtime;

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "They do not preach that their God will rouse them
      a little before the nuts work loose." - Kipling


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

Date: Thu, 11 Nov 1999 17:01:54 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 4.58: How can I always keep my hash sorted?
Message-Id: <382B6702.4E69282D@mail.cor.epa.gov>

Klayto wrote:
[snip]
> I tried this many times, but now I encountered a problem regarding
> different sorting of two or more databases.
> 
> Example:
> ---------------
> sub CompareNumerical {
>   my ($k1, $k2) = @_ ;
>   $k1 < $k2;
> }
> sub CompareNumericalReverse {
>   my ($k1,$k2) = @_;
>   $k1 > $k2;
> }
[snip]
> Is this the correct way to do different sorting in two hashes that I need
> at the same moment? I don't think so...

It is not correct.  subs for sort need to return an integer 
less than, equal to, or greater than , depending on how the 
elements of the array are to be ordered.  Use the spaceship
operator <=> .  And use the special variables $a and $b .

If you had looked up sort() in the perlfunc pages, you
would have seen how to do this.  The traditional way to
sort an array numerically is like this:

@sorted = sort { $a <=> $b } @unsorted;

So you might sort your keys numerically like this:

@sorted_keys = sort { $a <=> $b } keys %hash1;

Read the docs on sort().  And look up about sorting
in the FAQ too.  Try this command:

perldoc -q sort.+anything

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 11 Nov 1999 17:24:53 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 8.30: How can I convert my shell script to perl?
Message-Id: <382B6C65.4EBF0EC9@mail.cor.epa.gov>

Petto Andersson wrote:
> 
> shellscript:
> #!/usr/bin/sh
> some_unix_command -some_options someinput
> 
> translates to perl:
> #!/usr/bin/perl
> system "some_unix_command -some_options someinput";

Yes, in the same sense that "I am full" translates into
"Je suis pleine".  :-)

Too many things that sh has to use external commands to get
are internal in Perl.  And too many kludges in sh have
straightforward non-pipeline solutions in Perl.  This works
on some simple cases, but I have found few sh/csh/ksh
scripts which really deserved a quick system() in Perl.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 11 Nov 1999 17:10:30 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Filehandle Question
Message-Id: <382B6906.774EFE9@mail.cor.epa.gov>

David Lloyd wrote:
> 
> Why don't filehandle variables have a qualifying prefix?
> 
> For instance, if subs have & why can't filehandles have |, and
> directory handles have ^?

Because Larry sold his soul to Satan to produce a language as
marvelous as Perl.  So he had to use five symbols, and no more,
for that pentagram effect.  [I mean, you have looked at the
source code, right?  If that's not black magic, then what is?
Other than sendmail, of course.]

So $ % @ & * are it.  Dirhandles and filehandles will have
to be second-class citizens until Larry renounces the Dark
Forces.  Now this sounds like an episode of "G vs E".

Or maybe it has to do with making the lexer go 'boing' when
you give it too many options for the meaning of a chunk of
text.  I've seen confusions over the use of & [there was one
in this ng just a few days ago].  And you want to make this
worse?

David, waiting for Deacon Jones to flatten me...
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 12 Nov 1999 01:31:14 GMT
From: beans@bedford.net (Thunderdust (TomH))
Subject: Re: Filehandle Question
Message-Id: <382b671c.7274095@news.bedford.net>


What's a "filehandle variable"? 

Try this, is the filehandle variable STDOUT, or $s?

#################### 
print STDOUT "Hello ";

$s = "STDOUT";
print $s "World\n";
##################3

On Thu, 11 Nov 1999 09:41:21 -0600, David Lloyd <david@inxpress.net>
wrote:

>Why don't filehandle variables have a qualifying prefix?
> 
>For instance, if subs have & why can't filehandles have |, and
>directory handles have ^?
> 
>Is there some complex reason relating to symbol tables and what-not?
>
>-- 
>===========================================================
>David M. Lloyd                  mailto:david@inxpress.net
>
>Administrator                   Phone: (608) 663-5555
>Internet Express, Inc.          http://www.inxpress.net
>802 W. Broadway, Suite # 101
>Madison, WI. 53713-1866
>===========================================================






Schnoodlewinks-constantly leveling up warrior
Fluffy_the_Fly-lvl.7 warrior (x2-don't ask!)
Flame-QFG5 Paladin


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

Date: Thu, 11 Nov 1999 23:20:34 GMT
From: timfi@my-deja.com
Subject: Re: freeing memory
Message-Id: <80fivu$jlq$1@nnrp1.deja.com>

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?
>
> Why posted twice, with slightly different texts?
>
>     %hash = ();
>
> Alternatively,
>
>     undef %hash;
>
> But that is slightly misleading, as the hash is still defined, though
> empty.
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
>

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};


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 12 Nov 1999 00:05:45 GMT
From: revjack <revjack@radix.net>
Subject: Generating pi
Message-Id: <80flkp$p4p$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

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.


-- 
hey/don't look now/but there goes god/in sexy pants/with a sausage
dog/and he can't stand beelzebub/coz he looks so good in black
revjack@radix.net


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

Date: Fri, 12 Nov 1999 01:27:57 GMT
From: yanick1@sympatico.ca (Yanick Champoux)
Subject: Re: Generating pi
Message-Id: <x2KW3.47165$Jp4.70650@news20.bellglobal.com>

In article <80flkp$p4p$1@news1.radix.net>,
	revjack <revjack@radix.net> writes:
> Anybody ever tool up an algorithm in perl to generate the
> digits of pi? 

Hey! Cool idea. Wait a minute.

*type* *type* *type*

Done. :)

After a quick hunt on the web, I hacked the procedure below. Of course, if
we want some *real* precision, we should use Math::BigFloat. In fact, 
I think it should be a neat idea to do that Math::Pi thing, with a collection
of Pi generating algorithms and stuff. Anyone want to embark on that venture
with me? :)

Joy,
Yanick

-- 
Yanick Champoux => champoux@iro.umontreal.ca 
                => http://www.iro.umontreal.ca/~champoux

"Maybe we're a Bliss of another kind..." -Tori Amos 


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

Date: Fri, 12 Nov 1999 01:32:10 GMT
From: yanick1@sympatico.ca (Yanick Champoux)
Subject: Re: Generating pi
Message-Id: <u6KW3.47177$Jp4.70650@news20.bellglobal.com>

In article <80flkp$p4p$1@news1.radix.net>,
> Anybody ever tool up an algorithm in perl to generate the
> digits of pi? 

Oops. Forgot to post the procedure. Here it is:


#! /usr/bin/perl

# Formula stolen on the Extraordinary Pi webpage
# (http://www.users.globalnet.co.uk/~nickjh/Pi.htm)
# 
# Formulae attributed to David Bailey, Peter Borwein and Simon Plouffe.
# It enables one to calculate the n-th digit of Pi (in hexadecimal) 
# without being forced  to calculate all the preceding n -1 digits. 
# ( I'm using good ol' decimal system here, though )
#
# Usage calculate_pi( $number_of_iterations )
#
sub calculate_pi
{
  my $n = shift;
  my $pi;
  for( my $i = 0; $i <= $n; $i++ )
  {
    $pi += ( 4/(8*$i+1) - 2/(8*$i+4) - 1/(8*$i+5) - 1/(8*$i+6) )/ 16**$i;
  }

  return $pi
}

foreach( 0..100 ){ print "$_ - Pi = ", calculate_pi( $_ ), "\n"; }

__END__

-- 
#!/usr/bin/perl
$_=ucfirst((@_=(  Email    => 'yanick@comnet.ca', 
                  Web_Site => 'http://www.iro.umontreal.ca/~champoux'   
))[1]);s!(.)(..)(.)(..).*!spylqg$2othyqm$3ntrepidqf$1etqwha$4y.!
;s,y,er,g;$_=join'q',sort split/q/;y:fgmqsw: :;print; 


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

Date: 12 Nov 1999 01:36:36 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Generating pi
Message-Id: <80fqv4$isn$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Yanick Champoux
<yanick1@sympatico.ca>],
who wrote in article <x2KW3.47165$Jp4.70650@news20.bellglobal.com>:
> In article <80flkp$p4p$1@news1.radix.net>,
> 	revjack <revjack@radix.net> writes:
> > Anybody ever tool up an algorithm in perl to generate the
> > digits of pi? 
> 
> Hey! Cool idea. Wait a minute.
> 
> *type* *type* *type*
> 
> Done. :)

I can do it with one less *type*!!!

 perl -MMath::Pari=:prec=100000,Pi -wle "print Pi" 

But it takes several minutes on my P5/133.

Ilya


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

Date: Fri, 12 Nov 1999 01:55:13 GMT
From: yanick@sympatico.ca (Yanick Champoux)
Subject: Re: Generating pi
Message-Id: <5sKW3.47247$Jp4.70650@news20.bellglobal.com>

In article <80fqv4$isn$1@charm.magnus.acs.ohio-state.edu>,
	ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> I can do it with one less *type*!!!
> 
>  perl -MMath::Pari=:prec=100000,Pi -wle "print Pi" 

	Drat! Writing that module would have been fun. Oh well.. 
Maybe I'll have better luck with 'e'. :)

Joy,
Yanick

-- 
Yanick Champoux => champoux@iro.umontreal.ca 
                => http://www.iro.umontreal.ca/~champoux

"Maybe we're a Bliss of another kind..." -Tori Amos 


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

Date: Thu, 11 Nov 1999 17:21:21 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: HELP - Need DBI::Oracle Binaries (?) for Solaris
Message-Id: <382B6B91.25C0084B@mail.cor.epa.gov>

Eisen Chao wrote:
[snip]
> Thus I am asking anyone who has the following:
> 
>   1) SunOS 5.4
>   2) Oracle Enterprise Edition 8.0.4.3.0
>   3) Perl 5.005_02 built for sun4-solaris-thread
>   4) A fully built Perl DBI::Oracle library/module
> 
> to be so kind as to tar/zip me their build of DBI::Oracle.

A couple problems here.

[1]  Having not built DBI::Oracle, I can't say for sure
whether the above information is sufficient to create a
usable build.  In general, people who try this sort of
thing with building Perl itself have bad results, so I
wouldn't expect this to work.

[2]  I would expect that you would have better luck 
building this using gcc than with that *thing* that
Sun calls a C compiler.  gcc is free, you know.

[3]  Sun has lots of free stuff at sunsite.  Have you
checked whether this is already built for you there?

[4]  Granted, switching to Microsoft may not be fun
for the people who do the real computer work, but is
it a good idea to sneak around behind the backs of
Those In Charge Of Paychecks?  Maybe you could take
one of them out for beers and have a civil discussion
about alternatives.  Not everyone is Dilbert's boss.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 12 Nov 1999 13:41:50 +1300
From: Andrew Broadley <expoinfo@globalexpos.co.nz>
Subject: Re: Help with Stoopid Nutscrape (Netscape)
Message-Id: <382B624E.23C018E6@globalexpos.co.nz>

Hi Erik,

Thanks for the help :o)

HTML is fine, ive been doing html longer than perl, but I believe its a
fault with the perl script I've done. I still dont understand why you need
to put Context type: text/standard in (even though it is in there)

Any other ideas ?

Erik van Roode wrote:

> Andrew Broadley <expoinfo@globalexpos.co.nz> wrote:
>
> > When i print out on my perl script... IE is fine.. but Netscape only
> > prints the HTML code... why is that ?
>
> Make sure the HTML is correct.
>
> Erik

--
<x-rich>Thanks,


Andrew Broadley

Information Technology

GLOBAL EXPOS (NZ) LIMITED


http://www.globalexpos.co.nz

<italic>"Better business using the power of the Internet

and the face-to-face advantage of exhibitions"

</italic>

E-mail me on my cellphone:

0212956648@messagetracker.co.nz

           (max <bold>146</bold> characters)


</x-rich>




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

Date: Fri, 12 Nov 1999 13:50:42 +1300
From: Andrew Broadley <expoinfo@globalexpos.co.nz>
Subject: Re: Help with Stoopid Nutscrape (Netscape)
Message-Id: <382B6462.3A562674@globalexpos.co.nz>

Dont worry, I just thought to myself and clicked.. its meant to be Content
Type: text/html .. not text/standard

I been working too hard on this script.. i shoudl have a break

Erik van Roode wrote:

> Andrew Broadley <expoinfo@globalexpos.co.nz> wrote:
>
> > When i print out on my perl script... IE is fine.. but Netscape only
> > prints the HTML code... why is that ?
>
> Make sure the HTML is correct.
>
> Erik

--
<x-rich>Thanks,


Andrew Broadley

Information Technology

GLOBAL EXPOS (NZ) LIMITED


http://www.globalexpos.co.nz

<italic>"Better business using the power of the Internet

and the face-to-face advantage of exhibitions"

</italic>

E-mail me on my cellphone:

0212956648@messagetracker.co.nz

           (max <bold>146</bold> characters)


</x-rich>




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

Date: Thu, 11 Nov 1999 14:37:45 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: HELP: putting an @array into an %array???
Message-Id: <slrn82m6o9.uqn.tadmc@magna.metronet.com>

On 11 Nov 1999 21:07:59 +0100, Bruno Boettcher <bboett@erm1.u-strasbg.fr> wrote:

>i tryed the following code:

[ snip code ]

   That code is better than nothing for soliciting help, but not 
   as good as it could have been.

   It could have been code that actually runs.

   It could have been code that illustrates your problem without
   a bunch of domain-specific stuff that we don't really need
   to figure out.


   You could have given us just:

------------------------
#!/usr/bin/perl -w
use strict;

my %finalResults;

while (<DATA>) {
   my @parts = split ' ', $_;
   $finalResults{$.} = @parts;
}

foreach (sort keys %finalResults ) {
   print "$_: $finalResults{$_}\n";
}

__DATA__
a b c d e
f g h i j
k l m
n o p q r s t u
------------------------

   And explained your problem:

I expected this output:

1: a b c d e
2: f g h i j
3: k l m
4: n o p q r s t u

instead I got this output:

1: 5
2: 5
3: 3
4: 8

   
   The easier you make it to help you, the better your chances of
   getting help...


>but this doesn't work..... what's stored is the number of elements of the
>subarray, and not the array....


   Because that is what you told perl to do.

   If you want something else, then you need to tell it something else :-)


>So somewhere i am mangling again the different ways of sight.... what would be
>the correct way?


   Use a "hash of lists" (HoL) data structure.

   It is called that even though it is NOT a hash of lists!

   It is a hash of array references.

   Sometimes you can think of it as a hash of lists, but sometimes
   you can't (or shouldn't anyway).


   You can check out the perlref.pod and perldsc.pod (Data Structures
   Cookbook) man pages to find out about how to make nested data
   structures in perl.


------------------------
#!/usr/bin/perl -w
use strict;

my %finalResults;   #  HoL

while (<DATA>) {
   my @parts = split ' ', $_;
   $finalResults{$.} = \@parts;  # store a reference to an array
}

foreach (sort keys %finalResults ) {
   print "$_: @{$finalResults{$_}}\n";
   #          ^^                 ^      de-reference it
}

__DATA__
a b c d e
f g h i j
k l m
n o p q r s t u
------------------------


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


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

Date: Fri, 12 Nov 1999 00:15:57 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How to encrypt a web log-in, and work w/accounts in Perl cgi?
Message-Id: <s2mn1tpdhsq52@corp.supernews.com>

Nick (nickysantoro@yahoo.com) 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...

If that's all you want, why not just use .htaccess and save yourself the
trouble of writing any code (for login security) at all?

(Btw, none of this is appropriate to this newsgroup.  But I'm in a
friendly mood.)

: but is it essentail that this is encrypted

That is a requirements question, not a technical one.  Sending 'secret'
data in the clear over the net is in some ways similar to sending secrets
written on postcards through the mail; in both cases, odds are quite good
that only the intended recipient will read the 'secret' message, but even
casual observers along the way can do so if they choose.

: and how would you do that with Perl?

Again, you wouldn't; let the server and the browser handle this by using
the https: (SSL) protocol.

: 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. 

Those both work, as do various other ways of doing it, including (of
course) htaccess.

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "They do not preach that their God will rouse them
      a little before the nuts work loose." - Kipling


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

Date: Thu, 11 Nov 1999 16:39:40 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Is it true earning while browsing?
Message-Id: <382B61CC.B7B33114@mail.cor.epa.gov>

Mark leung wrote:
> 
> The answer is right here.

Gee, I thought most of us earned while browsing.. and posting
answers to Usenet.

[snip of annoying URL]

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 11 Nov 1999 16:33:17 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Module File:Find problem
Message-Id: <382B604D.6B10375@mail.cor.epa.gov>

Bin Zeng wrote:
[unattributed post from me:]
> > If you need to follow symlinks, you'll need to push them
> > onto a stack and then follow them using your own code.
> 
> I think I get the point why the File::Find doesn't follow the
> symlinks. But would you elaborate about 'push them onto a stack'?

The problem is just as complex as symlinks on your system.
You have to write code which:
[1] remembers all directories you have visited;
[2] checks whether a symlink has dumped you into one of those
    dirs you have already visited;
[3] checks whether symlinks have put you in an infinite loop
    of dirs;
[4] has a way to get back to your previous branching point
    if following a symlink puts you in a dir which has a
    totally different parent;
[5] copes with symlinks to dirs on other machines, some of which
    may not be accessible now; and
[6] all the other things I haven't remembered off the top of
    your head.

Why do you think that you really *need* to follow all symlinks?

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 11 Nov 1999 19:49:59 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Module File:Find problem
Message-Id: <slrn82msot.lmh.abigail@alexandra.delanet.com>

David Cassell (cassell@mail.cor.epa.gov) wrote on MMCCLXIV September
MCMXCIII in <URL:news:382B604D.6B10375@mail.cor.epa.gov>:
;; Bin Zeng wrote:
;; [unattributed post from me:]
;; > > If you need to follow symlinks, you'll need to push them
;; > > onto a stack and then follow them using your own code.
;; > 
;; > I think I get the point why the File::Find doesn't follow the
;; > symlinks. But would you elaborate about 'push them onto a stack'?
;; 
;; The problem is just as complex as symlinks on your system.
;; You have to write code which:
;; [1] remembers all directories you have visited;
;; [2] checks whether a symlink has dumped you into one of those
;;     dirs you have already visited;
;; [3] checks whether symlinks have put you in an infinite loop
;;     of dirs;

Why? There are heaps of Unix utilities that can be forced to follow
symlinks, and happily go into infinite loops if there is one. Why
should a utility written in Perl be any different?

;; [4] has a way to get back to your previous branching point
;;     if following a symlink puts you in a dir which has a
;;     totally different parent;

You really would have to write some twisted, ugly code to make this
a problem. Any decently written program with properly scoped variables
won't have this problem.

;; [5] copes with symlinks to dirs on other machines, some of which
;;     may not be accessible now; and

That's a problem not reserved for symlinks.

;; [6] all the other things I haven't remembered off the top of
;;     your head.

Are you also argueing that the -r option of rm is wrong, because
someone could do 'rm -r /' ?

;; Why do you think that you really *need* to follow all symlinks?

Why do you think a symlink is there in the first place?


Abigail
-- 
$_ = "\x3C\x3C\x45\x4F\x54";
print if s/<<EOT/<<EOT/e;
Just another Perl Hacker
EOT


  -----------== 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 15:01:21 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: mSQL
Message-Id: <MPG.1294ea9eeac5ea7c98a1e2@nntp.hpl.hp.com>

[Reordered for readability.]

In article <382B369A.58B1A7C5@st.hhs.nl> on Thu, 11 Nov 1999 22:35:22 
+0100, J.E.J. op den Brouw <J.E.J.opdenBrouw@st.hhs.nl> says...
> Erick Jensen wrote:
> > Does anyone know of a good reference (web site, book, etc.) for accessing an
> > mSQL database with Perl?
> 
> There is an:
> 
> "Official Guide To Mini SQL"
> 
> by the author of mSQL.
> 
> ISBN: 0-471-24535-6
> 
> Allthough it is based on 2.0.3, it's worth reading.
> It does not only cover Perl, but also Java, C and PHP.
> Chapter 9 is of interest: Perl CGi programming with
> DBI and DBD::mSQL

'MySQL & mSQL', O'Reilly (pub.), ISBN: 1-56592-434-7

Chapters 10 and 21 deal with Perl.

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


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

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


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