[8385] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2002 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 2 12:15:46 1998

Date: Mon, 2 Mar 98 09:00:29 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 2 Mar 1998     Volume: 8 Number: 2002

Today's topics:
        CGI,Perl,Access <aitabra@soi.city.ac.uk>
    Re: Conflict in this Newsgroup <lyonsj@bgnet.bgsu.edu>
    Re: Conflict in this Newsgroup (John Moreno)
    Re: Conflict in this Newsgroup (Nathan V. Patwardhan)
        Email processor: Procmail - Mail::Tools - Other ? <Koos_Pol@bigfoot.com>
    Re: Faxing from Perl <mindmore@mindless.com>
    Re: Help me out please! <jdporter@min.net>
    Re: Help me out please! (Nathan V. Patwardhan)
    Re: HELP needed on my perl script!! (Real)
        Help: Seeking cgi and html libs... <patrick@arch.ethz.ch>
    Re: Help: Seeking cgi and html libs... (Mike Stok)
    Re: Home Page Click. <lyonsj@bgnet.bgsu.edu>
    Re: Java's hidden flaw <jdporter@min.net>
        locking files in perl <shankeyp@charlestoncounty.org>
    Re: locking files in perl xewj@odin.sunquest.com
    Re: mSQL troubles <joneil@cks.ssd.k12.wa.us>
    Re: newbie: breaking a line of text into two chunks xewj@odin.sunquest.com
        Off Topic: What's WCSAS? <jensd@cs.tu-berlin.de>
    Re: Perl and the mSQL Interpreter (Nathan V. Patwardhan)
    Re: Problem with "goto" in Perl (Jack Ostroff)
    Re: Regional PUGs (Nathan V. Patwardhan)
        SQL sytax in Perl? Do you know.... <mindmore@mindless.com>
    Re: SQL sytax in Perl? Do you know.... (Mike Stok)
        The F-able BIll GAtes (was: Re: The Ineffable Tom C. (Billy Chambless)
    Re: The Ineffable Tom C. <camerond@mail.uca.edu>
    Re: What does this one-liner do? <jdporter@min.net>
    Re: Why doesn't "tr/\x0D//d" work? (Dave Till)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 02 Mar 1998 14:58:16 +0000
From: Brahim <aitabra@soi.city.ac.uk>
Subject: CGI,Perl,Access
Message-Id: <34FAC907.353EEDA0@soi.city.ac.uk>


--------------CED4187101B2A3A25DC3325B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

I've created a small perl script which inserts data into a Microsoft
Access Database. It works great under MS-DOS but I had this error when I
tried to run it form the Web :
Can't call method "Sql" without a package or object reference

Could somebody help me, please.

Brahim.


--------------CED4187101B2A3A25DC3325B
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
Hi,

<P>I've created a small perl script which inserts data into a Microsoft
Access Database. It works great under MS-DOS but I had this error when
I tried to run it form the Web :
<BR><B>Can't call method "Sql" without a package or object reference</B>

<P>Could somebody help me, please.

<P>Brahim.
<BR>&nbsp;</HTML>

--------------CED4187101B2A3A25DC3325B--



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

Date: Mon, 2 Mar 1998 10:15:52 -0500
From: Jen Lyons <lyonsj@bgnet.bgsu.edu>
Subject: Re: Conflict in this Newsgroup
Message-Id: <Pine.SGI.3.95.980302101346.16405G-100000@sigma.bgsu.edu>

On Sun, 1 Mar 1998, I R A Aggie wrote:

> In article <01bd4536$0f8707a0$7eaa8bcd@space.netusa1.net>, "V.
> Chandrasekhar" <shaker@netusa1.net> wrote:
> 
> + 9. I also suggest that the mini-FAQ be beefed up describing the
> + ground rules better, in a polite tone. 
> 
> This, of course, presumes that the posters who ask FAQs are going to be
> bothered to read this mini-FAQ.

Keep in mind, though, that the mini-FAQ is one document.  The rest of the
FAQs that I've seen mentioned are numerous, and if you're new to Perl, you
may not know where to look.  I agree that the mini-FAQ should be "beefed
up" a bit.

> Given their track record, I don't see this helping any time soon. Moderation
> is the way to go.

It's true, there are some people who ask questions that would show up if
you just look at man perl.  Maybe something like the CGI newsgroup, where
you're sent the mini-FAQ before your post is accepted...?

Jen




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

Date: Mon, 2 Mar 1998 10:21:06 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Conflict in this Newsgroup
Message-Id: <22A2CB51B4D9AA3D.EF72C1AD7E5F2D6B.EB17E9106C49FF21@library-proxy.airnews.net>

<shaker@netusa1.net> wrote:

>   Randal Schwartz <merlyn@stonehenge.com> wrote:
> >
> > >>>>> "Nathan" == Nathan V Patwardhan <nvp@shore.net> writes:
> >
> > Nathan> The fact is that the experts have tried really, really hard to
> > Nathan> preserve the Usenet culture that many of us were a part of in
> > Nathan> its "hey day" and are probably burned out from having done so.
> > Nathan> I don't remember Tom or Randal or anyone else freaking out *at
> > Nathan> all* four or five years ago.
> >
> 
> Despite the 'really, really hard' efforts of the experts to ' preserve the
> Usenet culture that many (...) were a part of in its  "hey day" ',  it has
> NOT worked. Is it possible that this attempt is like tilting at windmills
> ? Doesn't the fact that it has NOT worked tell something ? One can either
> be wistful [and keep on singing a la Archie Bunker, 'when boys were boys,
> and men were men, those were the days'], or figure out something that will
> work in today's environment, when the genie is out of the bottle ?

1) It isn't working because of a flood of people who don't know what
they are doing.

2) They are (mainly) trying their best to fit that flood into it proper
place

