[18728] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 896 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 14 14:06:57 2001

Date: Mon, 14 May 2001 11:05:08 -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: <989863507-v10-i896@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 14 May 2001     Volume: 10 Number: 896

Today's topics:
    Re: Boole's tools (was Things I'm just not getting in P (Abigail)
    Re: Cabal Guidelines for comp.lang.perl.misc ($Revision <hartleh1@westat.com>
    Re: Cabal Guidelines for comp.lang.perl.misc ($Revision <mischief@velma.motion.net>
    Re: dbmopen and tie <SiStie@nuclear-network.com>
    Re: dbmopen and tie (Anno Siegel)
    Re: Forcing default filename (Andrew Clover)
    Re: Forcing default filename <flavell@mail.cern.ch>
        garbage collection in perl <carlos@plant.student.utwente.nl>
        How to call perl program from C program ? <jim_pku@yahoo.com>
    Re: if ($x in @a) equivalent in perl? <jurgenex@hotmail.com>
    Re: If statement question <davidaslanian@hotmail.com>
    Re: If statement question (Craig Berry)
        perl book <frank673@hotmail.com>
    Re: perl book <peb@bms.umist.ac.uk>
    Re: perl book <flavell@mail.cern.ch>
        perl prints asychronously - compiler/interpreter optimi <jesse@uchicago.edu>
    Re: Probably a simple question... <ubl@schaffhausen.de>
    Re: Probably a simple question... <peb@bms.umist.ac.uk>
    Re: Probably a simple question... <Ask@For-It.Com>
    Re: Probably a simple question... (Randal L. Schwartz)
    Re: regex stuck up~ nobull@mail.com
    Re: Req. for help: need biometric guniea pigs <jesse@uchicago.edu>
    Re: Sorting a variable <pswordkirk@msn.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 14 May 2001 16:34:50 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Boole's tools (was Things I'm just not getting in Perl)
Message-Id: <slrn9g029a.a6c.abigail@tsathoggua.rlyeh.net>

David Combs (dkcombs@panix.com) wrote on MMDCCCXIII September MCMXCIII in
<URL:news:9dohtm$i2p$1@news.panix.com>:
%%  In article <slrn9eqdfo.h4q.abigail@tsathoggua.rlyeh.net>,
%%  Abigail <abigail@foad.org> wrote:
%% >...
%% >No. My newsreader is totally unaware of Perl. But, as any good newsreader
%% >does, you can configure what editor it should use. But the newsreader
%% >doesn't really care whether it's calling an editor, or some other program.
%% >So, mine calls a Perl program that massages the template it gets from
%% >the newsreader, calls the editor and then massages the results before
%% >handing it back to the newsreader.
%% >
%% >It's Perl playing the role of glue.
%%  
%%  (a) Maybe you could show us an example?

An example of what?

%%  (b) And, what is this "template" it would get from
%%  the newsreader?   (I myself use trn)

That depends on your newsreader. It should be less than trivial to find
out. Just post and see what template your newsreader gives you.


Abigail
-- 
perl -wle 'eval {die [[qq [Just another Perl Hacker]]]};; print
           ${${${@}}[$#{@{${@}}}]}[$#{${@{${@}}}[$#{@{${@}}}]}]'


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

Date: Mon, 14 May 2001 12:12:31 -0400
From: Henry Hartley <hartleh1@westat.com>
Subject: Re: Cabal Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <3B0003EF.7D094CD0@westat.com>

Uri Guttman wrote:
> 
> this is one of moronzilla's most bizarre delusions, that most (if not
> all) of the regular posters here are a single person (let alone a
> cabal!). so someone would have the time and energy to create dozens of
> personalities and post 200 messages a day discussing perl with
> itself. now, since she is a known schizo and psycho, she is attributing
> her illness on the rest of us.

You're never alone when you're a schizo.

-- 
Henry Hartley
Just The Same Perl Hacker


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

Date: Mon, 14 May 2001 17:31:55 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Cabal Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <tg05kbqkqtmcbe@corp.supernews.com>

[sorry for the length... I left most of the original post intact
 for two reasons... I had something to which to respond at most
 every point, and I thought Tad might like to see the original
 post's abuse of logi^Whis name.]

Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> Randal L. Schwartz wrote:
>  
>>  "Kira" == Godzilla! wrote:

>> Kira> When will you be announcing a request for comments
>> Kira> and announcing a call for vote to sanction this
>> Kira> FAQ per long standing USENET guidelines?
>  
>> There are no "long standing [sic] USENET [sic] guidelines" for
>> approving a charter after the fact.  Do your homework, Kira.  Read
>> news.admin.* for a few months.

> Yes, it is a newsgroup charter, isn't it, Randal?

A charter is usually sanctioned by the few users who start
a newsgroup before the pulbic posting level gets noticed,
let alone before it gets to 100 posts per day. There's
nothing unusual about a few people who view themselves in
charge of a charter pushing it through.

> My presumption is you, as a seasoned USENET participant
> and former USENET administrator, have forgotten the
> sanctity of newsgroup charters.

A newsgroup charter is not a regligious text. What Tad's
working on is a set of guidelines for behavior so the
newsgroup will be in order. It's not indoctrination on
how to attain eternal life.

> There are both written and unwritten guidelines for USENET

Indeed. Tad's just putting into writing some of the
unwritten guidelines which have already been accepted
by the regulars of this group.

> no others here, whom I know of, as familiar with USENET
> customs as you and myself. These others are uppity newcomers.

I'm not uppity nor a newcomer. I've been on Usenet for ten
years, and on the comp.lang.perl* branch for six, although
mostly as a lurker until the last couple of years. Sure,
1993 may be the year September never ended, but don't think
that everyone younger than yourself is completely clueless.
You talk about the horrors of oligarchy yet use bigotry in
your arguments.

> This FAQ is presented as the "voice of the majority" here
> and yet speaks only for a very select few. Those of us who
> are in disfavor of this self-proclaimed cabal here, are not
> afforded an opportunity to provide input and opinion.

The reason it was posted as a draft is so readers of the
newsgroup, mammalian and reptilian ;-) , can make comments. 

> Clearly this is a display of fascist ideals by this cabal.

This would mean that you view any group which has a leadership
which initiates actions on behalf of the group and asks for
feedback to be facist. I have to disagree wholeheartedly. Even
if you _still_ are not convinced that Tad will hear suggestions,
after he asked for others to forward your suggestions to him,
then that is your sad delusion.

Also, if you think that any group which has leaders which
represent the people instead of having a direct vote on
everything by every member is facist, then which country are
you going to choose in which to live? All modern nation-states
have a leadership group which is smaller than the population
as a whole. Luckily, many of these nations at least let us
vote on our leaders. This group is no different. If you have
a set of guidelines to submit for group approval as Tad has,
then post it in opposition and we can vote between the two,
or compromise by using points of each.

> I find their and, in this instance, your attitude and
> displayed behavior to be morally repugnant.

I may not know Randal well, but I have had many chances to
interact with him and have never found any of his acts to
be "morally repugnant". I realize my standards and yours
are probably different, but those are very strong words
which carry a theistic connotation. I don't believe such
words should be used so flippantly as in this conversation.

>> What Tad will have created when the process is done is a set of
>> guidelines.  These guidelines codify the operating principles that
>> *we* have been following (or attempting to follow) since the group's
>> inception, and even before that in comp.lang.perl and the mailing list
>> before that.

> What "Tad" is creating is a set of dictorial rules which will
> be used as an excuse to increase the abuse of people here. This
> document being created by "Tad" is exceptionally offensive and
> I am embarrassed to have anyone presume I am associated with
> this document. Rest assured I will periodically make this clear.

Then post your own version, so we can compare the two. I would
post my own, but I pretty much agree with what Tad has written.

> I have been refused any opportunity to participate in
> the development of this newsgroup charter. Your use of
> "we" is most hypocritical. It is equally clear "Tad"
> is making any and all decisions regarding this FAQ
> and is making iron clad fist decisions on its content.

Ridiculous. Have you read this thread at all?

> This "Tad" is not the ruler of this group although
> he envisions himself to be and consistently displays

Tad is just the one willing to do the work. "Put up or
shut up" I believe is the appropriate idiom here. Or,
to quote Jarkko, Nick I-S, Gurusamy, Simon Cozens,
and others, "patches welcome". I suppose that since
Jarkko dedicates a gret many hours of his time to
being a pumpking that he is a bad person in your eyes?
Or I guess that Larry, since he desgined Perl, wrote
the first versions of the system to run it, and tries
to exert some self-limited control over how Perl
develops is a bad, bad, bad, bad man?

> Others elect to be bootlickers. I do not.

Others agree to play well with others. If you can't
understand why working together is normally better
than working against one another, then I'd like to
hear why you're using an OS desgined by someone else
on a computer desgined by someone else to write
programs in a language desgined by someone else and
complaining about the posts in a group about that
language which are coming from someone else. Why not
go build your own computer from silicon, write
your own OS for it, develop your own high-level
language, and leave us alone?

>  
>> By "we", I mean the people that answer the questions, day after day,
>> sometimes crankily but usually with near-infinite patience.

> By "we" you mean those very few who have elected to place
> themselves in authoritarian if not tyrannical control of
> this newsgroup, as impotent as that may be. Their intent
> is not to improve this newsgroup but rather to establish
> a "legitimate" excuse to increase abuse of posters here.

I don't think I've ever seen Tad take a bullwhip or a
paddle to a poster. I think "abuse" is a leading word.
I lso think the word "control" is one of your own choosing,
since it does not connote what Tad intends by posting a
draft of posting guidelines.

> Want to discuss my history of being abused by and ongoing
> abuse by the cabal here?

Do you want to discuss your long and accomplished history of
abusing the group and its newbie posters? If you're worried
about abuse, then please quit answering posts in the manner
of telling people never to use modules, never to use a clear
style if it costs 1/1,000,000 of a second at runtime, and
telling newbies that any five lines of code you give as an
example is better than all the other Perl code in the world
combined for any given task. 

>> Guidelines that, if not followed, will slowly cause all the remaining
>> experts to leave, and you'll be left with a group of the near-blind
>> leading the blind.  Guidelines that because they haven't been followed
>> in the past have already caused experts to leave.

> My opinion is most experts, most of those who would post
> worthy articles here, have left because of all the in-house
> anal retentive sissified geek bickering and fighting between
> those within this self-proclaimed cabal. Those few dictating
> what will be and will not be in this group, are the very ones
> who are contributing to the ruination of this newsgroup.

Larry and Tom left because of the signal-to-noise ratio, IIRC.

If you believe the group is already ruined, then please feel
free to leave. 

If you have comments on the _content_ of the guidelines
document instead of your own twisted reasoning for its
being, then pleas esubmit those.

>> There's nothing to approve, because this is a statement of what
>> already *is*, not something new.  It's an assertion, not a
>> declaration.  But a powerful assertion, because we that answer the
>> questions can point at the document and say "this is the culture
>> here... please follow it, and when you don't, most or all of the
>> experts will likely ignore you."


> I cannot and will not subscribe to your philosophy and the 
> philosophy of these few others, a philosophy of, 

> "We are the chosen few and speak for everyone. We are in charge."

Look, if the people want their questions answered by someone
who knows, they will usually post in a way that gets their
questions read so long as they know what that way is. Social
norms are _always_ decided by the people already present. All
throughout history, you can find stories of newcomers trying
to change things being called 'oppression' and 'conquering'.
The established population suggesting how newcomers can fit in
and be considered polite is not oppression. It's good manners
to teach good manners.

> My choice is to honor USENET traditions and customs.

The most powerful Usenet tradition is to honor the posting
rules set forth in the specific newsgroup in question. So,
I guess you disapprove of trying to set forth these guidelines?
Why not just go to an 'alt' group then?

How about this: you submit your version of the guidelines,
and we can talk about which points work in a high-volume
newsgroup. We can do the same with Tad's. Then we can take
a look at finalizing something. Any takers?

Chris
-- 
Even in the worst of times, there is always someone who's
never had it better. Even in the best of times, there is
always someone who's never had it worse.



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

Date: Mon, 14 May 2001 18:49:18 +0200
From: Simon Stiefel <SiStie@nuclear-network.com>
Subject: Re: dbmopen and tie
Message-Id: <Pine.LNX.4.31.0105141829070.10886-100000@server.stiefel.priv>

On 12 May 2001, Anno Siegel wrote:

> According to Simon Stiefel  <SimonStiefel@nuclear-network.com>:

> > I just want to convert a 2-file-database to a 1-file-database.
>
> Tie (or dbmopen, if you must) the old database to one hash, using
> the database module it was created with.  Tie (or dbmopen) the
> new database to another hash, using a database module of your
> choice (DB_File, presumably).  The copy the old hash to the new
> one.  If the database is small, you can do that with a simple
> hash assignment.  If it is bigger than you want to fit into memory,
> use a while-loop with each().  That's it.

Ok, but which database-module does dbmopen use?

tie (%OLD_DB, "XXXX", $old_db);

What do I have to write for XXXX?
GDBM_File doesn't work (right).
It shows me some kind of syntax-error:

Usage: GDBM_File::TIEHASH(dbtype, name, read_write, mode, fatal_func =3D
(FATALFUNC)croak) at ./convert.pl line 15, <STDIN> line 1.

I don't know what he want to explain to me. ;)
I tried it like the example in the perldoc, but without success.


The script doesn't work, if I use "dbmopen" and the "DB_File"-module at
the same time. I don't know why.


>
> Anno
>

Mit freundlichen Gr=FC=DFen,        .~.     Open Minds.
with best regards               /V\             Open Sources.
                               // \\                    Open Future!
Simon Stiefel                 /(   )\_ I N U X
                               ^ ~ ^
--=20
|Simon Stiefel | Zwerbachstrasse 17 | 72555 Metzingen-Glems | Germany |
|SimonStiefel@nuclear-network.com   |  http://www.nuclear-network.com |
|ICQ#: 20196644 | phone: +49(0)7123/379070 | fax: +49(0)179/335990106 |
|Tux#: 114751 | PingoS - Linux-User helfen Schulen | Powered by LiNUX |




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

Date: 14 May 2001 18:04:22 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: dbmopen and tie
Message-Id: <9dp6n6$fu4$1@mamenchi.zrz.TU-Berlin.DE>

According to Simon Stiefel  <SimonStiefel@nuclear-network.com>:
> On 12 May 2001, Anno Siegel wrote:
> 
> > According to Simon Stiefel  <SimonStiefel@nuclear-network.com>:
> 
> > > I just want to convert a 2-file-database to a 1-file-database.
> >
> > Tie (or dbmopen, if you must) the old database to one hash, using
> > the database module it was created with.  Tie (or dbmopen) the
> > new database to another hash, using a database module of your
> > choice (DB_File, presumably).  The copy the old hash to the new
> > one.  If the database is small, you can do that with a simple
> > hash assignment.  If it is bigger than you want to fit into memory,
> > use a while-loop with each().  That's it.
> 
> Ok, but which database-module does dbmopen use?

You still don't get it.  It uses whatever you tell it to use.  When 
you looked at the description of dbmopen (perldoc -f dbmopen, you did
that, didn't you?), you read:

    dbmopen HASH,DBNAME,MASK
        [This function has been largely superseded by the
        "tie" function.]

        This binds a dbm(3), ndbm(3), sdbm(3), gdbm(3), or
        Berkeley DB file to a hash.  HASH is the name of...

How hard is that to understand?


> tie (%OLD_DB, "XXXX", $old_db);
> 
> What do I have to write for XXXX?
> GDBM_File doesn't work (right).
> It shows me some kind of syntax-error:
> 
> Usage: GDBM_File::TIEHASH(dbtype, name, read_write, mode, fatal_func =
> (FATALFUNC)croak) at ./convert.pl line 15, <STDIN> line 1.

Again, make use of the documentation you have on your computer.
"perldoc GDBM_File" will show you exactly how tie must be used
to open a database of this type.  You need a few more parameters.
Read up on them.

> I don't know what he want to explain to me. ;)
> I tried it like the example in the perldoc, but without success.

The error message could be clearer, I agree.  But your code shows
no traces of "the perldoc" if by that you mean GDBM_File.

Anno


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

Date: 14 May 2001 16:46:20 +0100
From: andrew@white.oaktree.co.uk (Andrew Clover)
Subject: Re: Forcing default filename
Message-Id: <9doukc$4gc$1@white.oaktree.co.uk>

Rudolf Polzer <eins@durchnull.de> wrote:

>> Content-Disposition: inline; filename="something.tar.whatever"

> Which does not work with many browsers.

That may have been the case in the past, but this works fine for me
on IE5, Netscape 4, Mozilla and Opera. So I'd say coverage is pretty
good now.

> use the PATH_INFO trick (add / and the filename to the URL) instead.

One can only use this trick when the script has no query-part (or the
query-part is hidden with URL-munging). IE at least ignores everything
past the '?'.

Course one could always use both...

END


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

Date: Mon, 14 May 2001 17:56:52 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Forcing default filename
Message-Id: <Pine.LNX.4.30.0105141752130.31938-100000@lxplus003.cern.ch>

On 14 May 2001, Andrew Clover wrote:

> > use the PATH_INFO trick (add / and the filename to the URL) instead.
>
> One can only use this trick when the script has no query-part

Not true

> (or the query-part is hidden with URL-munging).

I don't understand what that's supposed to mean, sorry.

> IE at least ignores everything past the '?'.

The path part comes before the "?", so that objection doesn't figure.

> Course one could always use both...

I don't see any technical reason why not, if you're desperate to
achieve the effect. But "force" is still too strong a word.


[f'ups narrowed]



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

Date: Mon, 14 May 2001 20:08:47 +0200
From: "carlos" <carlos@plant.student.utwente.nl>
Subject: garbage collection in perl
Message-Id: <9dp6o1$8p3$1@dinkel.civ.utwente.nl>

is a 'my' variable automagically undeffed when it falls out of scope?

--
--carlos





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

Date: Mon, 14 May 2001 10:35:58 -0700
From: Jim Cheng <jim_pku@yahoo.com>
Subject: How to call perl program from C program ?
Message-Id: <3B00177D.599D65E9@yahoo.com>

Hi,

   Does anyone know how to call a per subroutine from C program ?

   Thanks!

Jim Cheng



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

Date: Mon, 14 May 2001 10:52:57 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: if ($x in @a) equivalent in perl?
Message-Id: <3b001b79$1@news.microsoft.com>

"Rudolf Polzer" <eins@durchnull.de> wrote in message
news:slrn9fsl2h.tb0.eins@www42.t-offline.de...
> Jürgen Exner <juex@my-deja.com> wrote:
> > Please let me know where I made the mistake
>
> Not too complicated. Often speed is measured in cycles/sec (like MIPS,
FLOPS
> etc.).
>
> Now assume some code takes two minutes, ie it is executed 30 times per
hour.
> Adding 700% to it, you get 240 times her hour, which is 15 seconds per
cycle.

Ahh, of course [slamming head against the wall].

jue




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

Date: Mon, 14 May 2001 15:31:51 -0000
From: David Aslanian <davidaslanian@hotmail.com>
Subject: Re: If statement question
Message-Id: <tfvuj7732ocnae@corp.supernews.com>

this might work


$died = 0;
open(FILE, "file.txt") || $died = 1;
if($died==1) {
     #do whatever instead    }


Lou Moran wrote:
> 
> I want to say:
> 
> If I can't open this file then ask this question; as such I have this:
> 
> #!/usr/bin/perl -w
> use diagnostics ;
> use strict ;
> 
> open (FILE, "file.txt") || die "No file exists: $!" ;
> 
> __
> 
> So how do I say "If the file open died"?
> 
> Or should I be saying?
> 
> If open the file
> else 
> print "what do you want to do instead:  "
> 
> 
> 
> --
> print "\x{263a}" 


--
Posted via CNET Help.com
http://www.help.com/


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

Date: Mon, 14 May 2001 16:14:53 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: If statement question
Message-Id: <tg013taf4ej197@corp.supernews.com>

David Aslanian (davidaslanian@hotmail.com) wrote:
: $died = 0;
: open(FILE, "file.txt") || $died = 1;
: if($died==1) {
:      #do whatever instead    }

Better idiom for setting a success flag:

  my $success = open(FILE, "file.txt");
  if (! $success) {
    # panic
  }

You could also use

  unless ($success)

of course, or make the ininitial line

  my $failure = ! open(FILE, "file.txt");

Season to taste.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "God becomes as we are that we may be as he is."
   |               - William Blake


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

Date: Mon, 14 May 2001 12:28:50 -0400
From: "Frank A" <frank673@hotmail.com>
Subject: perl book
Message-Id: <9dp10g$k3m$1@orphan.emich.edu>

Hi,
Can anyone refer to a good perl book Thanks.

Frank





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

Date: Mon, 14 May 2001 18:07:23 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: perl book
Message-Id: <3B0010CB.E86B0862@bms.umist.ac.uk>

Frank A wrote:
> 
> Hi,
> Can anyone refer to a good perl book Thanks.
> 

<groan>  this should be a FAQ.

oh, I just checked... it is.

`perldoc -q book` gave me the following :-

=head1 Found in /usr/lib/perl5/5.00503/pod/perlfaq2.pod

=head2 Perl Books

A number of books on Perl and/or CGI programming are available.  A few
of
these are good, some are ok, but many aren't worth your money.  Tom
Christiansen maintains a list of these books, some with extensive
reviews, at http://www.perl.com/perl/critiques/index.html.

The incontestably definitive reference book on Perl, written by
the creator of Perl, is now in its second edition:

    Programming Perl (the "Camel Book"):
        by Larry Wall, Tom Christiansen, and Randal Schwartz
        ISBN 1-56592-149-6      (English)
        ISBN 4-89052-384-7      (Japanese)
        URL: http://www.oreilly.com/catalog/pperl2/
    (French, German, Italian, and Hungarian translations also
    available)

The companion volume to the Camel containing thousands
of real-world examples, mini-tutorials, and complete programs
(first premiering at the 1998 Perl Conference), is:

    The Perl Cookbook (the "Ram Book"):
        by Tom Christiansen and Nathan Torkington,
                    with Foreword by Larry Wall
        ISBN: 1-56592-243-3
        URL:  http://perl.oreilly.com/cookbook/

If you're already a hard-core systems programmer, then the Camel Book
might suffice for you to learn Perl from.  But if you're not, check
out:

    Learning Perl (the "Llama Book"):
        by Randal Schwartz and Tom Christiansen
                    with Foreword by Larry Wall
        ISBN: 1-56592-284-0
        URL:  http://www.oreilly.com/catalog/lperl2/

Despite the picture at the URL above, the second edition of "Llama
Book" really has a blue cover, and is updated for the 5.004 release
of Perl.  Various foreign language editions are available, including
I<Learning Perl on Win32 Systems> (the Gecko Book).

If you're not an accidental programmer, but a more serious and possibly
even degreed computer scientist who doesn't need as much hand-holding as
we try to provide in the Llama or its defurred cousin the Gecko, please
check out the delightful book, I<Perl: The Programmer's Companion>,
written by Nigel Chapman.
 
You can order O'Reilly books directly from O'Reilly & Associates,
1-800-998-9938.  Local/overseas is 1-707-829-0515.  If you can
locate an O'Reilly order form, you can also fax to 1-707-829-0104.
See http://www.ora.com/ on the Web.
 
What follows is a list of the books that the FAQ authors found
personally
useful.  Your mileage may (but, we hope, probably won't) vary.
 
Recommended books on (or mostly on) Perl follow; those marked with
a star may be ordered from O'Reilly.
 
=over
 
=item References
 
    *Programming Perl
        by Larry Wall, Tom Christiansen, and Randal L. Schwartz
 
    *Perl 5 Desktop Reference
        By Johan Vromans
 
=item Tutorials
 
    *Learning Perl [2nd edition]
        by Randal L. Schwartz and Tom Christiansen
            with foreword by Larry Wall
 
    *Learning Perl on Win32 Systems
        by Randal L. Schwartz, Erik Olson, and Tom Christiansen,
            with foreword by Larry Wall
 
    Perl: The Programmer's Companion
        by Nigel Chapman
 
    Cross-Platform Perl
        by Eric F. Johnson
 
    MacPerl: Power and Ease
        by Vicki Brown and Chris Nandor, foreword by Matthias Neeracher
 
=item Task-Oriented
 
    *The Perl Cookbook
        by Tom Christiansen and Nathan Torkington
            with foreword by Larry Wall
 
    Perl5 Interactive Course [2nd edition]
        by Jon Orwant
 
    *Advanced Perl Programming
        by Sriram Srinivasan
 
    Effective Perl Programming
        by Joseph Hall
 
=item Special Topics
 
    *Mastering Regular Expressions
        by Jeffrey Friedl
 
    How to Set up and Maintain a World Wide Web Site [2nd edition]
        by Lincoln Stein
 
=back
 
HTH

Paul


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

Date: Mon, 14 May 2001 18:48:24 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: perl book
Message-Id: <Pine.LNX.4.30.0105141848070.31938-100000@lxplus003.cern.ch>

On Mon, 14 May 2001, Frank A wrote:

> Can anyone refer to a good perl book Thanks.

Not just "anyone".  The FAQ.



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

Date: Mon, 14 May 2001 13:03:28 -0500
From: Jesse James Jensen <jesse@uchicago.edu>
Subject: perl prints asychronously - compiler/interpreter optimization?
Message-Id: <3B001DF0.FF782677@uchicago.edu>

Sometimes, when a program is going to take a long time to do something,
I want it to print out little status messages for me (mostly just when
I'm still writing it).  The problem is that they don't really help. 
With code like this:

##### START #####
#!/usr/bin/perl
use strict;
my $i = 0;

print "Opening file... ";
open (BIGFILE, "bigfile.txt") or die "File not found.\n";
print "Done\n";

print "Arrayifying file... ";
@input  =   <BIGFILE>;
print "Done\n";

print "Closing file... ";
close BIGFILE;
print "Done\n";

print "Doing complicated stuff... ";
foreach my $line (@input) {
	# do various perlfunctions to $line here
	$i++;
	print "."  if (  ($i %   500)  == 0 );
	print "\n" if (  ($i % 25000)  == 0 );
}
print "\nDone\n";
##### END #####

What happens when I run is that the program waits, then prints out 
"Opening file... Done" all at once, then waits, and prints out
"Arrayifying file... Done" all at once, then waits, then prints out
"Closing file... Done" all at once, then waits and prints out a row of
dots all at once, then waits and prints out another row of dots, until
it's done.

Why does perl do this?  Is it some quirk of the optimizer that puts
printing in a different thread than doing other stuff?  It seems that
perl considers printing a newline to be more noteworthy than printing
things on the same line.  Is there a way to make it DWIW without
hampering performance?


jjj


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

Date: Mon, 14 May 2001 17:12:00 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Probably a simple question...
Message-Id: <3B0003D0.74EE3BD8@schaffhausen.de>

Robb Meade schrieb:
> 
> Hi all,

> This is the line I have... :
> 
> my $link="www.kingswoodweb.net/boomshankers/mailing-sub.asp" & "?" & "name="
> & $name & "&" & "surname=" & $surname & "&" & "email=" & $to;
> Does the something & something & something not work in Perl as it does in
> ASP??

ASP is not bound to a certain language. Thats like saying does the & not work
in Perl as it does in CGI.

The string concatenation operator in Perl is the . (dot). You are probably
thinking in VisualBasic terms. Personally I think Smalltalk's komma is
the most
natural sign for the task, but well...

Oh, by the way, in Perl there is of course another way to do it:

$link = "www.bla.com?name=$name&surname=$surname&bla=$bla";

works just as well. Thats what's called variable interpolation which works
inside double quotes. It compiles to the same thing as the dot writing
but 
looks much more clearer.

Hope this helps,
->malte


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

Date: Mon, 14 May 2001 16:18:21 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Probably a simple question...
Message-Id: <3AFFF73D.1B9D917A@bms.umist.ac.uk>

Robb Meade wrote:
> 
> Hi all,
> 
> I have little to no knowledge of Perl, but I have managed, with a little
> help from this NG a few weeks back to get together just a little bit of code
> for a mailing list system...
> 
> My only problem I have now is trying to build up a link within the code...
> 
> This is the line I have... :
> 
> my $link="www.kingswoodweb.net/boomshankers/mailing-sub.asp" & "?" & "name="
> & $name & "&" & "surname=" & $surname & "&" & "email=" & $to;
> 
> so, when I put that in the main body of the email when it arrives in my
> inbox it should read something like :
> 
> www.kingswoodweb.net/boomshankers/mailing-sub.asp?name=Robb&surname=Meade&em
> ail=webmaster@kingswoodweb.net
> 
> Unfortunately - it isnt working...
> 
> Everything else is - but the $link is just blank in my emails?
> 
> Does the something & something & something not work in Perl as it does in
> ASP??

The string concatenation operator is '.' in perl.

my
$link="www.kingswoodweb.net/boomshankers/mailing-sub.asp"."?"."name=".
   $name."&"."surname=".$surname."&"."email=".$to;

but you could just write
my
$link="www.kingswoodweb.net/boomshankers/mailing-sub.asp?name=$name&surname=$surname&email=$to";

HTH

Paul


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

Date: Mon, 14 May 2001 16:24:52 +0100
From: "Robb Meade" <Ask@For-It.Com>
Subject: Re: Probably a simple question...
Message-Id: <9dot90$obf$1@newsg1.svr.pol.co.uk>

Thanks everyone :)

I actually found the DOT thing out about an hour after posting, and wasnt
sure if putting it all in the " would work..but thanks for your help :)

--

Robb Meade

Kingswood Web Services
www.kingswoodweb.net


"Robb Meade" <Ask@For-It.Com> wrote in message
news:9doo8u$pae$1@newsg4.svr.pol.co.uk...
> Hi all,
>
> I have little to no knowledge of Perl, but I have managed, with a little
> help from this NG a few weeks back to get together just a little bit of
code
> for a mailing list system...
>
> My only problem I have now is trying to build up a link within the code...
>
> This is the line I have... :
>
> my $link="www.kingswoodweb.net/boomshankers/mailing-sub.asp" & "?" &
"name="
> & $name & "&" & "surname=" & $surname & "&" & "email=" & $to;
>
> so, when I put that in the main body of the email when it arrives in my
> inbox it should read something like :
>
>
www.kingswoodweb.net/boomshankers/mailing-sub.asp?name=Robb&surname=Meade&em
> ail=webmaster@kingswoodweb.net
>
> Unfortunately - it isnt working...
>
> Everything else is - but the $link is just blank in my emails?
>
> Does the something & something & something not work in Perl as it does in
> ASP??
>
> Any help appreciated...
>
> --
>
> Robb Meade
>
> Kingswood Web Services
> www.kingswoodweb.net
>
>
>
>




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

Date: 14 May 2001 09:08:17 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Probably a simple question...
Message-Id: <m1u22nvrpq.fsf@halfdome.holdit.com>

>>>>> "Paul" == Paul Boardman <peb@bms.umist.ac.uk> writes:

Paul> my
Paul> $link="www.kingswoodweb.net/boomshankers/mailing-sub.asp?name=$name&surname=$surname&email=$to";

And when you send this as part of HTML, you'll need to also escape
those & as &amp; globally.  And before that, $name and $surname and
$to need to have been prepared to be form variables.

It's probably easiest to use modules for all of this.  First, construct
the URL:

    use URI;
    my $url = URI->new("http://www.kingswoodweb.net/boomshankers/mailing-sub.asp");
    $url->query_form( name => $name, surname => $surname, email => $to );

Then escape it to be included as an HREF link:

    use HTML::Entities;
    print '<a href="', encode_entities("$url"), '">write me!</a>';

There.  All tidy, and always correct, no matter what's in $name,
$surname, or $to.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 14 May 2001 18:01:12 +0100
From: nobull@mail.com
Subject: Re: regex stuck up~
Message-Id: <u9sni7sx96.fsf@wcl-l.bham.ac.uk>

"“Z©Ņ¤ō@!”±o^" <crud_alex@yahoo.com> writes:

> print (<FILE> =~ /\Q<div align="left">\E(.*)\Q</div>\E/s);
> 
> i just wanna know what's going on with the error below :

So you don't want us to point out all your other mistakes... OK, I'll
bite my tongue.  (Suffice it to say you've made all the usual newbie
mistakes).

> Bareword found where operator expected at C:\DOCUME~1\ALEX\Ra-”Ó\test.pl
> line 4, near "/\Q<div align="left">\E(.*)\Q</div"
>  (Missing operator before div?)

If you have a quoted-string-like construct (like say a regex enclosed
by //) and you want to use the quoting character ('/') within the
string you must precede it with a backslash.

BTW: the \Q and \E are redundant as none of the characters you are
using are meta in Perl regex.  Oops, sorry, I said I wasn't going to
point out any other errors.  I'll stop now, honest.

> begin 666 getword[1].txt
> M#0H-"CQH=&UL/@T*/&AE860^#0H\;65T82!H='1P+65Q=6EV/2)#;VYT96YT
> M+51Y<&4B(&-O;G1E;G0](G1E>'0O:'1M;#L@8VAA<G-E=#UB:6<U(CX-"CQT

Please do not post encoded documents.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Mon, 14 May 2001 12:24:03 -0500
From: Jesse James Jensen <jesse@uchicago.edu>
Subject: Re: Req. for help: need biometric guniea pigs
Message-Id: <3B0014B3.E9CCCDCA@uchicago.edu>

Philip Newton wrote:
> 
> On 13 May 2001 21:42:51 -0500, logan@cs.utexas.edu (Logan Shaw) wrote:
> 
> > In article <CAGL6.7$F21.2158@vic.nntp.telstra.net>,
> > Wyzelli <wyzelli@yahoo.com> wrote:
> > >"Mike Schiraldi" <mgs21@columbia.edu> wrote in message
> > >news:Pine.GSO.4.10.10105131644070.2204-100000@aloha.cc.columbia.edu...
> > >>
> > >> my $PHRASE = "The quick brown fox";
> > >
> > >Shouldn't you use the full phrase "The quick brown fox jumped over the lazy
> > >dog"?  It is generally used since it contains each letter of the alphabet at
> > >least once.
> >
> > Except "s", which is why the sentence actually used is "The quick brown
> > fox jumps over the lazy dog."
> 
> Well, since we're nitpicking, I prefer "The quick brown fox jumps over a
> lazy dog", which is two letters shorter. Or "Jackdaws love my big sphinx
> of quartz".
> 

No, no, you want:

"Dub waltz, nymph, for quick jigs vex." or "Cwm, fjord-bank glyphs vext
quiz."


jjj


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

Date: Mon, 14 May 2001 15:55:53 GMT
From: "KapTin KiRk" <pswordkirk@msn.com>
Subject: Re: Sorting a variable
Message-Id: <deTL6.417$v5.31821@news1.rdc1.ct.home.com>

I tried a couple variations on that with no luck :(

"Logan Shaw" <logan@cs.utexas.edu> wrote in message
news:<9dnld6$k6l$1@ahab.cs.utexas.edu>...
> If I were doing this, I would first grab all the data:
>
[cut]
>
> Then, change each delimited string into a (reference to a) list of
> fields:
>
[cut]
>
> And then sort it by some field (the first one?  I forgot):
>
[cut]
>
> Then, do whatever you want with each entry with a foreach loop:
>
[cut]




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 896
**************************************


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