[12243] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5843 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 31 20:07:17 1999

Date: Mon, 31 May 99 17:00:14 -0700
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, 31 May 1999     Volume: 8 Number: 5843

Today's topics:
    Re: Anyone know what is this script line meaning ?? <cassell@mail.cor.epa.gov>
    Re: Anyone know what is this script line meaning ?? (Marcel Grunauer)
    Re: Funny Interaction Between \. and ?? <aqumsieh@matrox.com>
    Re: Is split (surprisingly, amazingly) slow? (Tad McClellan)
    Re: Is split (surprisingly, amazingly) slow? <rootbeer@redcat.com>
    Re: Is split (surprisingly, amazingly) slow? (Benjamin Franz)
        Is there a more efficient way of coding this? <rbbdsb@erols.com>
        Just build perl 5.00503 on NT 4.0 with SP4, but first r bzhang@sohar.com
        passing Perl <---> C arguments (web-form data pairs) <_jj_@dpi.es>
    Re: Perl, Y2K, and idiots <ebohlman@netcom.com>
    Re: Perl, Y2K, and idiots <flavell@mail.cern.ch>
        Predefined variable for array number? <none@none.ca>
    Re: Predefined variable for array number? <rootbeer@redcat.com>
    Re: req: directional help <cassell@mail.cor.epa.gov>
        UserAdmin (fwd) <michel@michel.enter.it>
    Re: UserAdmin (fwd) <rootbeer@redcat.com>
    Re: Y2K infected Perl code (Tad McClellan)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 31 May 1999 15:02:43 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Austin Ming <austin95002887@yahoo.com>
Subject: Re: Anyone know what is this script line meaning ??
Message-Id: <37530703.9DC5BD0A@mail.cor.epa.gov>

[courtesy cc to poster]

Austin Ming wrote:
> 
> [snip of other code]
> --> @files = grep { $_ !~ m/^\./} readdir(DIR);
> 
> Anyone know what is this script line meaning ??

It probably means that the person who let you have this
is not the best Perl programmer on the planet.  :-)

In regard to your question, it uses grep() to screen
out certain files from the list coming out of readdir().
Check out the grep() function in perlfunc for more
details.  But the code drops every file and directory
in DIR which starts with a period.  Which is usually
the wrong thing to do.  And it's unneccesary to use $_
in the grep().

If the intention is to drop the '.' and '..' directories
[the current dir and the parent dir], then you'd be
better off writing that line as:

@files = grep !/^\.{1,2}$/, readdir(DIR);

Now it won't throw away your .net directory, for example.

Austin, since you've been asking a lot of questions here
lately, you might be interested in the tutorial at
http://www.netcat.co.uk/rob/perl/win32perltut.html  .
This might help.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 31 May 1999 21:24:28 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Anyone know what is this script line meaning ??
Message-Id: <3753fc3c.14321072@enews.newsguy.com>

>--> @files = grep { $_ !~ m/^\./} readdir(DIR);
>
>Anyone know what is this script line meaning ??

perldoc -f readdir
perldoc -f grep

    readdir DIRHANDLE
            Returns the next directory entry for a directory opened
            by `opendir()'. If used in list context, returns all the
            rest of the entries in the directory.

    grep BLOCK LIST
    grep EXPR,LIST
            This is similar in spirit to, but not the same as,
            grep(1) and its relatives. In particular, it is not
            limited to using regular expressions.
            Evaluates the BLOCK or EXPR for each element of LIST
            (locally setting `$_' to each element) and returns the
            list value consisting of those elements for which the
            expression evaluated to TRUE

So, you read in all the directory entries into an array, which you
then process with grep. The condition for an entry to be returned by
grep is that the name doesn't start with a dot. Within the grep's
condition, $_ is set to each name in turn. You then check whether that
name doesn't match (using !~ ) a dot at the start.