3) If they stop trying, then there's two things that can happen - a.
They leave and the new comers are left trying to answer their own
questions, and b. they can go to some kind of moderation.

As for something that will work in today's environment - I propose
moderation via kill files and custom header/sig file.  Anybody posting
without the custom header/sig file get's sent the mini-faq.  Anybody
posting without the custom header/sig file who uses munging doesn't get
a answer unless somebody decides to demunge and answer.

Works like the moderation on alt.dev.null - you've got to do the
required reading before you get any answers.

-- 
John Moreno

X-FAQs-Read: perl, pascal.mac


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

Date: 2 Mar 1998 15:36:07 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Conflict in this Newsgroup
Message-Id: <6dejl7$iku@fridge.shore.net>

shaker@netusa1.net wrote:

: Despite the 'really, really hard' efforts of the experts to ' preserve the
: Usenet culture that many (...) were a part of in its  "hey day" ',  it has
: NOT worked. Is it possible that this attempt is like tilting at windmills ?

Don't worry, we Usenet vets will get our way with moderation, mailing
lists, etc.

: Doesn't the fact that it has NOT worked tell something ? One can either be
: wistful [and keep on singing a la Archie Bunker, 'when boys were boys, and

The fact that it's not worked has to do with being outnumbered by
people who don't take the time to care.  It doesn't mean that we need
to set-aside our values of keeping the newsgroups useful, helpful, to
the point, what have you.

: Again, the world has changed. When the group is small and comes roughly from
: the same background, one can enforce a culture by peer pressure. [I am
: willing to bet that even in those golden days, this was not automatic and

No one has a problem with the changed world.  People have a problem
with other people who don't care to follow the rules.  I've never
bought the "the world has changed, so you must too" argument,
anyways.  Seems to me that a working system (as Usenet was) should be
kept intact.  A system that's not working should be torn down and
started from scratch.  It's very optimistic of me to believe this, but
such a thing seems possible with Usenet.

: If someone else provides an answer, again ignore it ? This may not have been
: how things worked in the past, but we need to find solutions for today's
: environment. The fact that a certain attitude is common in other parts of the

The best solution that I can foresee is a moderated NG.  This is not
because I want to shut people out, but the only way to re-work things
seems to be to start from scratch.  Those who want to learn, share,
discuss, etc., are welcome to attend.  "Users" and the gimme crowd are
not.  I'm sure that *many* of the people who read this NG will move
over the the moderated, NG, but the one-timers and clutter will very
nearly disappear.

: net must tell us to take it into consideration, rather than wishing that it
: will go away.

On the contrary, we're all very certain that the problems with clutter
and noise won't go away.  The last two years have proven this, and
it's certainly not getting any better, no matter whether the messages
to set people straight are kind, firm, soft, hard, angry, rude, etc.

: Randall and the other key Perlers rightly deserve a special place in any Perl
: newsgroup. However, think of this. Someone new gets handed a Perl script at
: work. He goes and buys a couple of books and starts working with the scripts.
: He gets taken by the 'sense of community' touted in the books. He wants to be

Okay, then.  This community is a mutual thing.  If you borrow your
neighbor's hedge-clippers, you give them back.  Most people just want
stuff, then desire to compile this stuff into an executable so that
the code never goes elsewhere.  I'd agree with you about the cheery
tone of books and the mention of community, but I found the
'community' you speak of to be *very* inviting providing that I
followed the rules for being a member.

: a part of it too. In other words,  he wants clpm to be his home too - he does
: not intend to displace Randall from his home. He posts something like: 'This
: is my first Perl program; I am glad it worked". Somebody instantly replies

There have been a few of these postings.  A very, very few.  Although
all of the responses weren't as kind as they could've been[1], a lot of
good suggestions came out of this person posting their code.  Chances
are that the person learned a lot from these critiques.

[1] personally, I'd prefer kind, but ...

: of postings may not have occured (much) at all. But today, does this guy have
: a place in clpm or not ? Make no mistake; one of the attractions of

Yes, this person definitely has a place in clpm -- in my estimation.
If this person follows the rules, gives and takes, etc., they're a joy
to have around (expert or not).

: I suggested beefing up the miniFAQ not because miraculous results will occur
: but because it increases the chances of the desired behavior occuring. Also,

Actally, I thought that this is why they hurried to update the last
faq, but I could be dead-wrong.

--
Nathan V. Patwardhan



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

Date: Mon, 02 Mar 1998 17:23:01 -0500
From: Koos Pol <Koos_Pol@bigfoot.com>
Subject: Email processor: Procmail - Mail::Tools - Other ?
Message-Id: <34FB3145.1E1F@bigfoot.com>

Our department is about to offer internal online services which
-ideally- are requested and *auto-triggered* by email (searching,
copying, downloading, uploading, etc)

Anyone can advise on the best way to process the incoming email?
* Procmail
* Mail::Tools
* Net::POP3

Rather new to unix but good enough on Perl.


-- 
Koos Pol
----------------------------------------------------------------------
S.C. Pol                                           tel: +31 20 3116122
PC Systems Administrator                   email: Koos_Pol@bigfoot.com
Compuware Europe                 PGP public key available upon request

      A little inaccuracy sometimes saves tons of explanation.
                        -- H. H. Munroe


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

Date: Mon, 02 Mar 1998 16:59:57 +0200
From: Fain <mindmore@mindless.com>
To: martin@highway-innovations.com.sg
Subject: Re: Faxing from Perl
Message-Id: <34FAC96D.DA8A085D@mindless.com>




> Dear all,
>
> is there any way I can fax a document/text file in Perl on a win32 based
> NT platform? Maybe I can use an external program or something.
>

Yes... there is a way.go to CGI resources (http://www.cgi-resources.com I
think). After getting there go to the Perl section and then go to the
miscellaneous section and you could see something called perlfax.pl or a
link with a description to a place that has made a way to do this. I just
found it this morning.

I'm at work right now but if you would rather me just send it to you I will
when I get home (My works WAN sucks so it's useless to try to get if for
you right now).

If you do get it on your own please e-mail me and let me know if it worked
because I've been thinking of trying it myself.-
Nathanmindmore@mindless.com

> Any ideas?
>
> Drop me an email : martin@highway-innovations.com.sg





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

Date: Mon, 02 Mar 1998 08:43:14 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Help me out please!
Message-Id: <34FAB772.4BBE@min.net>

sisiro@rocketmail.com wrote:
> 
> I am a newbie to Perl.
> I have to write a script for on-line shopping but don't know what
> functions suit my need.

This sounds like a homework assignment to me.

> The data file is in the format:
> <email addr>|name|item|qty|flag
> Eg:  sisiro@rocketmail.com|sisir|modem|100|O
> 
> I have to :
>    check the email addr ...

Can't be done. Don't even bother trying.

John Porter


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

Date: 2 Mar 1998 15:56:26 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Help me out please!
Message-Id: <6dekra$lrq@fridge.shore.net>

sisiro@rocketmail.com wrote:

: I have to :
:    check the email addr and the item (in their data files) for validity;

Oh dear.  This can't be done.  This question comes up about two times
a week, but no one ever seems to read the archive of past postings to
this NG (http://www.dejanews.com).

--
Nathan V. Patwardhan



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

Date: Mon, 2 Mar 1998 16:27:48 +0100
From: real@earthling.net (Real)
Subject: Re: HELP needed on my perl script!!
Message-Id: <MPG.f64ee64b519af14989687@news.surfnet.nl>

Jason wrote...
> So far I can use perl to identify whether the users are 1st or 2nd years. However, is 
> there a way to use perl to identify if no one is logged onto one or more machines??
[snip] 
> I would really appreciate it if anyone can help me! Thanks!
> 
> Jason

This is how I would parse this text file. Continue from here ...

#!/usr/bin/perl
open(FILE, "<users.txt") || die "stopped";
while (<FILE>)
{
   ChkBlk: {
      /^n7.$/                        && do { $id = $_ ; last ChkBlk };
      /day.*user.*load average/      && do { last ChkBlk };
      /User.*tty.*login.*idle.*what/ && do { last ChkBlk };
      chomp($id);
      $Count{$id}++;
   }
}
close(FILE);
print "n7a: ", $Count{"n7a"}, "\n";
print "n7b: ", $Count{"n7b"}, "\n";
print "n7c: ", $Count{"n7c"}, "\n";

Cheers,
Real


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

Date: Mon, 02 Mar 1998 16:31:39 +0100
From: Patrick Sibenaler <patrick@arch.ethz.ch>
Subject: Help: Seeking cgi and html libs...
Message-Id: <34FAD0DB.41C6@arch.ethz.ch>

Hi all,

I'm currently looking for 2 things:

1. A lib or module that provides functions to dissect html 
   code into its tags. I found some that needed htmlscript,
   but I need one without that.

2. A cgi-lib that can deal with a multipart input that is 
   uploaded (commonly known as 'uploading' through the web).
   Again, there are simple solutions that do this in php, 
   but I need it in perl...

If anyone knows a module or lib that can do one of those 
tasks, please send me a mail.

thanx in advance, 
   patrick./


-- 
---------------------------------------------------------------------------
The trick is to communicate bi-directional in real time and high
resolution
---------------------------------------------------------------------------


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

Date: 2 Mar 1998 15:52:24 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Help: Seeking cgi and html libs...
Message-Id: <6dekjo$qv8@news-central.tiac.net>

In article <34FAD0DB.41C6@arch.ethz.ch>,
Patrick Sibenaler  <patrick@arch.ethz.ch> wrote:

>I'm currently looking for 2 things:
>
>1. A lib or module that provides functions to dissect html 
>   code into its tags. I found some that needed htmlscript,
>   but I need one without that.

You can pick up HTPL::Parser from CPAN might be what you need, it's part
of the libwww bundle.

>2. A cgi-lib that can deal with a multipart input that is 
>   uploaded (commonly known as 'uploading' through the web).
>   Again, there are simple solutions that do this in php, 
>   but I need it in perl...

CGI.pm which is now included in the perl distribution can do this.  If you
don't have a recent enough perl to have CGI.pm automatically then a visit
to CPAN can either get you CGI.pm or the latest perl distribution which
includes CGI.pm, the FAQ and many bug fixes too.

Hope this helps,

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Mon, 2 Mar 1998 10:10:56 -0500
From: Jen Lyons <lyonsj@bgnet.bgsu.edu>
Subject: Re: Home Page Click.
Message-Id: <Pine.SGI.3.95.980302100916.16405F-100000@sigma.bgsu.edu>

On 1 Mar 1998, hymie! wrote:

> In our last episode, the evil Dr. Lacto had captured our hero,
>   me@here.com (steve), who said:
> >On 24 Feb 1998 18:37:33 GMT, petdance@maxx.mc.net (Andy Lester) wrote:
> 
> [attributions lost]
> >>: Does anyone know how to add an element to a page so that when the user
> >>: clicks on it, it becomes their home page?
> 
> >>1) You can't.
> 
> >yes you can 
> 
> My home page is on an ISP paid for by me.  It's written by me.
> It includes facts about me.  It includes links that I like.  I
> advertise it in my sig.
> 
> How can Joe Smith (no offense to anybody named Joe Smith) create
> a web page, and have it be my home page?

Not home page like that.  Home page as in when they start up their
browser, that's the page they see right away.  Of course, I don't know why
anyone would especially want *my* personal page to be their startup page,
but hey, to each his own, right?

Jen
http://www.bgsu.edu/~lyonsj



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

Date: Mon, 02 Mar 1998 09:40:58 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Java's hidden flaw
Message-Id: <34FAC4FA.24CC@min.net>

lvirden@cas.org wrote:
> 
> According to John Porter  <jdporter@min.net>:
> :or three?  But when Sun's marketroids get hold of it....
> :Now look what they're doing to Tcl -- "SunScript".
> :"A Sun development team dedicated to promoting Tcl/Tk as the
> :scripting language for the next generation of enterprise and
> :Internet applications." (sunscript.sun.com)
> 
> 1. The creator of Tcl invented that one.
> 2. The only think relating to Tcl that I blame Sun about is not
>         realizing what they had while they had it.
> 3. Tcl (and SunScript) are no longer a part of Sun Research...

I stand corrected.  I missed the Scriptics announcement!

I certainly don't blame John for taking Tcl solo.  More power
to him.  Here's an illuminating passage from the Scriptics
announcement in SunWorld Online:

    At the time Ousterhout was hired by Sun, Tcl was only
    one of several Internet-related initiatives within the
    company. Of those, one succeeded astronomically: Java.
    Now all of Sun's corporate attention goes to Java, pure
    and simple.

Essentially, John was shown the door. Or, perhaps more nicely,
he was nuzzled out of the nest.

> 2. The only think relating to Tcl that I blame Sun about is not
>         realizing what they had while they had it.

While I'm not saying that Java is better than Tcl, I might
suggest that Sun DID realize what they had.

I see great potential for Tcl; but it will have to change a
lot before I'll start using it.  Specifically, it will have
to become a lot more like perl. With Tcl, this might be
possible.  Java, otoh, is a lost cause imho.  I blame Sun
-- and lots of it.

OTOH, more power to Sun, I say, because they seem to be the
only company left with both the ability and the the resolve
to stand up to The Evil Empire.  (Others might be even more
able, but evidently are supremely inept. 
"Blue skies and sunshine..." )

close(RANT);

John Porter


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

Date: Mon, 02 Mar 1998 10:06:59 -0500
From: Peter Shankey <shankeyp@charlestoncounty.org>
Subject: locking files in perl
Message-Id: <34FACB13.CC43C5FB@charlestoncounty.org>

What is the basic command and syntax to lock files in perl

thanks
pete



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

Date: 2 Mar 1998 15:55:42 GMT
From: xewj@odin.sunquest.com
Subject: Re: locking files in perl
Message-Id: <6dekpu$7cm$1@iggy.sunquest.com>

In article <34FACB13.CC43C5FB@charlestoncounty.org>,
Peter Shankey  <shankeyp@charlestoncounty.org> wrote:
>What is the basic command and syntax to lock files in perl

from the perlfunc manpage:
-----
  flock FILEHANDLE,OPERATION
          Calls flock(2) on FILEHANDLE.  See the flock(2) manpage for
          definition of OPERATION.  Returns TRUE for success, FALSE on
          failure.  Will produce a fatal error if used on a machine that
          doesn't implement either flock(2) or fcntl(2). The fcntl(2) system
          call will be automatically used if flock(2) is missing from your
          system.  This makes flock() the portable file locking strategy,
          although it will only lock entire files, not records.  Note also
          that some versions of flock() cannot lock things over the network;
          you would need to use the more system-specific fcntl() for that.
-----

usage:
  open(FILE,"<somefile") || die "horribly";
  flock(FILE,2); #exclusive lock
  #do some file stuff
  flock(FILE,8); #release
  close(FILE);

>thanks

you're welcome.



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

Date: Mon, 02 Mar 1998 08:38:28 -0800
From: Jerome O'Neil <joneil@cks.ssd.k12.wa.us>
To: Grant Conklin <gconklin@iphysique.com>
Subject: Re: mSQL troubles
Message-Id: <34FAE084.F04B4EEE@cks.ssd.k12.wa.us>

I use mySQL, which is dang near the same thing.  I think your error checking
needs some checking.

Grant Conklin wrote:
------ Build database -----

> # Connect to the database host
> $dbh = Msql->Connect($host);
> if (!$dbh)
> {
>  print "Error connecting to database; $Msql::errstr\n";
> }
>

This is fine.  If $dbh isn't defined, you will get an error.  If it is, all is
well, and we continue to...

> # Identify database to be used
> $dbh->SelectDB($database);
> if (!$dbh)
> {
>  print "Error identifying database; $Msql::errstr\n";
> }

Here we are checking to see if $dbh is defined again, but we already know that
it is.  I think what you want to do is check $Msql::errstr.  If it is defined,
then a problem occurred when you selected your database.Something like:

my($error) = ();
$dbh->SelectDB($database);
$error = $Msql::errstr;
if ($error)
{
 print "Error identifying database; $error\n";
}

Jerome



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

Date: 2 Mar 1998 15:47:23 GMT
From: xewj@odin.sunquest.com
Subject: Re: newbie: breaking a line of text into two chunks
Message-Id: <6dekab$78m$1@iggy.sunquest.com>

In article <34EE18D0.1559581B@xaostools.com>,
Joe Wahrhaftig  <joew@xaostools.com> wrote:
>  Yes I expect to get flamed for this one:

only if you don't ask politely :)

>I've got a database where the entries are as follows
>            item1_name        "comment string for item 1"
>            item2_name        "comment string for item 2"
>                                            ... etc.
>
>I want to take the item_name and "comment about item n" and store them
>in different variables. I tried reading these two entries per line with
>a split as shown below:
>[etc.]

s/^(\S+)\s+(".*")$/$item=$1;$comment=$2;/e;

if you want to skip having the double quotes in $comment, move them
outside the ().



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

Date: 2 Mar 1998 15:46:17 GMT
From: Jens Dengler <jensd@cs.tu-berlin.de>
Subject: Off Topic: What's WCSAS?
Message-Id: <6dek89$cnn$1@news.cs.tu-berlin.de>

This may a bit off topic, but I was looking for the meaning of
WCSAS but didn't found any site, only the PERL FAQ in various
WWW search engines. Can anyone tell me what it stand for and
maybe give me a link?

Greetings, -- jd --


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

Date: 2 Mar 1998 15:40:43 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl and the mSQL Interpreter
Message-Id: <6dejtr$iku@fridge.shore.net>

Stephanie Ray (netnuevo@best.com) wrote:
: I didn't want to use the API because I wanted to use Perl, not C. :-)

No, the API is written in C, but by using the msql module, you can use
Perl to access it![1]  Same with DBD::mSQL!  How about that?  :-)

[1] I'd go into details about XS but I didn't want to confuse the
issue for the moment.

: I guess I have to look into one of the packages, but weren't people using
: Perl/CGI/mSQL a long time before DBD came out?

Sure, and that's why there was Msql.pm!  :-)

Let me know via mail about your flavor of Unix, version of Perl, etc,
and I'll help you as necessary.

--
Nathan V. Patwardhan



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

Date: 2 Mar 1998 15:06:10 GMT
From: jack_h_ostroff@groton.pfizer.com (Jack Ostroff)
To: angyny@interport.net
Subject: Re: Problem with "goto" in Perl
Message-Id: <6deht2$opk1@mascagni.pfizer.com>

In article <34F74AC4.6486@interport.net>, Angy <angyny@interport.net> writes:
> I have a problem with goto in Perl. It looks alike perl can only "goto"
> back to previous lines, but not afterwards lines (correct me if I'm
> wrong). My perl code has 3 parts. In 1st part, I check some error
> conditions, and if true, I need to exit 1st part. Actually I'd rather
> use "goto" to exit 1st part and directly go into 2nd part. But since
> perl seems don't understand goto a label defined afterwards, I have to
> use die, but then I have to put 2nd & 3rd parts in the END {..}, which
> is really inconvenient and not neat. Even DOS batch file can "goto" a
> label defined afterwards. Can anyone help on this?

This is not a perl question - but a basic concept of structured 
programming.  For various reasons which have been debated historically
ad nauseum, "goto" is generally not considered a good way to do what you
want.  What would be advised is to wrap each of your three parts in some
"block" construct, and "exit" that block when appropriate, therefore just
"falling into" the next.

Chapter 9 (Miscellaneous Control Structures) in the Blue Llama might be
a good starting point, as are checking the docs for the "last" statement
and various references to blocks.



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

Date: 2 Mar 1998 15:03:05 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Regional PUGs
Message-Id: <6dehn9$iku@fridge.shore.net>

Holly Sommer (hsommer@micro.ti.com) wrote:

: I was wondering if there are any such beasties out there... and if not,
: whether there might be interest in forming any as such.

Boston.pm.org is one such beastie, perhaps inspired by the New York
Perl Mongers.

--
Nathan V. Patwardhan



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

Date: Mon, 02 Mar 1998 16:40:44 +0200
From: Fain <mindmore@mindless.com>
Subject: SQL sytax in Perl? Do you know....
Message-Id: <34FAC4EC.58DF7ED2@mindless.com>

I'm trying to find a fast way to use SQL (postgress and mSQL in
particular) in a perl script. This is what I have been using:

# Query the database (in SQL), then print to a file ($file) using -o

$file = "/tmp/file.db";
system("/dir/dir/postgres/bin/psql -p 99999 -d mydatabase -o $file -c
\"Select * from MyClass\;\"");

# open $file which now contains what was gotten from the SQL Query
open (DATA2,"$file");
    while (<DATA2>) {
    print "Print out stuff from the SQL query $_\n"; # print $file
    }
    close(DATA2);


It works fine but its long and looks like backwards logic.

Is there any other way to query a SQL database in Perl??
Is there any way that I can eliminate having to write to another file
and then accessing that file to print from the database???

Please help me...

Thanks
- Nathan Fain
mindmore@mindless.com



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

Date: 2 Mar 1998 15:09:15 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: SQL sytax in Perl? Do you know....
Message-Id: <6dei2r$qv8@news-central.tiac.net>

In article <34FAC4EC.58DF7ED2@mindless.com>,
Fain  <mindmore@mindless.com> wrote:
>I'm trying to find a fast way to use SQL (postgress and mSQL in

>Is there any other way to query a SQL database in Perl??
>Is there any way that I can eliminate having to write to another file
>and then accessing that file to print from the database???

If you're using a reasonably up to date perl then you might want to look
at http://www.hermetica.com/technologia/perl/DBI/index.html

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: 2 Mar 1998 15:16:04 GMT
From: billy@cast.msstate.edu (Billy Chambless)
Subject: The F-able BIll GAtes (was: Re: The Ineffable Tom C.
Message-Id: <6deifk$4u2$1@nntp.msstate.edu>

In article <8cd8g6xtkk.fsf@gadget.cscaper.com>, Randal Schwartz <merlyn@stonehenge.com> writes:

|> [2] If I am ever forced to make a choice between learning and using
|> win32, or leaving the computer industry, let me just say it was nice
|> knowing all of you. :-)

