[16950] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4362 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 18 18:06:39 2000

Date: Mon, 18 Sep 2000 15:05:24 -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: <969314723-v9-i4362@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 18 Sep 2000     Volume: 9 Number: 4362

Today's topics:
    Re: 2 Questions <jalexiou@hotmail.com>
    Re: 2 Questions (Greg Comeau)
    Re: 2 Questions <no.junk.please.ber@attcanada.net>
    Re: 2 Questions <no.junk.please.ber@attcanada.net>
    Re: 2 Questions <KBH@nomail.com>
        32-bit perl module not recognized by 64-bit perl bing-du@tamu.edu
    Re: [Q] Two Questions <lr@hpl.hp.com>
    Re: Annoying quotation marks! <lr@hpl.hp.com>
    Re: Assigning hash keys from lists <tim@ipac.caltech.edu>
        Beginner installing Apache on NT4.0 <jedgar@mail.arc.nasa.gov>
    Re: binmode(): How is OS related with "\n"? <dan@tuatha.sidhe.org>
    Re: Can not read arrays from <STDIN> <russ_jones@rac.ray.com>
    Re: change .i to .cpp but not .ii with regexp. (Abigail)
    Re: change .i to .cpp but not .ii with regexp. <NHekman@geo-slope.com>
        Chicago Perl Talks by Damian Conway, October <spug@halcyon.com>
    Re: Comparing two Directories <tim@ipac.caltech.edu>
    Re: Compiling PERL Modules <alian@alianwebserver.com>
        dbi on winNT hao7@yahoo.com
    Re: dbi on winNT <alian@alianwebserver.com>
        dir list of unique items <syarbrou@nospam.enteract.com>
        FileMaker, DBI <kmetcalf@lighthousemarketing.com>
    Re: Finding the width and height of a GIF (Martien Verbruggen)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 18 Sep 2000 14:11:01 -0400
From: "ja72" <jalexiou@hotmail.com>
Subject: Re: 2 Questions
Message-Id: <sscmip14l67f84@corp.supernews.com>

Learing OOP (Object Oriented Programming) with pascal is easier than with
C++. But it is essential
for good programming skill, and it improoves your productivity tenfold. I
would recoment the following
order:

I.  Pascal
    0. Basic flow control (if/then, while, repeat, case)
    1. Functions/Procedures (arguments, var parameters)
    2. Records
    3. Pointers to records
    4. Objects (as replacement for records,inheritance)
    5. Methods (functions for objects,virtual)

II. C++
    0. Basic flow control (if, while, switch)
    1. Functions (arguments, references)
    2. Structures (struct,enum,typedef)
    3. Pointers and References
    4. Classess (class, inheritance)
    5. Methods (friends, virtual, static)

This will allow for direct exposure to OOP in pascal and then associate that
with C++ syntax.
any comments/suggestions ??


"RedX" <RedX@mail.dma.be> wrote in message
news:8q5khb$ek1$1@news.planetinternet.be...
> Start with Pascal. It's an easy to learn language and teaches good
> programming habbits. When you learned the basic's you could switch to C or
> C++ (or other languages).
> Don't bother learning QBasic. it's to limited  to make serious programs.
> Pascal is as easy as QBasic is and a lot more powerful.
>
>
> RedX
>
>
>
> Frankie <frankie@centurytel.net> schreef in berichtnieuws
> 39C5974E.AC51F612@centurytel.net...
> > My apologies for the cross-post and the broad nature of this question.
> > I just can't seem to find the info I want via traditional search
> > engines, including Deja News.  And please, no flames.  I'm not a newbie
> > and am aware I'm on thin ice with the cross and the questions.  Thanks.
> >
> > My question is what programming language would you recommend to a
> > complete beginner in programming?  I've extensive background in various
> > environments, so I'm not going to be terribly uneasy with the comp, I'm
> > just looking for a good start.
> >
> > The second, and virtually hand in hand with the first, is where to go
> > from there and in what sequence.  IOW, I'm thinking (just an example)
> > qbasic to Visual Basic to C to C++ etc?  And yes, I'm going to throw in
> > HTML, but I want to go beyond that.
> >
> > Again, my apologies if this is an inappropriate post.  Or, for that
> > matter, too broad. Any help will be greatly appreciated.  E-mails are
> > welcome (take the ** out per below) but since I'm posing the question, I
> > can check all the Groups also.  TIA
> >
> > --
> > "I do this really moronic thing that the government doesn't want me to
> > do. It is called thinking" - George Carlin
> >
> >
> > Remove * * to reply.
> >
> > -----------------------------------------------------------------------
> > Pursuant to US Code, Title 47, Chapter 5, Subchapter II, ¢227,
> > Any and all nonsolicited commercial E-mail sent to this address
> > is subject to a download and archival fee in the amount of $500.00 US.
> > E-Mailing denotes the acceptance of these terms
> > -----------------------------------------------------------------------
>
>




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