Within the regular expression /^\./ the "^" means "match at the
beginning of a string" and "\." means the literal character dot. Since
"." has a different meaning in regular expressions, it needs to be
escaped with a backslash.

HTH

Regards
Marcel Grunauer
--
Codewerk Ltd                      marcel@codewerk.com
Just Another Perl Hacker          phone: +44-171-624 7408


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

Date: Mon, 31 May 1999 17:12:31 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Funny Interaction Between \. and ??
Message-Id: <x3yemjx3pvk.fsf@tigre.matrox.com>


Bill Fisher <william.fisher@nist.gov> writes:

> In investigating a problem in which "?" looked like
> an anti-greedy quantifier, I boiled it down to this:

Hmm .. '?' is in fact used to alter the default greedy behaviour of
Perl regexps to make them non-greedy. Is that what you just said?
But this has no relation to your question!

> Executing
> 
>  echo "dog ... cat" | perl -pe 's/\./boom/;'
> 
> yields "dog boom.. cat", properly.

Ok ..

> but executing
> 
> echo "dog ... cat" | perl -pe 's/\.\b/boom/;'
> 
> 
> yields "dog ... cat", NO CHANGE!

Yep.

>   Why can't it find a period followed by a word boundary?

Because a \b matches the boundary between a \w character and a \W
character. Since a dot is a \W character, and a space is also a \W
character, no match is found there.

This is clear in the docs. From perlre:

     A word boundary (\b) is defined as a spot between two
     characters that has a \w on one side of it and a \W on the
     other side of it (in either order), counting the imaginary
     characters off the beginning and end of the string as
     matching a \W.

>   Nobody here can figure this out.

Why not? Can't you guys read? Oopps ... you work for the government. I
see.

>   Many thanks if you can help.

Welcome,
Ala



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

Date: Mon, 31 May 1999 13:02:03 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Is split (surprisingly, amazingly) slow?
Message-Id: <bafui7.6s2.ln@magna.metronet.com>

Jonathan (jonathan@meanwhile.freeserve.co.uk) wrote:
: A couple of weeks ago there was a posting on c++ moderated and
: comp.lang.python called "An efficient split function".
: Among other things it contained Perl and Python code to - well, to do this:


:     my $count = 0;
:     my @v;
:     while (<STDIN>) {
:         @v = split(/\|/);
:         $count++;
:     }
:     print "$count\n";


: In other words, to count the total number of field separated data items in a
: file.


   That code does NOT count the total number of field separated 
   data items in a file.

   It counts the lines in the file. And splits then never uses the
   result!

      $count += @v;   # this would be "better" (correct)



   Now, have you just wasted everybody's time by introducing
   a typo instead of using cut/paste?

   Or, does the article you refer to not have that broken code
   in it?

   I think the first.

   I'm not gonna pay anymore attention to you. Spending my time
   troubleshooting code that does not even exist annoys me
   to no end...
   
 
--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 31 May 1999 15:44:47 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Is split (surprisingly, amazingly) slow?
Message-Id: <Pine.GSO.4.02A.9905311515050.19186-100000@user2.teleport.com>

On Mon, 31 May 1999, Jonathan wrote:

> A couple of weeks ago there was a posting on c++ moderated and
> comp.lang.python called "An efficient split function". Among other
> things it contained Perl and Python code to - well, to do this:
> 
> 
>     my $count = 0;
>     my @v;
>     while (<STDIN>) {
>         @v = split(/\|/);
>         $count++;
>     }
>     print "$count\n";
> 
> 
> In other words, to count the total number of field separated data
> items in a file.

Well, gee, if the code doesn't have to do it _correctly_, you could
probably make it run faster than that....  :-)

> The author of the post was surprised because the Python version ran
> **4** times as fast as the Perl code above on large files.  And with
> fairly minimal effort he was able to write C++ and STL code that ran
> more than 30 times faster than the Perl above. (And generally STL code
> can be replaced with C several times faster on current compilers.)

Thirty times!

