[18847] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1015 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 29 21:05:41 2001

Date: Tue, 29 May 2001 18:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <991184709-v10-i1015@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 29 May 2001     Volume: 10 Number: 1015

Today's topics:
    Re: Array of file pointers <goldbb2@earthlink.net>
    Re: DBI Microsoft SQL Server. <rdoerr@planetkc.com>
        Decode uuencoded multiparts *and* delete only the multi test@test.de
    Re: FAQ 5.23:   How do I print to more than one file at <elijah@workspot.net>
        Generic Flatfile DB routines <neil@alaweb.com>
    Re: Generic Flatfile DB routines <godzilla@stomp.stomp.tokyo>
    Re: Generic Flatfile DB routines <admin@ase-ga.com>
    Re: Generic Flatfile DB routines (Eric Bohlman)
        good perl practice? <usenet@willem.byte.nl>
    Re: How can I migirate installed&configured activeperl5 <admin@ase-ga.com>
    Re: Perl script error during testing (Damian James)
        Problem installing CPAN modules <news@quickdirect.com>
        Problems with Cookie code <bcoon@sequenom.com>
        showtable: bug: truncating numbers to 2 decimals <jidanni@kimo.FiXcomTHiS.tw>
        The FlakeyMind/Bryce Jacobs FAQ (v0.1) (Thaddeus L Olczyk)
    Re: What does this perl line mean? <mjcarman@home.com>
    Re: What does this perl line mean? <bcoon@sequenom.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 29 May 2001 19:17:00 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Array of file pointers
Message-Id: <3B142DEC.A2CCF18A@earthlink.net>

Tad McClellan wrote:
> 
> Miguel Cruz <spam@un.u.nu> wrote:
> >
> >Is there any way I can create an array of file pointers in Perl?
> 
> That sounds pretty much like "How do I make an array of filehandles?".
> 
> >Any ideas?
> 
> I would do it the way shown in the Perl FAQ:
> 
>    perldoc -q filehandle
> 
>       "How can I make a filehandle local to a subroutine?  How do
>        I pass filehandles between subroutines?  How do I make an
>        array of filehandles?"

I just looked at the faq, and I noticed that there's one method which I
often use, which isn't mentioned there.

	open my $fh, $filename;

Since a scalar was passed whose values is undef, open will automatically
fill it in with an anonymous typeglob.  I don't see this documented in
any of perlfaq5, nor in the page for open[*], nor in perlopentut.

Maybe I'm missing something?

* Unless this is some wierd interpretation of "If FILEHANDLE is an
expression, its value is used as the name of the real filehandle wanted"

-- 
The longer a man is wrong, the surer he is that he's right.


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

Date: Tue, 29 May 2001 17:58:23 -0500
From: "Ray Doerr" <rdoerr@planetkc.com>
Subject: Re: DBI Microsoft SQL Server.
Message-Id: <th8afca6a3epe9@corp.supernews.com>

This is a multi-part message in MIME format.

------=_NextPart_000_0031_01C0E868.F4455080
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

download ActiveState Perl
download DBI which include DBD::ADO

From there you can connect directly to SQL Server using the ADO driver =
that is include in the BDI download.  You could also use the ODBC driver =
but I prefer the ADO one.


  "Vjay LaRosa" <vjayl@emc.com> wrote in message =
news:3B0BCC72.1E5F3954@emc.com...
  Hello,=20
  I was hoping that some one could help me. I need to access a SQL =
server 7.0 Database on Win2K.=20
  Does any one have any expierience with this? If so and you are willing =
to give me a few pointers=20
  please E-mail me directly. Thanks!=20

  vjl=20

--=20
 V.Jay LaRosa                           EMC Corporation
 Systems Administrator                  171 South Street
 (508)435-1000 ext 14957                Hopkinton, MA 01748
 (508)497-8082 fax                      www.emc.com
   =20

------=_NextPart_000_0031_01C0E868.F4455080
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>download ActiveState Perl</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>download DBI which include =
DBD::ADO</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>From there you can connect directly to =
SQL Server=20
using the ADO driver that is include in the BDI download.&nbsp; You =
could also=20
use the ODBC driver but I prefer the ADO one.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV>"Vjay LaRosa" &lt;<A =
href=3D"mailto:vjayl@emc.com">vjayl@emc.com</A>&gt;=20
  wrote in message <A=20
  =