Date: 18 Sep 2000 14:12:40 -0400
From: comeau@panix.com (Greg Comeau)
Subject: Re: 2 Questions
Message-Id: <8q5luo$fdd$1@panix3.panix.com>

In article <8q5khb$ek1$1@news.planetinternet.be>,
RedX <RedX@mail.dma.be> wrote:
>Start with Pascal. It's an easy to learn language and teaches good
>programming habbits. When you learned the basic's you could switch to C or
>C++ (or other languages).

Maybe.  I mean, Pascal tends to bring out structured programming
in a simple procedural language, and that isn't inherently bad.
But enough can be said about alternatives too.

- Greg
-- 
Comeau Computing / Comeau C/C++ ("so close" 4.2.44 betas starting)
TRY Comeau C++ ONLINE at http://www.comeaucomputing.com/tryitout
Email: comeau@comeaucomputing.com / WEB: http://www.comeaucomputing.com


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

Date: Mon, 18 Sep 2000 14:24:22 -0400
From: "Bruce Roberts" <no.junk.please.ber@attcanada.net>
Subject: Re: 2 Questions
Message-Id: <I0tx5.6995$YG5.15587@tor-nn1.netcom.ca>


"RedX" <RedX@mail.dma.be> wrote in message
news:8q5khb$ek1$1@news.planetinternet.be...
> Start with Pascal. It's an easy to learn language and teaches good
> programming habbits. When you learned the basic's you could switch to C or
> C++ (or other languages).

I'm curious, why switch to C or C++?




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

Date: Mon, 18 Sep 2000 14:36:50 -0400
From: "Bruce Roberts" <no.junk.please.ber@attcanada.net>
Subject: Re: 2 Questions
Message-Id: <octx5.6996$YG5.15389@tor-nn1.netcom.ca>


"ja72" <jalexiou@hotmail.com> wrote in message
news:sscmip14l67f84@corp.supernews.com...

>
> I.  Pascal
>     0. Basic flow control (if/then, while, repeat, case)
>     1. Functions/Procedures (arguments, var parameters)
>     2. Records
>     3. Pointers to records
>     4. Objects (as replacement for records,inheritance)
>     5. Methods (functions for objects,virtual)

I'd suggest switching 4&5 with 3&4. Objects have become a fundamental
structure in programming. IMO one shouldn't view them as a replacement for
records but as a principal language construct in their own right. In fact,
while historically records came first, records can be seen as nothing more
than objects without methods.

I'd also suggest the addition of 0b, Basic Data Structures - Boolean, char,
string, integer, floating point, enumerated types, sets, and sub-ranges.
Then expand the new 4&5 (records & pointers) to Intermediate Data
Structures - arrays, records, pointers, and possibly variants.





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

Date: Mon, 18 Sep 2000 17:29:16 -0400
From: "KBH" <KBH@nomail.com>
Subject: Re: 2 Questions
Message-Id: <8q61gd$36sq$1@newssvr05-en0.news.prodigy.com>


Beginning program skills should be developed with something that does not
cost $500 to $800. So "oldmsdos" has QBasic included with DOS, PowerBasic
has a DOS Basic (over a hundred dollars), TrueBasic has a $40 Basic, there
are a couple of shareware Basics, Linux includes a C/C++ compiler, Borland
has a free C++ compiler (that really uses one of their add-on products over
a hundred dollars), the Java SDK is a free download, assemblers are
available, and many other sharewares are available. And there are learning
editions  and academic editions of VB.