If you're going to make (or cite) such amazing claims, it would probably
be a good idea to back them up with the actual (correct) code and real
benchmarks, so that we can all see what you're talking about. Maybe, for
example, perl was an old version or improperly configured (or both). Maybe
the Python code didn't get the right answer (either). And maybe there
really is something making Perl slow - something we should probably fix,
if it can be done.

I whipped up a quick program in perl to count the fields in a 250MB file,
and it wasn't 30 times slower than (even!) a useless-use-of cat to
/dev/null. With a little effort, I could have sped it significantly, I
suspect. But I'm not including it here, since I don't know whether my
assumptions were the same as yours. (I assumed, for example, that an empty
line has one empty field, but perhaps you would say it has zero fields. I
assumed that 250MB is suitable for a "large" file. And so on.)

> Both these things surprised me greatly. I've only had time to play
> around with Perl for just over a week (and that was a couple of months
> ago, I'll be getting back to it at the end of my current project) but
> I was very pleased by how fast and efficient it seemed (it was also a
> lot of fun.) 

Perl is fast, but it's not trying to be the fastest language to _run_. If
you want the fastest running code, you can build custom hardware or learn
assembly language. But Perl is much easier to read, write, and maintain
than most other languages. Put me next to an experienced C programmer and
I'll probably be able to get a correct program running thirty times
faster. (Well, maybe only twenty times faster. Randal would be fifty times
faster. :-)

And Perl is more than thirty times as much fun as C. 

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 31 May 1999 23:34:28 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Is split (surprisingly, amazingly) slow?
Message-Id: <80F43.1918$T7.147356@typhoon-sf.snfc21.pbi.net>

In article <7iuu05$fq7$1@news8.svr.pol.co.uk>,
Jonathan <jonathan@meanwhile.freeserve.co.uk> wrote:
>A couple of weeks ago there was a posting on c++ moderated and
>comp.lang.python called "An efficient split function".
>Among other things it contained Perl and Python code to - well, to do this:
>
>
>    my $count = 0;
>    my @v;
>    while (<STDIN>) {
>        @v = split(/\|/);
>        $count++;
>    }
>    print "$count\n";
>
>
>In other words, to count the total number of field separated data items in a
>file.

That isn't what you wrote in code above. It just counts the number of lines
(slowly).

Anyhow, the performance can be easily kicked into high gear by
giving Perl bigger chunks to chew on and using a more efficient
field counter than split:

$ ./test-field_counter.pl 
Use of implicit split to @_ is deprecated at ./test-field_counter.pl line 24.
blocked tr construct: 700000
split construct: 700000
Benchmark: timing 10 iterations of blocked tr construct, split construct...
blocked tr construct:  6 wallclock secs ( 4.22 usr +  1.32 sys =  5.54 CPU)
split construct: 186 wallclock secs (169.40 usr +  1.70 sys = 171.10 CPU)

#!/usr/bin/perl -w
use strict;
use Benchmark;
my $scratchfile = '/tmp/test_field_counter.txt';

open (DATAFILE,"+>$scratchfile") or
	die ("Unable to open $scratchfile for writing: $!\n");
print DATAFILE "sdfsdfdsf|sdsdfsdf|ewrwerwer|sdfsdfsdf|weewewr|werewr|sdfsdf\n" x 100000;

print "blocked tr construct: ",&blocked_tr_construct,"\n";
print "split construct: ",&split_construct,"\n";
timethese (10,{
        'split construct' => \&split_construct,
   'blocked tr construct' => \&blocked_tr_construct,
});

close (DATAFILE);
unlink ($scratchfile) or 
	die ("Couldn't dispose of the temporary datafile: $!\n");

sub split_construct {
   seek(DATAFILE,0,0);
   my $count = 0;
   while (<DATAFILE>) { $count += split(/\|/) }
   $count;
}

sub blocked_tr_construct {
   seek(DATAFILE,0,0);
   my $count = 0;
   while(read(DATAFILE,$_,65536)) { $count += (tr/\n|//) }
   $count;
}

-- 
Benjamin Franz


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

Date: Mon, 31 May 1999 18:42:09 -0400
From: "rbbdsb" <rbbdsb@erols.com>
Subject: Is there a more efficient way of coding this?
Message-Id: <7iv387$pfj$1@autumn.news.rcn.net>

Hi,
I'm extracting a series of lines between two patterns, parsing the values
out, and stuffing them into Oracle.  Is there a more efficient way of doing
this?

Thanks

Thanks for the response.  I was just using the print as a sampe of some
code.  The code looks more like:

while (<InputFile>) {
# extents
    if (/Owner/ .. /System/) {
        next if(/Owner/);
        next if(/--/);
        next if(/System/);
        tr/,//d;
        ($ignore, $owner, $object, $type, $tablespace, $sizekb, $blocks,
        $extents, $maxextent, $nextextentsize) = split(/\s*\|\s*/);
        }

# DB backup
    if (/Backup function/ .. /^$/) {
        next if(/Backup/);
        next if(/--/);
        next if(/^$/);
        ($ignore, $backupfunction, $startbackup, $endbackup,
        $returncode, $detaillog) = split(/\s*\|\s*/);
        }
}

$inserth = $dbh->prepare("INSERT INTO extents(owner, object, type,
tablespace, sizekb, blocks, extents, maxextent, nextextentsize)
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
$inserth->execute($owner, $object, $type, $tablespace, $sizekb,
$blocks, $extents, $maxextent, $nextextentsize);

$inserth = $dbh->prepare("INSERT INTO dbbackup(backupfunction, startbackup,
endbackup, returncode, detaillog VALUES (?, ?, ?, ?, ?)");
$inserth->execute($backupfunction, $startbackup, $endbackup, $returncode,
$detaillog);

Sample data is:

05/20/1998  11:25:28      Missing indices

----------------------------------------------------------------------------
--------------------------------------------------------------------------
----------------------------------------------------------------------------
--------------------------------------------------------------------------
| Missing database indices             | Indices not defined in DDIC
|
----------------------------------------------------------------------------
--------------------------------------------------------------------------


----------------------------------------------------------------------------
--------------------------------------------------------------------------
05/20/1998  11:25:28      Database tables without unique indices

----------------------------------------------------------------------------
--------------------------------------------------------------------------
|Database tables without unique indices
|
----------------------------------------------------------------------------
--------------------------------------------------------------------------
Objects found:           0
----------------------------------------------------------------------------
--------------------------------------------------------------------------
05/20/1998  11:25:28      Extents of Tables and Indices

----------------------------------------------------------------------------
--------------------------------------------------------------------------
| Owner      | Object         | Type       | Tablespace | KBytes          |
Blocks   | Extents  | MaxExtents  | Next   (K)  |
----------------------------------------------------------------------------
--------------------------------------------------------------------------
| USER1      | ANEK           | TABLE      | USERDATA  |            696  |
87  |      18  |        300  |         40  |
| USER1      | ANEP______0    | INDEX      | USERINDEX  |          1,456  |
182  |      10  |        300  |        160  |
| USER1      | ANKB           | TABLE      | USERDATA  |          1,440  |
180  |      22  |        300  |         40  |
| SYS        | SOURCE$        | TABLE      | SYSTEM     |          2,336  |
292  |      11  |        505  |      1,120  |
| SYS        | VIEW$          | TABLE      | SYSTEM     |          1,576  |
197  |      10  |        505  |        744  |
----------------------------------------------------------------------------
--------------------------------------------------------------------------
----------------------------------------------------------------------------
------------------
System               ORCL
Database, DB Server  ORACLE       hostname            Database Backup Logs
Available
Day, Time            05/20/1998   11:25:28
----------------------------------------------------------------------------
------------------

----------------------------------------------------------------------------
-------------
| Backup function  | Start of backup      | End of backup        | RC   | OS
log name   |
----------------------------------------------------------------------------
-------------
| full,offline,util| 04/28/1998 21:05:35  |                      | 9999 |
bcxfydad.aff  |
| full,online,util | 04/27/1998 22:00:03  | 04/27/1998 23:06:36  | 0000 |
bcxftkat.anf  |
| full,online,util | 04/26/1998 22:00:02  | 04/26/1998 22:41:33  | 0000 |
bcxfomfq.anf  |
----------------------------------------------------------------------------
-------------





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

Date: 31 May 1999 15:28:38 PDT
From: bzhang@sohar.com
Subject: Just build perl 5.00503 on NT 4.0 with SP4, but first run fails
Message-Id: <37530a77.2059967376@news.cncdsl.com>

I just compiled the perl 5.00503 on NT4, SP3 and VC++ 5.0. I use nmake
to do it.

I passed compilation. The nmake test reports OK. During nmake
installation,  it reports lots of error during installhtml. Here are
some of them:

 ..\installhtml: ../pod/perl5004delta.pod: cannot resolve L<h2xs> in
paragraph 214: no such page 'h2xs'
 ..\installhtml: ../pod/perldelta.pod: cannot resolve L<INSTALL> in
paragraph 10: no such page 'INSTALL'
 ..\installhtml: ../pod/perldelta.pod: cannot resolve L<INSTALL> in
paragraph 12: no such page 'INSTALL'
 ..\installhtml: ../pod/perldelta.pod: cannot resolve L<New C<qr//>
operator> in paragraph 16: no such page 'New C<qr'
 ..\installhtml: ../pod/perldelta.pod: cannot find matching > for C in
paragraph 16.
 ...................

I think this is ok, just something wrong with docs.

But when I first run a perl script that come with another package, it
says

D:\ACE_wrappers\TAO\examples\SIMPLE\grid>perl run_test.pl
Can't locate Win32/Process.pm in @INC (@INC contains: ../../../../bin
c:\perl\5.00503\lib/MSWin32-x86 c:\perl\5.00503\lib
c:\perl\site\5.00503\lib .) at ../../.
 ./../bin/Process_Win32.pm line 4.
BEGIN failed--compilation aborted at ../../../../bin/Process_Win32.pm
line 4.

There is no Process.pm in my installation directory. It only exists in
OS2 directory in the original source package.

What is wrong?

Bing


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

Date: Tue, 1 Jun 1999 00:49:28 +0200
From: "jj" <_jj_@dpi.es>
Subject: passing Perl <---> C arguments (web-form data pairs)
Message-Id: <7iv3n2$nno14@esiami.tsai.es>

Hi all & sorry if you're now disturbed by this e-mail,
I think I wasn't totally clear when I asked my question before.

I'll explain:
I've a program in a Linux server written in C (I guess... it's not mine) and
compiled. This program gets three pairs variable/value from a web-form and
manage these data properly. Now I want call this program from within a Perl
program BUT I do NOT know how to pass these three pairs variable/value to
the compiled C program just like a web page do.

And the same problem appears when I try to execute a Perl program from
within C. How these data pairs a passed?

I tried "system", "exec", "eval"... but it doesn't work. I guess the
arguments aren't passed as usual, are they? how?

I can imagine it's a question of about 2 or 3 Perl/C instructions... which
ones?


I'm not experienced programmer on Perl nor C but also not a newbie. I've
read a lot of Perl documentation but I still haven't found the solution...
perhaps I skipped the clue, there's a lot of documentation on Perl...

Regards,
jj





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

Date: Mon, 31 May 1999 23:28:50 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Perl, Y2K, and idiots
Message-Id: <ebohlmanFCMEK2.1GI@netcom.com>

Kristina <kristina@greatbasin.net> wrote:
: In all fairness, everyone has to start somewhere.  However, there
: seems to be a great deal of resentment here for people who are just 
: starting out.  Are we, then, idiots for wanting to learn some kind of

No.  There's a great deal of resentment here against people who don't 
even bother to look in the comprehensive set of documentation that comes 
with every copy of perl before coming to this newsgroup and asking 
questions that are covered in that documentation.  On any given day, 
there are posts here from people who are new to Perl, who *have* looked 
in the documentation, and who ask for clarification.  They get the 
red-carpet treatment.  The resentment isn't against people who are just 
learning, it's against people who want us to do their homework for them.



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

Date: Tue, 1 Jun 1999 01:37:07 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Perl, Y2K, and idiots
Message-Id: <Pine.HPP.3.95a.990601013204.16818C-100000@hpplus01.cern.ch>

On Mon, 31 May 1999, Eric Bohlman wrote:

> Kristina <kristina@greatbasin.net> wrote:
> : In all fairness, everyone has to start somewhere.  However, there
> : seems to be a great deal of resentment here for people who are just 
> : starting out.  Are we, then, idiots for wanting to learn some kind of
> 
> No.  There's a great deal of resentment here against people who don't 
> even bother to look in the comprehensive set of documentation that comes 
> with every copy of perl before coming to this newsgroup and asking 
> questions that are covered in that documentation.

Right.  But I've been following these threads, and it seems to me that
Kristina is now taking all the right steps to help people learn from
initial newbie errors.  I guess that takes a deal of courage, and
I think we should respect that.

>  The resentment isn't against people who are just 
> learning, it's against people who want us to do their homework for them.

Quite so, but that isn't Kristina.  (I'm judging only from what I've
read on this thread, I know nothing about the background.)




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

Date: Mon, 31 May 1999 20:13:45 -0300
From: ".." <none@none.ca>
Subject: Predefined variable for array number?
Message-Id: <5FE43.1947$%65.4999@tor-nn1.netcom.ca>

Is there an array equivalent of the $. variable for files.  i.e. A variable
which tells you what array number you are currently at.

ex:  Pretending that this variable was named $array_num:

@array = (a b c d);

foreach $x (@array) {
    print $array_num\n;
}

This would print:

0
1
2
3

I realize this value is simple to figure out using other ways, I am simply
curious as to whether this variable is already predefined by Perl.

Thanks,
James Edwards







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

Date: Mon, 31 May 1999 16:37:09 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Predefined variable for array number?
Message-Id: <Pine.GSO.4.02A.9905311629090.19186-100000@user2.teleport.com>

On Mon, 31 May 1999, .. wrote:

> Is there an array equivalent of the $. variable for files.  i.e. A
> variable which tells you what array number you are currently at.

> foreach $x (@array) {
>     print $array_num\n;
> }

There's no way (that I know of) to pull the iteration number. But if
that's what you need, you probably want something like this instead.

    for my $index (0..$#array) {
	# Do something with $array[$index]
    }

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 31 May 1999 15:12:58 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Bastiaan S van den Berg <office@asc.nl>
Subject: Re: req: directional help
Message-Id: <3753096A.83D27915@mail.cor.epa.gov>

[courtesy cc to poster]

Bastiaan S van den Berg wrote:
> 
> really?? than i don't feel like this is a website , but more some old woman
> that tells you what you can do and what you can't do ..

Well, this is *not* a website.  It's a Usenet newsgroup, which
is as different from a website as Perl is different from CGI.

And I hope you knew that my previous post was *intended* to be
humorous, even if I left off the ":-)".

Oh, and we *are* a bunch of crabby old geezers.  Surely you've
noticed that by now.  :-)