href=3D"news:3B0BCC72.1E5F3954@emc.com">news:3B0BCC72.1E5F3954@emc.com</A=
>...</DIV>Hello,=20

  <P>I was hoping that some one could help me. I need to access a SQL =
server 7.0=20
  Database on Win2K. <BR>Does any one have any expierience with this? If =
so and=20
  you are willing to give me a few pointers <BR>please E-mail me =
directly.=20
  Thanks!=20
  <P>vjl <PRE>--&nbsp;
&nbsp;V.Jay =
LaRosa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp; EMC Corporation
&nbsp;Systems =
Administrator&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 171 South Street
&nbsp;(508)435-1000 ext =
14957&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp; Hopkinton, MA 01748
&nbsp;(508)497-8082 =
fax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
www.emc.com</PRE>&nbsp;=20
</BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0031_01C0E868.F4455080--



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

Date: 29 May 2001 17:47:08 -0500
From: test@test.de
Subject: Decode uuencoded multiparts *and* delete only the multiparts that were succesfully decoded (leave the rest)
Message-Id: <ka88htcq58ftiatqmlga8610dkjkio12c9@4ax.com>

Hello Group.

I was wondering if there is some package available with which can do
the following:

I usually have a directory full with lots of uu encoded files
containing lots of mp3s or whatever files downloaded from different
newsgroups from my commercial newsprovider. For downloading these
parts I use NewsPlex 3.4 for Windows. It saves its downloaded parts in
a directory called async and names them somehexnumber.ok (for example
3b12a253.ok, 3b12a254.ok, 3b12a255 ok etc.). It acts as a newsserver
and delivers them to a local group called async. You can download
these files with a newsreader and decode them, but I thought that it
would be much more efficiently to decode them with a simple and fast
decoder. I can decode those files with any application which can
decode uu encoded files like uudecode, uudeview etc. The problem is
that these programs leave the original multiparts in the original
directory meaning I have to check them manually (thousands of files)
to clean out the already decoded multiparts. I have been looking for
days now for a program for windows to do that jobautomatically for me,
but I cannot find any which can do the -delete after successful
decode-. So now I end up asking here.

If there is no such program yet I would try to program it myself, but
that would take pretty long, because I just started learning perl...

Thanks for *any* suggestions. Maybe one of you have already heard of
such a program

Greetings

Sasa


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

Date: 30 May 2001 00:19:16 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: FAQ 5.23:   How do I print to more than one file at once?
Message-Id: <eli$0105292019@qz.little-neck.ny.us>

In comp.lang.perl.misc, Ilmari Karonen  <usenet11471@itz.pp.sci.fi> wrote:
>     open (TEE, "| tee >file1 file2 file3") or die "Teeing: $!\n";

You don't really mean '>' there do you?

Elijah
------
only mentioning this since it is being proposed for FAQ inclusion


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

Date: Tue, 29 May 2001 17:29:32 -0500
From: "Neil" <neil@alaweb.com>
Subject: Generic Flatfile DB routines
Message-Id: <th88h7a0ic9ma0@corp.supernews.com>

Hi,

I have looked high and low for a set of routines to read and write flatfile
DB's.... but somehow I didn't find any .... so ...I decided to write my own.
I still assume that there is something "out there" like this ...so if
someone wants to point me in that direction - that would be nice as well.

I have a bunch of flatfile db's that I access frequently that I would like
to modify so that I can access them using generic subroutines...

I want to have several DB'd "loaded" into hashes, so I can look for dups
etc. So...

$db{'tools'} = "./tools.db";
$db{'hardware'} = "./hardware.db";

where the key is a "simple name" and the value is the actual file path.

Each record in a database would have one unique field.

The format I thought would work for the db file header is :

the first lines of the db being a header line describing the field
separator, unique field and a list of field names delimited by a semi-colon

,;name;name;phone           # header consists of field separator; unique
field, field name 1,..., field name n

the second line giving a "type" to the fields

text; number;date

I actually don't care if this is in a seperate file as a "setup file" or as
a "header" in the flatfile db. I just don't want to hard code it in perl,
prefering to have the routines figure out the field names and types.

the actual data records would be similiar to

Bill,1234567890,990919391          # fields delimited by field separator
Sue,0987654321,990919391
etc.

I would like to have be able to do something along the lines of :

my %db, %db_record, %rec_field_name;