Resistance is futile.

You will be amalgamated.
-- 
* "And there _is_ a real world. In fact, some of you
*    are in it right now."  -- Gene Spafford


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

Date: Mon, 02 Mar 1998 09:11:27 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: John <falstaff@lennon.postino.com>
Subject: Re: The Ineffable Tom C.
Message-Id: <34FACC1F.64D89EEC@mail.uca.edu>

[cc'd to J]

John wrote:
> 
> And on this point Tom _has_ lost income. I am the Perl guru at
> work and many people come to me with questions. I suggest different
> books, but _always_ warn people to stay away from "Learning Perl
> on Win32", which is co-authored by Tom C. Tom has posted slams on
> NT and Win32, or posted his kill-file list that includes anything to
> do with Win32. For him to try and profit from Win32 is a dictionary
> definition of Hypocracy.
> 

Unfortunately for your disciples, (IMHO, anyway) LPW32S is the best book
on the subject around, and to uphold your principles you are cutting off
your nose to spite your face (also IMHO).

Cameron (who has been treated nicely by TC when he asks a non-RTFM
question, even though he uses Win95)
camerond@mail.uca.edu


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

Date: Mon, 02 Mar 1998 11:38:30 -0500
From: John Porter <jdporter@min.net>
Subject: Re: What does this one-liner do?
Message-Id: <34FAE086.6EEE@min.net>

Jaime Metcher wrote:
> 
> Abigail wrote:
> >
> > Nope. ($a) = (7, 8, 9) is *not* a scalar assignment. It's a list
> > assignment. It just happens to have a side effect, setting $a to 7.
> > The result of the assignment is the list (7, 8, 9).
> 
> From the Blue Camel p. 93:
> "In all cases, the value of the assignment is the new value of the
> variable".
> 
> How does this map to what you just said?  Isn't the value of the first
> (i.e. rightmost) assignment (7)? 

That sentence refers to assignment to a scalar variable, as in

	( $tmp = $global ) += $constant;

It is also true of list assignment in list context. Consider:

	@a = ( 7, 8, 9 );
	@b = ( ($x,$y) = @a ) x 2;

Does @b get (7,8,9,7,8,9), which is @a x 2?
Or does @b get (7,8,7,8), which is ($x,$y) x 2?
The answer is, the latter, because the value of the
list assignment is the value of the lhs.

The exception to this is when the assignment occurs in
a scalar context, so that in

	$c = ( ($x,$y) = @a );
	$d = ( ($x,$y) = (7,8,9) );

$c gets the number of elements in @a, and
$d gets the number of elements in (7,8,9).

John Porter


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

Date: 2 Mar 1998 11:24:07 -0500
From: davet@angel.uunet.ca (Dave Till)
Subject: Re: Why doesn't "tr/\x0D//d" work?
Message-Id: <6demf7$7lo@angel.uunet.ca>

In article <slrn6fdmth.ij7.Tom.Grydeland@mitra.phys.uit.no>,
Tom Grydeland <Tom.Grydeland@phys.uit.no> wrote:
>On Fri, 27 Feb 1998 12:52:49 GMT,
>Fred Vaughn <spam@no_spam_please.com> wrote:
>> open(INFILE, $ARGV[0] ) || die "Error unable to open filename: $infile $!";
>                                     Did you mean $ARGV[0] here? ^^^^^^^
>
>> while ( $line = <INFILE> )
>
>Hmm, you didn't use -w, did you?

Is "while ($line = <INFILE>)" now considered Bad Perl?
The Camel uses this looping construct rather frequently
(indeed, it sometimes goes whole hog and uses "while (<>)").

Should the goal be to *always* eliminate *all* warning messages
from your code?


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 2002
**************************************

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