> David Cassell heeft geschreven in bericht
> <374DB376.756A5E3@mail.cor.epa.gov>...
> >Bastiaan S van den Berg wrote:
> >>
> >> yeah!!!!!!!
> >>
> >> it now works fine!!! but when you posted it , i was sure it was offline..
> >>
> >> tnx anyways!
> >> buZz
> >>
> >> >I just checked, and it's up.  Maybe it's my karma.  :-)
> >> >
> >> >You did try this URL with no typos, right?
> >> >
> >> >http://www.perlmonth.com/articles//rtfm.html
> >> >
> >> >That's a double-slash after 'articles'.
> >
> >You're welcome.  Even if you have a tendency not to attribute
> >quotes, as is standard in Usenet.
> >
> >Actually, this is a test designed to see if you are really
> >serious about learning Perl.  The webpage parses out your
> >HTTP_REFERER and stores information about you in a database,
> >and then makes sure that you have tried at least two previous
> >times before letting you in.  If you are that determined,
> >then you have one of the requirements to become a decent
> >programmer.  If you read the entire article without getting
> >sidetracked by the nude pictures of Pamela Anderson, then
> >you have a second requirement.

All my posts mentioning 'nude pictures of Pamela Anderson'
are by definition levity.  Even if they fail to be funny.