> My apologies for the cross-post and the broad nature of this question.
> I just can't seem to find the info I want via traditional search
> engines, including Deja News.  And please, no flames.  I'm not a newbie
> and am aware I'm on thin ice with the cross and the questions.  Thanks.
>
> My question is what programming language would you recommend to a
> complete beginner in programming?  I've extensive background in various
> environments, so I'm not going to be terribly uneasy with the comp, I'm
> just looking for a good start.
>
> The second, and virtually hand in hand with the first, is where to go
> from there and in what sequence.  IOW, I'm thinking (just an example)
> qbasic to Visual Basic to C to C++ etc?  And yes, I'm going to throw in
> HTML, but I want to go beyond that.
>
> Again, my apologies if this is an inappropriate post.  Or, for that
> matter, too broad. Any help will be greatly appreciated.  E-mails are
> welcome (take the ** out per below) but since I'm posing the question, I
> can check all the Groups also.  TIA
>
> --
> "I do this really moronic thing that the government doesn't want me to
> do. It is called thinking" - George Carlin
>
>
> Remove * * to reply.
>
> -----------------------------------------------------------------------
> Pursuant to US Code, Title 47, Chapter 5, Subchapter II, ¢227,
> Any and all nonsolicited commercial E-mail sent to this address
> is subject to a download and archival fee in the amount of $500.00 US.
> E-Mailing denotes the acceptance of these terms
> -----------------------------------------------------------------------




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

Date: Mon, 18 Sep 2000 18:03:56 GMT
From: bing-du@tamu.edu
Subject: 32-bit perl module not recognized by 64-bit perl
Message-Id: <8q5ldr$11$1@nnrp1.deja.com>

Our platform is IRIX64 switch 6.5 10181058 IP27. It has 32bit Perl
(/usr/local/bin/perl) installed by default.  We got bad compilation
errors when installing DBD::Oracle.  So we installed 64-bit Perl.  Then
DBD::Oracle and DBI.pm were installed successfully.

/usr/local/bin/perl points to perl5.00404 and /usr/freeware/bin/perl64
points to perl5.00503-n64.

In order to use DBI.pm and DBD::Oracle, I have to invoke 64-bit Perl
(#!/usr/freeware/bin/perl64) in my Perl script.  My script also needs
some other modules which insalled under 32-bit Perl, like Digest::MD5,
Net::LDAP, etc..

Seems to me that 64-bit Perl and 32-bit Perl do not recognize each
other's modules because the following script gives this error:

Can't locate loadable object for module Digest::MD5 in @INC (@INC
contains: /usr/share/lib/perl5/site_perl
/usr/freeware/lib/perl5/site_perl/5.005/irix-64
/usr/freeware/lib/perl5/5.00503/irix-64
/usr/freeware/lib/perl5/5.00503
/usr/freeware/lib/perl5/site_perl/5.005/irix-64
/usr/freeware/lib/perl5/site_perl/5.005
/usr/freeware/lib/perl5/sgi_perl/irix-64
/usr/freeware/lib/perl5/site_perl .) at ./z.
pl line 13
BEGIN failed--compilation aborted at ./z.pl line 7.


===========================
#!/usr/freeware/bin/perl64

use lib qw(/usr/share/lib/perl5/site_perl
/usr/freeware/lib/perl5/site_perl/5.005/irix-64);

use DBI;
use DBD::Oracle

use Digest::MD5;
use Net::LDAP;

print "test\n";
exit;
===========================

If I change the above script to invoke 32-bit Perl like this:

=========================
#!/usr/local/bin/perl

use lib qw(/usr/share/lib/perl5/site_perl
/usr/freeware/lib/perl5/site_perl/5.005/irix-64);

use DBI;
use DBD::Oracle

use Digest::MD5;
use Net::LDAP;

print "test\n";
exit;
===========================

Then the error becomes:

Can't
load'/usr/freeware/lib/perl5/site_perl/5.005/irix-64/auto/DBD/Oracle/Ora
cle.so' for module DBD::Oracle: 15381750:/usr/local/bin/perl: rld: Fatal
Error: Cannot Successfully map soname
'/usr/freeware/lib/perl5/site_perl/5.005/irix-64/auto/DBD/Oracle/Oracle.
so' under any of the filenames
/usr/freeware/lib/perl5/site_perl/5.005/irix-64/auto/DBD/Oracle/Oracle.s
o  at /usr/share/lib/perl5/irix-n32/5.00404/DynaLoader.pm line 168.

 at ./z.pl line 16
BEGIN failed--compilation aborted at ./z.pl line 5.

Anybody has ever experienced this kind of problem?  Any help would be
greatly appreciated.

Bing



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


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

Date: Mon, 18 Sep 2000 13:55:46 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: [Q] Two Questions
Message-Id: <MPG.1430212866ad664b98ad82@nntp.hpl.hp.com>

