Java is my weapon of choice too, but Perl can be a lot of fun.

Little things like this are great:

($m, $t, $w, $th, $f) = @days[1..5];

It takes few lines of code to do that in Java.  Mostly just type
declarations and explicit array index references, not exactly exciting
stuff.

If Java would provide native support for regular expressions I would be the
happiest developer ever -- or at least as happy as the Perl mongers are now.


-David

> -----Original Message-----
> From: tclug-list-admin at mn-linux.org
> [mailto:tclug-list-admin at mn-linux.org]On Behalf Of
> Phillip.J.Crump at WellsFargo.COM
> Sent: Friday, November 09, 2001 8:20 AM
> To: tclug-list at mn-linux.org
> Subject: RE: Learning CGI Database Wizardry (Was Re: [TCLUG] PostgreSQL
> Advocacy (was Re: <TROLL> (was ...)))
>
>
> perl := yuck
> java := good
>
> > -----Original Message-----
> > From:	Thomas Eibner [SMTP:thomas at stderr.net]
> > Sent:	Thursday, November 08, 2001 8:44 PM
> > To:	tclug-list at mn-linux.org
> > Subject:	Re: Learning CGI Database Wizardry (Was Re: [TCLUG]
> > PostgreSQL Advocacy (was Re: <TROLL> (was ...)))
> >
> > On Thu, Nov 08, 2001 at 07:26:18PM -0600, Mark Browne wrote:
> > > I am also trying to get web <-->database thing going.
> > > So far I have got the web form <--->Perl part working; Yippie for CGI.
> > > The cgi-lib code makes this falling-off-a-log simple.
> > >
> > > Now for the Perl<--->database part.
> > > I am actually working on it tonight.
> > > It seem that DBI is the way to go.
> > > If I understand this correctly it works the same for most databases.
> > > I downloaded it last night and am working through the documentation.
> > >
> > > A little working sample code would be nice.
> >
> > use DBI;
> >
> > my $dbh =
> DBI->connect("dbi:mysql:<dbname>","username","password") or die
> > $DBI::errstr;
> >
> > my $sth = $dbh->prepare("select col1,col2 from table where col3 = ?");
> >
> > $sth->execute('col3val');
> >
> > while (my ($col1, $col2) = $sth->fetchrow_array()) {
> >       print "$col1: $col2\n";
> > }
> >
> > $sth->finish();
> >
> > $dbh->disconnect();
> >
> > hope that helps!
> >
> > --
> >   Thomas Eibner <http://thomas.eibner.dk/> DnsZone <http://dnszone.org/>
> >   mod_pointer <http://stderr.net/mod_pointer>
> >
> > _______________________________________________
> > Twin Cities Linux Users Group Mailing List - Minneapolis/St. Paul,
> > Minnesota
> > http://www.mn-linux.org
> > tclug-list at mn-linux.org
> > https://mailman.mn-linux.org/mailman/listinfo/tclug-list
> _______________________________________________
> Twin Cities Linux Users Group Mailing List - Minneapolis/St.
> Paul, Minnesota
> http://www.mn-linux.org
> tclug-list at mn-linux.org
> https://mailman.mn-linux.org/mailman/listinfo/tclug-list