Well, at least that's what I keep telling my wife...

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 31 May 1999 14:21:49 +0200
From: ZioBudda <michel@michel.enter.it>
Subject: UserAdmin (fwd)
Message-Id: <Pine.LNX.4.05.9905311421340.2561-100000@michel.enter.it>

Hi, I need to use HTTPD::UserAdmin for open/read/write the file .htpasswd
of my site (LinuxBox/Apache). I can (in this moment) store a new user,
delete it and see if he exist, but I have a problem with the "fetch"
functions. It does not work for me.
My code (only a piece) is:

	@arr = ('utente', 'passwd','dir');
          $fetch2=$user2->fetch($utente,@arr);
          print $arr{0};
          foreach (keys %fetch2) { print "$_ => $fetch2{$_}\n"; }

I have tried also:
foreach (keys %fetch2) { print "$_ => $fetch2->{$_}\n"; }
but with the same result: no work.
why ?

Ah, $user2 is: 
@DBM = (DBType => 'Text',
        DB     => $file,
        Server => 'apache',
        Mode   => '7755',
        #Auth   => '/home/httpd/home/.htpasswd.PERL5'
        );

$user2 = new HTTPD::UserAdmin @DBM;

ciaoz

Ho sentito urla di sudore... che schifo...
--
Michel <ZioBudda> Morelli		  michel@michel.enter.it
					http://ziobudda.enter.it
