[17242] in Perl-Users-Digest
Perl-Users Digest, Issue: 4664 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 19 14:10:31 2000
Date: Thu, 19 Oct 2000 11:10:19 -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: <971979018-v9-i4664@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 19 Oct 2000 Volume: 9 Number: 4664
Today's topics:
Re: Probably a very simple question, but I'm confused.. <dj.peppone@gmx.net>
Re: Problem with array nobull@mail.com
Re: Problems accessing a mysql DB using DBI <mc@backwoods.org>
Re: Question: DBI or DF_file? <ddunham@redwood.taos.com>
Re: Regex for matching e-mail addresses <james@NOSPAM.demon.co.uk>
running perl program in the background rameshdorai@my-deja.com
Re: Search, pad, replace (Jerome O'Neil)
Re: Search, pad, replace ollie_spencer@my-deja.com
Re: string extraction (Craig Berry)
Re: using alerts whoever@wherever.com
what is 'Subroutine NULL'? bing-du@tamu.edu
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 19 Oct 2000 17:21:25 +0200
From: Alexander Nietzschmann <dj.peppone@gmx.net>
Subject: Re: Probably a very simple question, but I'm confused..Perl on NT
Message-Id: <39EF1175.E63FA6D3@gmx.net>
Hi Mike,
> $login = &NTLoginName;
in this case, the perl interpreter expects a function called
"NTLoginName" in YOUR script, if You don't tell perl "use Win32"
first.
> but when I try that I get undefined subroutine in &main::NTLoginName.
This is the result.
> If I try $login = Win32::LoginName() it works, whether or not I
With this line, You tell perl to use the function "LoginName()" which
is contained in package "Win32".
Have You ever tried
use Win32;
[ blahblah ... ]
$LOGIN = LoginName;
> this point. Is it maybe a problem with the difference between
> ActiveState's version and the Perl5 for Win32 that the book is based
> on as far as why the &LoginName syntax doesn't work?
No.
> How can I determine what functions are built-in? I still haven't been
> able to find either a list or how to find them. I even downloaded the
> source code, but I'm even more lost there.
Try typing "perldoc perlfunc" at the command prompt. Further, there's
an excellent HTML-Documentation in ActiveState's Perl.
Greets, Alex
------------------------------
Date: 19 Oct 2000 17:50:07 +0100
From: nobull@mail.com
Subject: Re: Problem with array
Message-Id: <u9bswgpygw.fsf@wcl-l.bham.ac.uk>
Giuseppe Monteleone <monte@sorint.it> writes:
> Subject: Problem with array
I cannot understand the connection between the subjct line and the
question.
> I write a script that convert a decimal number in binary,
See FAQ: "How do I convert bits into ints?"
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 19 Oct 2000 13:01:26 -0400
From: MC <mc@backwoods.org>
Subject: Re: Problems accessing a mysql DB using DBI
Message-Id: <39EF28E6.BFB15D36@backwoods.org>
you also need mySQL server installed if you are accessing a local database,
which it appears is the case. I had the same problem recently.
www.mysql.com
MC
MAntunes wrote:
>
> >
> > If mysql is not listed, then the driver is not properly installed.
> > --
> > Regards,
> > Dick
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> --------------------------------
>
> Many thanks for the reply !
>
> In fact, running your script, the MySQL is not listed. But I installed the
> rpm's ( DBI, MySQL e MySQL-Dbi-perl ... ) and apparently, everything is OK.
> Is there some workaround here ?!
>
> Thanks in advance !
>
> Mário
--
---------------------------------------------------------------------
I haven't lost my mind!!! It's backed up on disk.
"The world wont end with a bang, or even a whimper, but with an error
message." -- format C:
------------------------------
Date: Thu, 19 Oct 2000 17:16:35 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: Question: DBI or DF_file?
Message-Id: <T%FH5.21$qa2.18359@news.pacbell.net>
R. <maiwang@home.com> wrote:
> I've heard that DB_file and ADBM_file are a very bad thing with concurrent
> sessions, which is likely to happen in this situation. Corect me if I'm
> wrong.
> -What would happen with the abovementioned setup? If more than one human
> attempts to access the same HTML page and therefore fires up perl to do a
> search for them through the DB, then does this result in concurrent scripts
> or return an error?
I'm not certain how you'd write it, but it would most likely result in
multiple concurrent scripts. You should therefore include robust file
locking if you go that way. Such locking is available to perl, so
there's no reason not to do it.
> -Can I use a DB created by Access 7 and access from perl? I gather this
> would solve the concurrent session problem.
Hmm. 'created by' 'access from'. I don't know that you've got it yet.
There are 2 (general) ways to have multiple users access a database
consistently.
1) shared
Each 'process' has to use file locking or some other form of resource
locking to aquire the right to edit (and in some cases read) the data.
When they complete their operations, they release the resource. For
small numbers of accesses, this is perfectly fine.
In this case the 'database' could be a flat file, a DB file, or any set
of structures on a disk.
2) moderated
This way each 'process' doesn't read the file at all. Instead it asks a
moderator (that has the file open) to do operations. The moderator is
able to guarantee that operations are done that keep the database
consistent and that replies are consistent.
So, Just becase a perl program could 'read' a database 'created by'
Access doesn't solve your concurrency problems. However if you had a
running Access database and you sent calls to it, then that would keep
you out of trouble. That's because Access (and any other database)
would have already handled the problems. When you write your own
database, you get to handle them.
> At 14, I programmed a BBS from scratch, and hacked ancient computer
> hardware, but like holy cow I'm having some problems learning perl. Seems
> that every time I start off in a direction, I discover I have to first
> learn about and install a module or some obscure MS product. Can't just
> program, like the old days.
I don't think that what you're asking about right now has anything to do
with perl. DB access is a generic problem that you'd have if you wrote
a database in BASIC or C.
--
Darren Dunham ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< Please move on, ...nothing to see here, please disperse >
------------------------------
Date: Thu, 19 Oct 2000 16:09:33 +0100
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: Regex for matching e-mail addresses
Message-Id: <ant19153306cfNdQ@oakseed.demon.co.uk>
In article <39eed686$1@news.jakinternet.co.uk>, Andy McMullin
<URL:mailto:andy@NOSPAM.rickham.net> wrote:
>
> "James Taylor" <james@NOSPAM.demon.co.uk> wrote in message
> news:ant15165406cfNdQ@oakseed.demon.co.uk...
> > There are probably lurkers reading this that know the format of Notes,
> > cc:Mail, X.400, or MEMO format addresses, but who haven't bothered to
> > post examples for me because they do not know of anywhere these are
> > actually used in the wider context of the Net.
>
> Having lurked into this one, some examples of my own (valid) addresses:
>
> Notes: Andy McMullin/Plymouth Business School/GB
> X400: g=Andy;s=McMullin;ou=Business-School,o=Plymouth,p=uk.ac;a= ;c=gb
Thank you very much for that, I was beginning to think my plea had
fallen on deaf ears. I'm surprised to see spaces and commas in those
local mailbox names, and I assume therefore that they get surrounded
in double quotes when sent over the net. Is that so?
--
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02
------------------------------
Date: Thu, 19 Oct 2000 16:30:29 GMT
From: rameshdorai@my-deja.com
Subject: running perl program in the background
Message-Id: <8sn7j6$6to$1@nnrp1.deja.com>
Hi
I am trying to write a perl program which schedules a job periodically.
In between jobs, the program sleeps. So, if I run the program, I can see
the dos window sitting on my desktop.
Is there a way to run my program in the background in dos without me
seeing a dos window, like what UNIX is capable of.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 19 Oct 2000 17:31:16 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: Search, pad, replace
Message-Id: <EdGH5.468$pb.128696@news.uswest.net>
01031149@3web.net (Duke Normandin) elucidates:
>>Oh, puh-leeze.
>
> I'm giving you the opportunity to mealy-mouth me face-to-face, bud!
I'm in Seattle. Fly on out any time you want. You won't even need
to rent a car, as I'm sure it will be quick. Until then...
*plonk*
--
"Civilization rests on two things: the discovery that fermentation
produces alcohol, and the voluntary ability to inhibit defecation.
And I put it to you, where would this splendid civilization be without
both?" --Robertson Davies "The Rebel Angels"
------------------------------
Date: Thu, 19 Oct 2000 17:50:04 GMT
From: ollie_spencer@my-deja.com
Subject: Re: Search, pad, replace
Message-Id: <8snc89$ar4$1@nnrp1.deja.com>
> On Wed, 18 Oct 2000 11:04:55 -0400,
> DesQuite <desquite@hotmail.com> wrote:
>
> > Thanks. You're an asshole.
>
> Oh really?
>
> Well.. I'll be sure to remember you the next time you come along. I
> should have known better than to help someone who isn't even willing
to
> do their own work.
>
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division | I'm just very selective about what
I
> Commercial Dynamics Pty. Ltd. | accept as reality - Calvin
> NSW, Australia |
I have read this thread - it reminds me of one I recently initiated and
got badly burned by - "Reverse by paragraphs - NOT!".
Innocently(I'm not a novice to newsgroup posting) I posted to perl.misc
some problem code.
I was beset by replies - Godzilla among them - seemingly intent on
demonstrating their superior intelligence and my inferiority as a
member of the human race.
Admittedly I compounded the problem by overlooking several valid
solutions - fixation on my part, perhaps due to the tone of the replies
- but there were more nit-pickers than those who wanted to help. Many
belittling me for choosing other than their favorite approach. It
became a stomach-churning chore to check that string for new messages!
Must intelligence imply arrogance? By asking a question to perl.misc
you guarantee at least one nasty-gram, and frequently several. Courtesy
is a rarity. Believe it or not, lack of knowledge about perl doesn't
imply inferiority. No one is forced to reply to a posting. Maybe we
need a comp.lang.perl.cheapshot forum?
Thank the heavens that there are still a few ( a very few ) that can
post without venting their frustrations.
ollie spencer
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 19 Oct 2000 17:15:42 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: string extraction
Message-Id: <suub1u6nscs737@corp.supernews.com>
gelshocker@my-deja.com wrote:
: How can I extract a substring based on pattern matching.
:
: For example: original string is "aaaaa~bbbbb~~~ccccc~~"
:
: How can I extract aaaaa into one varible, and bbbbb into another?
The most perlish way would be
my @pieces = split /~+/, $str;
@pieces would then be a list: ('aaaaa', 'bbbbb', 'ccccc', '')
Your two desired variables would be $pieces[0] and $pieces[1], with other
strings at higher indices.
If you really truly want just the first two, always, no exceptions, you
can do this instead:
($first, $second) = split /~+/, $str;
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "Quidquid latine dictum sit, altum viditur."
|
------------------------------
Date: 19 Oct 2000 15:16:17 GMT
From: whoever@wherever.com
Subject: Re: using alerts
Message-Id: <8sn381$l1d$2@kadri.ut.ee>
Konstantin Schauwecker <hi@konstantin-schauwecker.de> wrote:
: Hi everybody
: I need some informations about using alerts. I tried
: perldoc -f alert
: but I got a "no documentation found".
Try perldoc -f alarm
;)
------------------------------
Date: Thu, 19 Oct 2000 16:48:11 GMT
From: bing-du@tamu.edu
Subject: what is 'Subroutine NULL'?
Message-Id: <8sn8ka$7fq$1@nnrp1.deja.com>
My script gives:
Prototype mismatch: sub main::NULL vs () at (eval 63) line 1.
Subroutine NULL redefined at (eval 63) line 1.
I checked the section concerning 'Prototype mismatch' in 'perldoc
perldiag' and also searched the web for the cause of the following
error. I saw this example:
=============
Example
The following code will generate this error:
sub mySub($$);
mySub 1, 2;
sub mySub($$$) {
print "@_\n";
}
Prototype mismatch: ($$) vs ($$$)
=============
The above example makes sense.
But I'm still not clear why the compilation complained about subroutine
NULL in my case. What is subroutine NULL? Another thing, in the error
message provided, what does 'eval 63' refer to?
Any help is greatly appreciated.
Bing
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 4664
**************************************