In article <Rtox5.142$gm6.7539@nnrp4.clara.net> on Mon, 18 Sep 2000 
14:05:03 +0000, Paul Taylor <pap@sotonians.org.uk> says...
> > 	1- What will happen if I specify a number like 0.123 or
> >            00.123. As far as I understand, the numbers that start with
> > 	   0 in Perl are treated as octal numbers whereas these
> > 	   numbers are floating point decimal format numbers.
> 
> In the case of 0.123, Perl will treat your value as a standard float.
> 
> It's a leading (superfluous-looking) zero that 
> Perl looks out for in octal numbers.
> 
> Your second example 00.123, gets reported as 
> 123.0000 when printed as a decimal float.
> 
> Off-hand, I don't know why this happens.  Perhaps some of the experts
> can enlighten us.

I would characterise this as a DWIM failure.

The input 00.123 is parsed as '00' . '123' (concatenation), which is 
then evaluated as the decimal integer 00123, which is 123, because the 
leading 0 indicates octal for a literal string only.

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

print 0 + (00.123);
print 0 + '00.123';

__END__

Output:

123
0.123

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


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

Date: Mon, 18 Sep 2000 12:55:13 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Annoying quotation marks!
Message-Id: <MPG.143012f8e3f6f6c098ad80@nntp.hpl.hp.com>

In article <dd8x5.5576$6T1.80148@news2-win.server.ntlworld.com> on Sun, 
17 Sep 2000 19:38:46 +0100, Tigz <tigz@ntlworld.com> says...
> Thanks evryone I have sorted the fonts out now :)
> 
> But i require to change the "Send!" and "logoff" buttons, in to text link,
> how could i do this?

I will help you to the degree of showing how this code is properly 
written in Perl.  That should make it a lot easier for you to fix.

> here is the code:
> 
>   print "\<CENTER\>\<TABLE CELLSPACING=0 CELLPADDING=0\>\n\<TR\>\n\<TD\>\n";
>   print "\<nobr\>\<FORM ACTION=\"$ENV{'SCRIPT_NAME'}\"
> METHOD=\"POST\"\><b\>Message\:\n\</b\><input name=username type=hidden
> value=\"$formdata{'username'}\"\>\n";
>   print "\<input name=room type=hidden value=\"$formdata{'room'}\"\>\n";
>   print "\<input type=text name=message size=35\>\n";
>   print "\<input type=submit value=\"Send!\"\>";
>   print "\</form\>\</nobr\>\n\</TD\>\n\<TD\>\n";
>   print "\<nobr\>\<FORM ACTION=\"$ENV{'SCRIPT_NAME'}\"
> METHOD=\"POST\"\>\<input name=username type=hidden
> value=\"$formdata{'username'}\"\>\n";
>   print "\<input name=room type=hidden value=\"$formdata{'room'}\"\>\n";
>   print "\<input name=logoff type=hidden value=1>\n";
>   print "\<input type=hidden name=message value=\"Has\ just\ left the
> chatroom\!\"\>\n";
>   print "\<input type=submit value=\"Logoff\"\>";
>   print "\</form\>\</nobr\>\n\</TD\>\n\</TR\>\n\</TABLE\>\</CENTER\>\n";

    print <<HTML;
<CENTER><TABLE CELLSPACING=0 CELLPADDING=0>
<TR>
<TD>
<nobr><FORM ACTION="$ENV{SCRIPT_NAME}" METHOD="POST">
<b>Message:</b>
<input name=username type=hidden value="$formdata{username}">
<input name=room type=hidden value="$formdata{room}">
<input type=text name=message size=35>
<input type=submit value="Send!">
</form></nobr>
</TD>
<TD>
<nobr><FORM ACTION="$ENV{SCRIPT_NAME} METHOD="POST">
<input name=username type=hidden value="$formdata{username}">
<input name=room type=hidden value="$formdata{room}">
<input name=logoff type=hidden value=1>
<input type=hidden name=message value="Has just left the chatroom!">   
<input type=submit value="Logoff">
</form></nobr>
</TD>
</TR>
</TABLE></CENTER>
HTML

Not one backslash in the darned thing!

> Thanks

You're welcome.

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


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

Date: Mon, 18 Sep 2000 13:23:44 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: Assigning hash keys from lists
Message-Id: <39C679D0.81DC27F8@ipac.caltech.edu>

Ala Qumsieh wrote:
> 
> This came up a couple of days ago.
> 
> We have strings of the form:
> 
>         key1.key2.key3.key4 = val1
>         key1.key2.key5      = val2
> etc ..
> 
> We would like to use all the keys on the left hand side of the equal
> sign (separated by dots) as multiple keys of an anonymous hash with the
> value appearing on the right of the equal sign:
> 
>         $hash->{key1}{key2}{key3}{key4} = val1;
>         $hash->{key1}{key2}{key5}       = val2;
> 
> What is the "niftiest" way to do that?