Italian Linux FAQ                  http://ziobudda.enter.it/FAQ/




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

Date: Mon, 31 May 1999 16:55:32 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: UserAdmin (fwd)
Message-Id: <Pine.GSO.4.02A.9905311653160.19186-100000@user2.teleport.com>

On Mon, 31 May 1999, ZioBudda wrote:

> Hi, I need to use HTTPD::UserAdmin for open/read/write the file
> .htpasswd of my site (LinuxBox/Apache). I can (in this moment) store a
> new user, delete it and see if he exist, but I have a problem with the
> "fetch" functions. It does not work for me. My code (only a piece) is:

If you can make a small example program which shows what you expected and
how it differed from what you got, that would make it much more likely
that someone will be able to see what you need to fix. You should be able
to make a program of fewer than ten lines. Be sure also to include a small
sample .htpasswd datafile (fewer than five lines should be sufficient).

By the way, are you sure that HTTPD::UserAdmin provides a "fetch"  
function? I didn't see one in the manpage, but maybe you have a newer
version of that module than the one installed on this machine.

Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 31 May 1999 13:06:58 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Y2K infected Perl code
Message-Id: <ijfui7.6s2.ln@magna.metronet.com>

Kristina (kristina@greatbasin.net) wrote:
: On 30 May 1999, Malcolm Ray wrote:

: > You found those examples.  Did you alert the authors to their Y2K bugs?

: Nope.  I wasn't notified, at least.


   And there you go.

   The claim that Joycelyn is trying to help avoid y2k problems
   is clearly false.

   Else, she would have done so.


   Wonder why she didn't...

   ... then it would be harder to sell her FUD!


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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