$db{'tools'} = "./tools.db";
$db{'hardware'} = "./hardware.db";

foreach $db_name (keys %db)
   {
   &read_db($db_name);     # assume read_db parses out the header and stuffs
the hashes appropriately...
   foreach $db_record (keys $db{$db_name})
      {
      print "record $record ";
      foreach $rec_field_name (keys $db_record{$db_name}{$db_record})
         {
         print "$rec_field_name is
$db_field{$db_name}{$db_record}{$rec_field_name}";
         }
      print "\n";
      }
   }

Basically, ...if I want to access file "tools.db" ....record "12 oz
hammer".... field "quantity".... I could just

&read_db ('tools.db');
$item_quantity = $db_field{'tools.db"}{'12 oz hammer'}{'quantity'};

I have cobbled together some code, which I did not include, as I was just
trying to get the concept across at this level - but my main problem seems
to be my understanding of hashes of hashes - although I have been through
"Programming Perl" (several times), CPAN (several times) and about 20 or so
websites and spent about 4 days on coding.

Any guidance and pointers would be appreciated !
Thanks !




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

Date: Tue, 29 May 2001 16:35:46 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Generic Flatfile DB routines
Message-Id: <3B143252.46C1370B@stomp.stomp.tokyo>

Neil wrote:

(snipped)

> I have cobbled together some code, which I did not include, as I was just
> trying to get the concept across at this level - but my main problem seems
> to be my understanding of hashes of hashes - although I have been through
> "Programming Perl" (several times), CPAN (several times) and about 20 or so
> websites and spent about 4 days on coding.
 
> Any guidance and pointers would be appreciated !


Guidance and pointers about what? You have not included
your code nor asked a specific question. If you don't
understand hashes, continue your reading and research
until you do. If you have a question about your code,
post your code and ask. This is not a tutorial center.

I taught myself Perl with zero assistance. I would 
surmise you can do the same.

Godzilla!


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

Date: Wed, 30 May 2001 00:19:40 GMT
From: "GArlington" <admin@ase-ga.com>
Subject: Re: Generic Flatfile DB routines
Message-Id: <w0XQ6.4149$zb7.531312@news1.cableinet.net>

I have a similar scripts - I made them couple of years ago, when just
started with Perl.
The scripts are configurable via "require"d db.conf file, assumes flat
file(s) with 1st line of field names followed by lines of data, allows read,
write and update.
If you want to see it let me know via e-mail.
G.A.

Neil <neil@alaweb.com> wrote in message
news:th88h7a0ic9ma0@corp.supernews.com...
> Hi,
>
> I have looked high and low for a set of routines to read and write
flatfile
> DB's.... but somehow I didn't find any .... so ...I decided to write my
own.
> I still assume that there is something "out there" like this ...so if
> someone wants to point me in that direction - that would be nice as well.
>
> I have a bunch of flatfile db's that I access frequently that I would like
> to modify so that I can access them using generic subroutines...
>
> I want to have several DB'd "loaded" into hashes, so I can look for dups
> etc. So...
>
> $db{'tools'} = "./tools.db";
> $db{'hardware'} = "./hardware.db";
>
> where the key is a "simple name" and the value is the actual file path.
>
> Each record in a database would have one unique field.
>
> The format I thought would work for the db file header is :
>
> the first lines of the db being a header line describing the field
> separator, unique field and a list of field names delimited by a
semi-colon
>
> ,;name;name;phone           # header consists of field separator; unique
> field, field name 1,..., field name n
>
> the second line giving a "type" to the fields
>
> text; number;date
>
> I actually don't care if this is in a seperate file as a "setup file" or
as
> a "header" in the flatfile db. I just don't want to hard code it in perl,
> prefering to have the routines figure out the field names and types.
>
> the actual data records would be similiar to
>
> Bill,1234567890,990919391          # fields delimited by field separator
> Sue,0987654321,990919391
> etc.
>
> I would like to have be able to do something along the lines of :
>
> my %db, %db_record, %rec_field_name;
>
> $db{'tools'} = "./tools.db";
> $db{'hardware'} = "./hardware.db";
>
> foreach $db_name (keys %db)
>    {
>    &read_db($db_name);     # assume read_db parses out the header and
stuffs
> the hashes appropriately...
>    foreach $db_record (keys $db{$db_name})
>       {
>       print "record $record ";
>       foreach $rec_field_name (keys $db_record{$db_name}{$db_record})
>          {
>          print "$rec_field_name is
> $db_field{$db_name}{$db_record}{$rec_field_name}";
>          }
>       print "\n";
>       }
>    }
>
> Basically, ...if I want to access file "tools.db" ....record "12 oz
> hammer".... field "quantity".... I could just
>
> &read_db ('tools.db');
> $item_quantity = $db_field{'tools.db"}{'12 oz hammer'}{'quantity'};
>
> I have cobbled together some code, which I did not include, as I was just
> trying to get the concept across at this level - but my main problem seems
> to be my understanding of hashes of hashes - although I have been through
> "Programming Perl" (several times), CPAN (several times) and about 20 or
so
> websites and spent about 4 days on coding.
>
> Any guidance and pointers would be appreciated !
> Thanks !
>
>




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

Date: 30 May 2001 00:42:06 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Generic Flatfile DB routines
Message-Id: <9f1fku$pnk$2@bob.news.rcn.net>

Neil <neil@alaweb.com> wrote:
> I have looked high and low for a set of routines to read and write flatfile
> DB's.... but somehow I didn't find any .... so ...I decided to write my own.
> I still assume that there is something "out there" like this ...so if
> someone wants to point me in that direction - that would be nice as well.

Most of the efforts in this area have been in creating DBD modules that 
allow you to use an SQL interface to access flat files through DBI.  
DBD::CSV, DBD::RAM and DBD::Sprite are the best-known ones.



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

Date: Wed, 30 May 2001 02:36:16 +0200
From: "Willem" <usenet@willem.byte.nl>
Subject: good perl practice?
Message-Id: <9f1f5v$phe$1@dinkel.civ.utwente.nl>

Imagine the following example, is this the preferred way of checking for
errors within subs?
If not, how could this be written more smoothly?

db_connect() or die "DB connection failed";

sub db_connect {
        use DBI;
        $dbh = DBI->connect("DBI:mysql:byte:host","user","bla");
        if ($dbh) {
                return 0;
        } else {
                warn "Could not connect to dbase: ".DBI->errstr;
                return 1;
        }
}




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

Date: Wed, 30 May 2001 00:31:10 GMT
From: "GArlington" <admin@ase-ga.com>
Subject: Re: How can I migirate installed&configured activeperl5.6 to another machine
Message-Id: <ibXQ6.4226$zb7.539044@news1.cableinet.net>

Copy perl directory structure...
G.A.

Kick <mn_eric@email.com> wrote in message news:9ev8hi$6mg$1@mail.cn99.com...
> I have installed activeperl on my machine and use ppm installed perl/tk.
Now
> I want to migrate it to a machine in my office which can't connect to
> internet. That means I can't install default activeperl distribution and
> reinstall perl/tk again.
>
> What can I do now?
>
> Thanks for any help!
>
> Eric
>
>




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

Date: 30 May 2001 01:04:59 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: Perl script error during testing
Message-Id: <slrn9h8hq1.fgr.damian@puma.qimr.edu.au>

sloon chose Tue, 29 May 2001 17:10:46 GMT to say this:
>...
>Okay..I choose the wrong newsgroup in which to ask a question, however
>I got an answer that I found acceptable. 

And this justifies wasting other people's time. OK.

>...
>I don't have my Discrete Mathematics text here , and I haven't looked
>at it in MANY years, but I am under the impression that there is a
>term for a proposition that is logically flawed. 

'Fallacy', but a Maths textbook is not the most obvious place to turn for
elementary logic. Your original post displayed what is known as the 'post
hoc propter hoc' fallacy -- you happened to be using Perl when you ran into
this server issue, so you decided it was a Perl issue. I saw no problems with
Abigail's logic when she pointed this out to you.

>...
>You remind me of an adolescent who desperately wants to appear
>intelligent, but is only smart, and you probably don't know the
>difference.

There's a part of me that has sufficient anthropological interest to
wonder what you could possibly believe such a distinction entails but
frankly, I don't think I want to know. 

*plonk*

HAND
Cheers,
Damian
-- 
@:=grep!($;+=m!$/|#!),split//,<DATA>;@;=0..$#:;while(@;){for($;=@;;--$;;)
{@;[$;,$:]=@;[$:,$;]if($:=rand$;+$|)!=$;}push@|,shift@;if$;[0]==@|;select
$,,$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/} __END__
Just another Perl Hacker # rev 3.1 -- a JAPH in progress, I guess...


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

Date: Wed, 30 May 2001 00:04:55 GMT
From: Shadow <news@quickdirect.com>
Subject: Problem installing CPAN modules
Message-Id: <14e8ht8ddutjn3fgu9au5t85bs2cijps0p@4ax.com>

I'm a bit new to perl but I was successful in installing some of the
modules. Here are the commands I used. I ended up getting the errors
below on some of the modules. It seems that a bunch of the modules are
corrupt/bad checksum and I find it hard to believe that there are
problems with so many of these -- including the Bundle::CPAN which I
was told could be installed and I also got the same checksum/bogus
file warning. Does anyone know what all this means and how I can
install the missing modules?

Thank you in advance...

Mike

Commands I used:

bash%   perl -MCPAN -e shell
cpan>   install Net::NNTP
cpan>   install Net::SMTP
cpan>   install DBI
cpan>   install Bundle::MySQL
cpan>   install Text::Autoformat
cpan>   install Date::Parse
cpan>   install Email::Find
cpan>   install URI::Find
cpan>   install MIME::WordDecoder



Errors I received from some of the modules:


cpan> install DBI 
Running make for T/TI/TIMB/DBI-1.15.tar.gz 
Unwrapped into directory yes/build/TIMB000 

CPAN.pm: Going to build T/TI/TIMB/DBI-1.15.tar.gz 

Couldn't chdir yes/build/TIMB000: No such file or directory at (eval
26) line 42 
19 
====================================== 

cpan>install Bundle::MySQL 
Can't install Bundle::MySQL, don't have an associated bundle file. :-(
at (eval 26) line 1806 



=============================== 


cpan> install Text::Autoformat 
cpan> install Date::Parse 
cpan> install Email::Find 
cpan> install URI::Find 
cpan> install MIME::WordDecoder 
cpan> install HTML::Entities 

yields these errors: 


Running make for D/DC/DCONWAY/Text-Autoformat-1.04.tar.gz 
yes/sources/authors/id/D/DC/DCONWAY/Text-Autoformat-1.04.tar.gz: No
such file or 
directory 
Checksum mismatch for distribution file. Please investigate. 

Distribution id = D/DC/DCONWAY/Text-Autoformat-1.04.tar.gz 
CALLED_FOR Text::Autoformat 
CONTAINSMODS Text::Autoformat 
CPAN_USERID DCONWAY (Damian Conway <damian@conway.org> ) 
MD5_STATUS 
localfile
yes/sources/authors/id/D/DC/DCONWAY/Text-Autoformat-1.04.tar.gz 

I'd recommend removing 
yes/sources/authors/id/D/DC/DCONWAY/Text-Autoformat-1.04.tar.gz. It
seems 
to 
be a bogus file. Maybe you have configured your `urllist' with a 
bad URL. Please check this array with `o conf urllist', and 
retry. 

Fetching with LWP: 
ftp://ftp.perl.org/pub/CPAN/authors...ONWAY/CHECKSUMS 
yes/sources/authors/id/D/DC/DCONWAY/Text-Autoformat-1.04.tar.gz: No
such file or 
directory 
Checksum mismatch for distribution file. Please investigate. 

Distribution id = D/DC/DCONWAY/Text-Autoformat-1.04.tar.gz 
CALLED_FOR Text::Autoformat 
CONTAINSMODS Text::Autoformat 
CPAN_USERID DCONWAY (Damian Conway <damian@conway.org> ) 
MD5_STATUS 
localfile
yes/sources/authors/id/D/DC/DCONWAY/Text-Autoformat-1.04.tar.gz 

I'd recommend removing 
yes/sources/authors/id/D/DC/DCONWAY/Text-Autoformat-1.04.tar.gz. It
seems 
to 
be a bogus file. Maybe you have configured your `urllist' with a 
bad URL. Please check this array with `o conf urllist', and 
retry. 

sh: yes/sources/authors/id/D/DC/DCONWAY/Text-Autoformat-1.04.tar.gz:
No such fil 
e or directory 
Could not open >yes/build/DCONWAY000/Makefile.PL at (eval 26) line
4219 


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

Date: Tue, 29 May 2001 15:38:50 -0700
From: Bryan Coon <bcoon@sequenom.com>
Subject: Problems with Cookie code
Message-Id: <3B1424FA.B9653228@sequenom.com>

I am having some troubles with some subs that I am using for user login
and verifications.  The problem specifically is that users have to
login, then hit reload, because (I think) the cookie is printed in the
header, and following this header is a check for the existence of a
cookie.  No matter what I seem to tweak, I cannot get the user cookie
check to work without reloading the page, so I am doing something
wrong..

Basically all of these are called from one script in one request

Sorry if this isn't clear (and for lost formatting), but maybe someone
could spare a moment to look at the obvious flaws in logic and or style
here.  Maybe that will clue me in enough to figure out what is really
wrong.

Thanks!

Here's the core of what I have.....
## First user logs in with a submission via cgi to a script that calls
writeCookie
# Here's write cookie
sub writeCookie {
  my $login = $_[0];
  my $password = $_[1];

  my $level = verifyDB($login, $password);  ## Returns user level if
user exists in MySQL

  if ($level ne "" && $login ne "") {
    my $c = new CGI::Cookie(-name => "Oreo",
                            -value => [$login,$level],
                            -path => '/');
    pageStart("Title Page", "", "", $c);
    print end_html();
  } else {
    my $c = new CGI::Cookie(-name => "Oreo",
                            -value => [$login,$level],
                            -path => '/');
    pageStart("Logged Out", "", "", $c);
    print end_html();
  }
}

## Here is the generic start html page function
sub pageStart {
  my $s = $_[0];  # Title of page
  my $js = $_[1];  # Any javascripts I want
  my $onload = $_[2];  # Onload javascripts
  my $cookie = $_[3];  # The cookie

  print header(-expires => '-1d',
               -cookie => $cookie);
  print start_html(-title=>$s,
                   -style=>{'src'=>'/SQNM.css'},
                   -bgcolor=>"white",
                   -script=>$js,
                   -onload=>$onload,
                   -onresize=>"location.reload()");
  print "\n<script language=javascript
src=$html/jscripts/sqnm.js></script>";
  print "\n<script language=javascript
src=$html/jscripts/scripts.js></script>";
}

## Check to see if user is logged in
sub loggedIn {
  my ($login, $level) = readCookie();
  if ($login ne "" && $level ne "") {
    return 1;
  } else {
    return 0;
  }
}




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

Date: 30 May 2001 03:54:35 +0800
From: Dan Jacobson <jidanni@kimo.FiXcomTHiS.tw>
Subject: showtable: bug: truncating numbers to 2 decimals
Message-Id: <m2n17wx75w.fsf@dan.jacobson.tw>

There is a big bug in the /usr/bin/showtable program probably on your
system too.  One's 3 digit decimal places become 2.

When the input had 156242.434

$ showtable -ti -t -d' ' < file
 3   566  156242.43  2550608.39    1.94

This undocumented behavior is stopped by commenting out

#    /^[-+]?[\d.]+(E[+-]?\d+)?$/ && return 'real'; # +-nnn.nnn(E+-nn)

By the way, showtable should add an option to not make blanks in the
first column.

Also an option should be added to make certian columns aligned to the
right...
-- 
http://www.geocities.com/jidanni Tel886-4-25854780 e-mail:restore .com.


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

Date: Wed, 30 May 2001 00:03:24 GMT
From: olczyk@interaccess.com (Thaddeus L Olczyk)
Subject: The FlakeyMind/Bryce Jacobs FAQ (v0.1)
Message-Id: <3b1571cf.664433218@nntp.interaccess.com>

Technically this is v0.1.1, but I am keeping the same title so that a
new thread is not started. I expect there to be some fast updates at
the beginning, so i don't think it's a good idea to start a bunch of
new threads. 

Changes to 0.1.1.
FAQ number 0 added.
Previous BJ posts on OO is GUI are included.


Q0: Is this a troll?
A: Short answer: No. Long answer: A better question is-what is the
     purpose of this FAQ. The purpose of the FAQ is elucidate newbies
     in comp.object to who PretendsToHaveAMind is. It is an old 
     football trick to rile  up a player and then hit them when the 
     referee isn't looking. When the opposing player hits back the
     referee sees an calls a personal foul. Trolls work in the same
     way. They anger posters in one thread, then when a newbie
     comes along in a new thread they get the posters to attack them. 
     The newbie then comes away on LookingForAMinds Side.
     *The purpose of this FAQ is to give newbies a clear and concise
     picture of who this troll is.*
     Further the purpose of this to eliminate some newsgroup traffic.
     WantsAMind relies on stirring up a lot of flame wars. Posters 
     can now point to this FAQ to reveal the true nature of this 
     troll and proceed to ignore him. 
     Part of this FAQ that I expect to slowly grow ( it takes time to 
     go over posts and sniff out all the information ) the section on
     NeedsAMind's posts. Thus people will have a clear record of 
     exactly what he said. One that is annotated well enough that it 
     is easy to check the record.

Q1: Who is CrappyMind?
A: He is a burned out dbase programmer named Bryce Jacobs.

Q2: What is ShitForMind?
A: Basically he is a troll who spends most of his time in comp.object.
    His history: For a while he spent his time in comp.lang.perl.misc.
    There he earned his reputation as a troll that other trolls are 
    compared to. ( This guy isn't that bad. Remember "Ain'tGotNoMind" 
    now that was a troll ?) After a while he came to comp.object 
    touting a web page critical of OO. On this page he demonstrated 
    his total ignorance of what OO is by making stupid claims such as
    "OO=GUI". After getting tired of the group he left for 
    approximately a year and a half. In that period he spend his time

    on some object oriented mailing list. Since that time he came back
    to comp.object.

Q3: Why does FriedMind troll?
A: As best as I can figure out, BJ started out life as a dbase 
     programmer.  He failed to keep up with technology and has
     let his career suffer for it. ( It is my belief ) that he blames

     perl and OO for the fate of his career. ( It is also my belief 
     that ) in the beginning he may have been trying to legitimize 
     himself by building a grass roots movement against perl and OO.
     Certainly he uses his posts to refine his arguments by removing 
     the most stupid arguments out. ( Not only does he not say "OO is 
     GUI" anymore. He now denies that he ever said it.
     Certain of his posts reveal a basic insanity  typical of many  
     trolls ie citing the Einstein fallacy. This insanity is often 
     enough for many people to troll. 

Q4: What do I do about IsThereAHintOfMind?
A: There are several things you can try to do.
     You can:
        * Try to engage BJ in constructive debate.
           The key words are "try" and "constructive". Everyone
           who has tried this has gone away in frustration. Not 
           because they lose the argument, but because BJ doesn't 
           want to debate constructively. If a wreckers ball came
           swooping down and smacked him with the truth, he would
           deny it if it was not what he wanted. He does not want to
           engage in rational discussion.
           Several times engage BJ in a discussion where he winds
           up making major concessions. After a while he suddenly
           reverts to his original positions. The others throw up

           their hands and give up. Several times people have tried to
           present case studies and designs 
       * You can killfile him.
          Killfiling such people is often a good idea. I should warn 
          you that often times killfiling is only a partial solution. 
          Often times killfiled posts are quoted in responses.

       * You can ignore him.
          Same as killfiling.	
       * You can try to warn others about BJ.
          There are constantly new people coming on this group asking
          advice about OO. One of BJ's goals is to pervert these 
          peoples thinking. Educating these people can often be a 
          satisfying goal.
          One of the best ways of educating people is to not let BJ 
          drag you into one of his flame wars. That drags you down to 
          his level and leaves people wondering who is right and who 
          is wrong. Instead you can point people to this FAQ which
         will allow people to determine his ( lack of ) character, 
         and judge whether or not they believe anything he has to say.

Q5: What is the "Einstein fallacy"?     
A: The Einstein fallacy at is simplest is:
        Einstein was laughed at  by the orthodoxy.
        Einstein was a genius.
        I am laughed at by the orthodoxy.
        I must be a genius.
     The argument is clearly wrong on the face. For every genius who 
     is looked down on by the orthodoxy, there are thousands of idiots
     who are looked down on by the orthodoxy. ( We all know which
     group BJ belongs in. Of course I expect BJ to reply the genius 
     category. [WRONG!] That is of course the nature of trolls. )	
     one way of stating the Einstein fallacy is "People laugh at me  
     because I am a genius." Of course there is another name for
     the Einstein fallacy. Psychiatrists call it paranoia.

    
Stupid WastedMind quotes.      
( to be significantly expanded )
On functional programming:

Thread: Struggling with OO
Group: comp.object
Date: 5/26/1
>I wish they would pick a different name for "functional programming"
>because it often gets confused with "procedural" or "structural"
>programming.
>
>Any new name suggestions?

Functional programming has had that name for twenty years with no
one complaining about the name. Typical troll behavior to think that
people should change established names just because the troll wants
to. 

On Moderation:

Thread: Perl Criticism 
Newsgroups: comp.lang.perl.misc
Date: 01/06/1999
>
>[P.S. screw those arrogant, lazy mind-police known as 'moderators']

Extremely typical troll behaviour. While moderators do occasionally
get in the way, most people don't demonstrate such general hate
against them. 

On OO is GUI:

Thread: The FlakeyMind/Bryce Jacobs FAQ (v0.1)
Newsgroups: comp.object,comp.lang.perl.misc
Date: 5/29/1
>>     On this page he demonstrated 
>>     his total ignorance of what OO is by making stupid claims such as
>>     "OO=GUI". 


>I NEVER CLAIMED THAT!!!!!!
>THAT IS A FAT LIE!  (Or bad reading on your part)

>Why do you keep stating that same falsehood over and over
>again, even after I corrected it in the past?

It is typical troll behaviour to deny things he said in the past.
Especially when they have said something stupid.
Yet it is clearly on the record.

In the his very first  thread to comp.object  he said:
Thread: Criticism of OO
Newsgroups: comp.object
Date: 1998/04/01 
Message #10

>A: I am the product of the same education process that most of the other
>programmers out there get. Most OOP books focus on GUI's. When they cover
>data handling, they fail to show how OOP is an improvement over table-
>oriented or other methods. If I am uninformed, then so are most programmers.
>If you agree with this, then OOP is doomed because the industry is not
>presenting [training] OOP properly. My alleged ignorance may simply be a
>mirror to a much larger problem.

A defense of why on his site he claims OO is GUI.

Date: 1998/04/01 
Message #15

>> False. OOP has it's roots in systems simulation, this
>> opening assertion suggests that you need to do some
>> serious research.
>
>I did not say it had its ROOTS in GUI's, I said it became popular because of
>GUI's. Who is lacking in the "serious research" now? Birth and growth are
>different.

OK.He's backing off a little, but not much.

Date: 1998/04/03 
Message #41
>> OO's popularity was driven more by business modelling
>> than it was by GUI's. [or hype]

>This is where you and me disagree.

Back to saying "OO is GUI".

Date: 1998/04/09 
Message #732
>>  When I got involved, GUI was not a big focus,
>> and I'm still not sure that OO and GUI have ever been very close
>> bedfellows. 
>
>This may be so if
>you hung around acedemics and technical people, but in manager's mind,
>"Visual", "Component", "Objects", "GUI", "Windows", "Drag-and-drop icons"
>were all lumped together as a "new vision of doing things". This vision may
>not be accurate, but that is the perception that made OO languages a must for
>product pickers.

OK another distinction.
For academics OO is not GUI ( with the insinuation that academics
don't count.
In the real world OO is GUI.

More to come later.



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

Date: Tue, 29 May 2001 16:00:51 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: What does this perl line mean?
Message-Id: <3B140E03.B3DB4746@home.com>

Sultan Mehrabi wrote:
> 
> I was reading over a script someone else wrote and saw this line.
> I can't seem to figure out what it means.
> I know the hashes but what's our exactly?

our is a new keyword in 5.6. It declares a variable to be a valid global
within the enclosing block. For all the details, look up the "our" entry
in the perlfunc manpage.

> Is this a list of hashes?
> 
> our (%console_svr, %console_port, %checkout);

No, it is a declaration of three variables, all of which happen to be
hashes.

-mjc


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

Date: Tue, 29 May 2001 15:10:49 -0700
From: Bryan Coon <bcoon@sequenom.com>
Subject: Re: What does this perl line mean?
Message-Id: <3B141E69.77F3212B@sequenom.com>

Sultan Mehrabi wrote:

> I was reading over a script someone else wrote and saw this line. I can't
> seem to figure out what it means.
> I know the hashes but what's our exactly?
> Is this a list of hashes?
>
> our (%console_svr, %console_port, %checkout);
>
> Thanks in advance for your help.
> -Sultan

It's just a declaration of hashes with our.

Check out perldoc -f our for more info on how 'our' differs from 'my' in
scoping.

B



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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.  

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 V10 Issue 1015
***************************************


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