my $hash = {};

my $line = "key1.key2.key3.key4 = val1";
my ($keys,$val) = split(/\s*=\s*/,$line);
my @keys = split(/\./,$keys);
my $ref = $hash;

for (@keys[0..($#keys-1)])  {
    $ref = $ref->{$_} = ! exists $ref->{$_} ? {} : $ref->{$_};
}
$ref->{$keys[-1]} = $val;

print "$hash->{key1}{key2}{key3}{key4}\n"; # Prints "val1"

--

-- Tim Conrow         tim@ipac.caltech.edu                           |


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

Date: Mon, 18 Sep 2000 11:46:23 -0700
From: "Joe Edgar" <jedgar@mail.arc.nasa.gov>
Subject: Beginner installing Apache on NT4.0
Message-Id: <8q5nsv$mo9$1@sun500.nas.nasa.gov>

I'm installing the Apache web server on my NT4.0.  I've got everything
working except for the cgi-bin.  I have Perl installed and have my scripts
pointing to it and have the permissions set correctly.  But for some reason
my scripts are read instead of executed by Apache.  Some one told me their
was something you have to change with the setup of the NT, but he didn't
know what it was.  Is there something more I need to do with my OS?
Below is the string as it appears in both my httpd.conf and
httpd.conf.default files
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the
client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "d:/Program Files/Apache Group/Apache/cgi-bin/"

Any help would be appreciated..
thanks,
Joseph Edgar





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

Date: Mon, 18 Sep 2000 21:18:18 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: binmode(): How is OS related with "\n"?
Message-Id: <uEvx5.15163$CW2.203353@news1.rdc1.ct.home.com>

Bart Lateur <bart.lateur@skynet.be> wrote:
> Tim Hammerquist wrote:

>>> No, you forget about the side effect on PC.
>>
>>How am I wrong in this?  I said "*nix won't care one way or another."
>>Since when did PC (which I interpreted as DOS/Windoze) come under *nix?

> If you don't care about anything but *nix, you might just as well forget
> about binmode(). It helps in writing cross-platform code, in particular:
> code also targetted to PC. AFAIK binmode() is a noop on every other
> platform. (I don't know about VMS.)

binmode() on VMS throws perl into a real low-level "read the
bytes" mode. With certain types of files it can cause a real problem, as
you take a step under the normal filesystem code. VMS has a full
record-oriented file system, and going binmode will get you all he
metadata for the records instead of letting RMS interpret it. (VMS has the
equivalent of the Berkley DB package built into the filesystem--imagine
what happens if you open an xDBM or DB database with perl's normal
open...)

					Dan


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

Date: Mon, 18 Sep 2000 16:14:03 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Can not read arrays from <STDIN>
Message-Id: <39C6859B.CEA6D47B@rac.ray.com>

Abigail wrote:
> 
> If you're getting a better OS, why settle for some flavour of UNIX?
> Get VMS.
> 

I'm sure that you really meant MVS, right?

-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: 18 Sep 2000 18:51:11 GMT
From: abigail@foad.org (Abigail)
Subject: Re: change .i to .cpp but not .ii with regexp.
Message-Id: <slrn8scouq.5fq.abigail@alexandra.foad.org>

FX (FX@hasnomail.com) wrote on MMDLXXV September MCMXCIII in
<URL:news:8q5hli$q0r$1@front5.grolier.fr>:
// 
// I read the perlre.html and it says : $   Match the end of the line
// Where should I put it ?????


Eh, where do you think you should put? Where do you want to match the
end of the line?



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
#    A monk laughs. A duck
#    nesting in a maple tree.
#    A pair of doves cooing.


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

Date: Mon, 18 Sep 2000 14:22:51 -0600
From: "Nathaniel Hekman" <NHekman@geo-slope.com>
Subject: Re: change .i to .cpp but not .ii with regexp.
Message-Id: <XRux5.41$Mw.1119@read1>

Abigail <abigail@foad.org> wrote in message
news:slrn8scouq.5fq.abigail@alexandra.foad.org...
> // I read the perlre.html and it says : $   Match the end of the line
> // Where should I put it ?????
>
>
> Eh, where do you think you should put? Where do you want to match the
> end of the line?

(pssst:  if FX knew the answer, s/he probably wouldn't have asked the
question, no?  we were all newbies at one time.)





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

Date: 18 Sep 2000 18:11:00 GMT
From: Seattle PERL Users Group <spug@halcyon.com>
Subject: Chicago Perl Talks by Damian Conway, October
Message-Id: <8q5lrk$lag$1@brokaw.wa.com>
Keywords: damian conway OOP perl parsing quantum computing consultix


I've attached an announcement regarding some presentations
to be made in Chicago by Dr. Damian Conway, of Australia's
Monash University, in early October.  One is a free talk on
Quantum Computing that was given at "The Perl Conference 4.0"
in Monterey earlier this summer, and the others are fee-based
professional training seminars dealing with "Object-Oriented
Perl" and "Text Parsing".

The 10% deadline for obtaining the tuition discount on the
fee-based seminars has been extended to this Friday, 9/22,
in the hope of rapidly attracting a few more participants.

Full details can be found at http://www.consultix-inc.com

-Tim
==========================================================
|  Tim Maher, Ph.D.           Tel: (206) 781-UNIX        |
|  SPUG Founder & Leader      Email: spug@halcyon.com    |
|  Seattle Perl Users Group   HTTP: www.halcyon.com/spug |
==========================================================


                       "Quantum Superpositions"
                           by Damian Conway
                          Chicago, 10/8/2000

Dr. Damian Conway, celebrated Perl Guru and author of "Object
Oriented Perl", will be in Chicago in early October, continuing
his Perlish rampage across America that began last spring.

He'll be giving a free talk to the Chicago Perl Mongers on
October 8th, from 3-5pm, in the CitiBank Tower, entitled "Quantum
Superpositions and the First Virtue".

Yes, this is the stupefyingly comical yet technically inspirational
talk made famous at this summer's YAPC and TPC 4.0 conferences.
Damian's offical abstract of the talk follows below, but here's
what Steven Lembark of Chicago.pm had to say about it:

  > You will get to see Damian Conway explain how to adapt quantum
  > computing to Perl, and vice versa. Along the way, he'll touch
  > on confectionary physics, parallel programming, motor racing,
  > ancient Latin, winter sports, advanced OO, modern German, cruelty 
  > to animals, and the *original* Copenhagen.pm.

You can read attendee reviews of the SPUG presentation of this talk
at the SPUG web site, http://www.halcyon.com/spug.

Send email to Steven Lembark (lembark@wrkhors.com) of Chicago.pm
for more details on this free Chicago talk by Dr. Damian Conway.


  * * *  October Perl Seminars in Chicago, by Damian Conway  * * *

Dr. Damian Conway will be presenting two fee-based training seminars
in Chicago from 10/9-10/11, entitled "Advanced Object Oriented Perl"
and "Beyond Regexes: Text Parsing with Perl Modules".

These seminars are being organized through Consultix, which is the
contact for additional course information and registration services.
There's a 10% discount for those who register by 9/22 (which proves
that laziness is not *always* a virtue! 8-).

Detailed information on Damian Conway's October Perl Seminars is
available at: http://www.consultix-inc.com

*========================================================================*
| Dr. Tim Maher, CEO, Consultix       (206) 781-UNIX/8649;  ask for FAX# | 
| Email: tim@consultix-inc.com        Web: http://www.consultix-inc.com  |
|Training- TIM MAHER: Unix, Perl  DAMIAN CONWAY: Adv. Perl, OOP, Parsing |
|CLASSES: 10/9: Adv OO-Perl/Parsing  10/16: Int. Perl  10/23 Perl + CGI  |
*========================================================================*


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

Date: Mon, 18 Sep 2000 12:05:39 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: Comparing two Directories
Message-Id: <39C66783.19171DD2@ipac.caltech.edu>

digikidd@sega.net wrote:
> 
> Here is what I am trying to do and was hoping someone might have an
> easier solution:

Personally, I could have used a brief, complete description of what you want and
how what you're doing now is failing. Forcing me to read your code to deduce all
that is tedious.

More comments below, but first:

- Very likely you can make good use of the Find::File module. If so,
  your time is better spent learning to use that than reinventing
  such oft-used code.
- A careful reading of the perlstyle man page would be good for you, 
  IMHO.
- Put $! in your 'die' error messages.
- You use variables that are not declared as lexicals (C<my ...>). If   
  that's because they were declared before the sample code, fine, but 
  otherwise these are all global variables. This is suboptimal. Put in
  C<my (@bdfFiles,@srcCodes, ...)>.

> 
> PART 1
> ##Basically I am reading two directories and populating arrays with
> ##the filnames in those directories.
> foreach $src(@srcCodes) {
>    #initialize the bdf array
>    @bdfFiles = ();
>    if (-d "$clientDir/$src") {

foreach my $src (grep -d $_, @srcCodes) { # Keep only directories

will make the if(-d ...) unecessary and (I think) make your code easier to read.

>       opendir SRC, "$clientDir/$src" or die("Error:\n");
>       opendir BDF, "$clientDir/$srcBdfDir" or die("Error:\n");
>       @srcFile = readdir(SRC);

@srcFile = grep ! -d $_, readdir(SRC); # Keep only files

(I'm tempted to say you should check for errors on that readdir, but I'm not
sure what errors can occur on a readdir.)

> 
>       foreach $bdfFile (readdir(BDF)) {

foreach my $bdfFile (grep ! -d $_, readdir(BDF)) {

Grep is your friend.

>          if ($bdfFile =~ /.bdf$/) {
>             push(@bdfFiles,$bdfFile);
>          }
>          else{
>             if ($bdfFile =~ /.inx$/) {
>                system("rm","-f","$clientDir/$srcBdfDir/$bdfFile");

Is there something you don't like about the 'unlink' system call in this
context? Or checking the return code? Or the 'elsif' keyword?
 
Just asking ... 

>             }
>          }
>    }
>    shift(@srcFile);
>    shift(@srcFile);

Unecessary if you use grep as I did above.

>    if (($#bdfFiles + 1) ne 0) {

More commonly written as C<if(@bdfFiles) { ...>.

>       ##THIS IS A ROUTINE THAT WILL COPY FILES TO DIFFERENT
>       ##DIRECTORIES IF THERE ARE MATCHING FILENAMES IN EACH
>       ##DIRECTORY.
>       copyFiles(\@srcFile,\$srcOutDir,\$clientKey,\$src,
>                 \$clientDir,\@bdfFiles,\$srcBdfDir);

Passing refs of the arrays is fine, but why are you passing refs to the scalars?
Doesn't really seem necessary.

>    }
>    closedir(SRC);
>    closedir(BDF);

(Check return codes here too, for maximum safety? Not sure there's any point.)

> }
> 
> ##THIS COPYFILES SUB IS WHERE I AM STUMPED.
> sub copyFiles(){

The '()' declares this to be a subroutine that takes no arguments. That's not
wqhat you want. Remove them.

> 
> ##I AM PASSING THE ARRAYS OF FILENAMES FROM THE DIRECTORIES ABOVE
> ##AND WANT TO BE ABLE TO COMPARE THE SRC DIR TO THE BDF DIR. THE FILE
> FORMAT IS:
> 
> SRC
> 1234.txt
> BDF
> 1234.bdf
> 
> ##SO IF THE NUMERIC PORTION OF THE FILES MATCH THEN I WANT TO DO
> ##SOMETHING.
> 
> Any ideas would be greatly appreciated.

Ideas? OK:

- Read perlre, 'perldoc -f grep', 'perldoc -f my', perlref, perlsub, 
  perlvar.
- Read perlfaq4 "How can I tell whether a list or array contains a 
  certain element?".
- Look at the File::Copy module.
- After you've done some reading, figure out what this does (subtested):

sub copyFiles {
  my ($srcref,$bdfref) = @_; # Ignoring other params for now ...
  my %bdf;

  @bdf{grep s/^(\d+)\.[^.]+$/$1/,my @bdfcopy = @$bdfcopy} = @$bdfref;
  for (@srcfiles) {
	next until /^(\d+)\.[^.]+$/ && $bdf{$1};
	# Copy $_ and/or $bdf{$1} as desired.
	...
  }
 ...
}

--

-- Tim Conrow         tim@ipac.caltech.edu                           |


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

Date: Mon, 18 Sep 2000 23:14:32 +0200
From: Alain BARBET <alian@alianwebserver.com>
Subject: Re: Compiling PERL Modules
Message-Id: <39C685B8.BF907672@alianwebserver.com>

Hi,

If you have Win + ActiveState, run ppm to install module. (hit 'ppm' and
'help' in dos box).
For install Net::FTP, you must do: install libnet at prompt of ppm

HTH,
--
Alain & Estelle BARBET
http://www.alianwebserver.com


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

Date: Mon, 18 Sep 2000 18:26:39 GMT
From: hao7@yahoo.com
Subject: dbi on winNT
Message-Id: <8q5mo2$1rj$1@nnrp1.deja.com>

Hi all,
i try to install dbi1.13 on winnt, activeperl.  I use ppm instead of
make.  I follow instructions at activeperl.com to set
HTTP_proxy=myproxyserver because i am behind firewall.  but i got this
error message when do 'ppm,
install dbi'HTTP POST failed: 403 (Forbidden), in SOAP method call
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>403 Forbidden</TITLE>
</HEAD><BODY>
<H1>Forbidden</H1>
You don't have permission to access http://www.active
rver.plex?class=PPM::SOAPServer
on this server.<P>
</BODY></HTML>
 at h:/Perl/site/lib/PPM/SOAPClient.pm line 222

any help would be appreciated.  Thanks




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


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

Date: Mon, 18 Sep 2000 23:06:46 +0200
From: Alain BARBET <alian@alianwebserver.com>
Subject: Re: dbi on winNT
Message-Id: <39C683E6.4F6AB752@alianwebserver.com>

Hi,

I found this, may be it's can help you:
http://www.activestate.com/Products/ActivePerl/docs/faq/ActivePerl-faq2.html#ppm_and_proxies
--
Alain & Estelle BARBET
http://www.alianwebserver.com


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

Date: Mon, 18 Sep 2000 15:04:04 -0500
From: Steve . <syarbrou@nospam.enteract.com>
Subject: dir list of unique items
Message-Id: <b1tcsskagj8mc2dhltnc91qhgpu1k23n4c@4ax.com>

I usually get a list of filenames without their extensions by doing
something like:

sub backwards { $b cmp $a; }
opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
@dots = grep ! /^\.\.?$/, readdir(DIR);
closedir DIR;

I now have a bunch of files in a directory, of type html and gif, say
like:

20000806.html
2000080600.gif
2000080601.gif
2000080602.gif
2000080603.gif
20000806_01_b.html
20000806_02_b.html
20000806_03_b.html
20000806_04_b.html
20000806_05_b.html
20000806_06_b.html
20000806_07_b.html
20000806_t.html
20000813.html
2000081300.gif
2000081301.gif
2000081302.gif
2000081303.gif
2000081304.gif
20000813_01_b.html
20000813_02_b.html
20000813_03_b.html
20000813_04_b.html
20000813_05_b.html
20000813_06_b.html
20000813_07_b.html
20000813_t.html

How would I get into @dots, just the following, 20000806.html and
2000813.html and all other unique like it as time goes by?  Thanks.

Steve

Newsgroup replies preferred.  Remove nospam when replying thru email


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

Date: 18 Sep 2000 20:08:02 GMT
From: kevin metcalf <kmetcalf@lighthousemarketing.com>
Subject: FileMaker, DBI
Message-Id: <39C6767F.C1C71441@lighthouseNOTmarketingNOT.com>

I did a comprehensive search on CPAN and was unable to come up with a
way to use perl to make changes to my filemaker database.  Anybody out
there have a solution to this problem?  BTW:  I did a search on the last
2235+ messages of this news group, but did not see anything remotly
resembling this topic.  While on the CPAN site I did see a refrence to
the DBI::ODBC by jeff Urlwin, but from the readmes it isn't a solution
due to the platform limitation.  That's the real kicker, it's on a
Macintosh G4 server.  It's for a small group called @ONE who are working
off a grant from the california state chancelor's office and they don't
have the cashflow to upgrade to something like Oracle, etc.  Any
responses appriciated.

Kevin



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

Date: Mon, 18 Sep 2000 21:56:31 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: Finding the width and height of a GIF
Message-Id: <slrn8sd3rt.2cp.mgjv@verbruggen.comdyn.com.au>

On 18 Sep 2000 18:26:41 +0200,
	Gisle Aas <gisle@ActiveState.com> wrote:
> mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> 
> > I never bothered downloading it, because it simply looks too immature :)
> 
> I never got around to develop if further because it already does what
> I need myself.  I use it mostly for extracting time stamps and for
> keeping track of what digital camera models my friends have.
> 
> I don't think it has any problems with finding the dimensions of
> images.  It can also do things that Image::Size can't, like telling
> you the size of every frame in an animated GIF.

Might be a good idea to put that (slightly more explicitly) in the
readme as well. The README is normally the only thing I read of a
module before I decide to download or not bother, and I suspect many
people do that. I gathered from the README that you allowed multiple
_somethings_ to be queried, but since it didn't mention any
multiple-frame formats, I figured it was a future idea. Now I'll have
to download to have a better look at it :)

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | We are born naked, wet and hungry.
Commercial Dynamics Pty. Ltd.   | Then things get worse.
NSW, Australia                  | 


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

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


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