[6787] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 412 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 2 07:07:13 1997

Date: Fri, 2 May 97 04:00:22 -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           Fri, 2 May 1997     Volume: 8 Number: 412

Today's topics:
     Re: [++] Re: Question: regexp reduction? <billc@tibinc.com>
     Re: [DRAFT] RFD: comp.lang.perl.{data-structure,inter-p (Tad McClellan)
     Re: [DRAFT] RFD: comp.lang.perl.{data-structure,inter-p (David Alan Black)
     Re: [DRAFT] RFD: comp.lang.perl.{data-structure,inter-p (Tung-chiang Yang)
     Re: a question on striping characters (Abigail)
     getting and derefencing in one go (Kyzer)
     Re: Good editor for W95? <peterm@zeta.org.au>
     Re: help:  perl docs in german (Erik Braun)
     Hostname (Magnus S|derstr|m MNF94)
     How do I round things off? <tomkruk@perfekt.net>
     I need help with Perl <spudm@grove.ufl.edu>
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th <fellowsd.cs@man.ac.uk>
     Looking for more SPEED! <ntrivedi@shrike.depaul.edu>
     Re: Loosing clpm regulars (was Re: Perl auto-replier) (Tad McClellan)
     Re: Notice to antispammers PLEASE READ (Jeff Yoak)
     ODBC driver for Informix and Perl (Eric Harley)
     Re: Output of sorted dated from an array into a table? (Rachel Polanskis)
     Re: Perl 5.003 bug??? <vlefevre@ens-lyon.fr>
     Re: Perl 5.003 bug??? <vlefevre@ens-lyon.fr>
     Re: Perl code-writing standards (Tad McClellan)
     problems with the debugger <lpa@sysdeco.no>
     Q on:   map { @M=$_=~/(\S+)/g && [$_, $M[$col]]  } @in; <jong@mrc-lmb.cam.ac.uk>
     Re: quoting parens in m() expression <dbenhur@egames.com>
     select and FD_ macro's? <rob@flnet.nl>
     What is the best way of learning Perl? (Philippe Benichou)
     Re: What is the best way of learning Perl? <togtog@bewley.net>
     Write form to variable (Eric Harley)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 02 May 1997 01:58:07 -0400
From: Bill Cowan <billc@tibinc.com>
To: yingchen@fir.fbc.com
Subject: Re: [++] Re: Question: regexp reduction?
Message-Id: <3369826F.5197@tibinc.com>

Quentin Fennessy wrote:
> 
> In article <33665DA6.41C67EA6@fir.fbc.com>,
> Ying Chen  <yingchen@fir.fbc.com> wrote:
> [...]
> >let say if one has a arbiturary regexp -
> >is there a way (maybe algorithm) to tell if
> >the regexp can be reduced/simplified??
> 
> I don't think there is an automatic technique for reducing
> or simplifying regexps.  Of course, there is still Jeffrey...
> And reading his book.
> 
> --
> Quentin Fennessy                        AMD, Austin Texas

Using /x option (e.g. "s/pattern/replace/x") should help to simplify a
complex regular expression.  The /x allows comments/whitespace inside
regexp to explain each part of pattern step-by-step. A good example is
on page 71, Camel II.

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: Thu, 1 May 1997 23:39:22 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: [DRAFT] RFD: comp.lang.perl.{data-structure,inter-process,programmer,regex}
Message-Id: <q5rbk5.76a.ln@localhost>

A. Deckers (I-hate-cyber-promo@man.ac.uk) wrote:


[ snip ]

: + that contains more quoted than unquoted text. This condition
:   will not be applied to articles containing less than 20 lines
:   of body text, excluding the signature if one is found. Articles
:   without any unquoted text, not taking into account the
:   signature if one is present, will be rejected;


I don't like this one. I can easily envision going on for many lines
with current code and an English description, and getting six
lines of code as an answer.

I often see followup posts before (sometimes a day or two) I see
the original post that they are replying to. The above restriction
pretty much ensures that the followup is not "self-contained"
enough. May not even be able to tell what the question was at all,
until it comes around on the newsfeed.

If the consensus is to leave this as is, I suppose I would still
vote yes though.



[ snip ]



: [snip other similar charters]
        ^^^^^^^^^^^^^^^^^^^^^^

for comp.lang.perl.programmer I would like an explicit clause
encouraging readers to NOT answer FAQs in the newsgroup. A
pointer by email, or no response at all, should be given for
such questions posted to c.l.p.programmer.




[ snip ]

--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 2 May 1997 07:20:09 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: [DRAFT] RFD: comp.lang.perl.{data-structure,inter-process,programmer,regex}
Message-Id: <5kc4j9$q7g@pirate.shu.edu>

Hello -

I-hate-cyber-promo@man.ac.uk (A. Deckers) writes:

>I have received enough positive responses to make me feel it's
>worthwhile to move ahead with this. This draft contains a rationale for
>all groups and the charter for the data structures group. The other
>charters would be similar, except for the obvious changes.

I would definitely support this.  I do, however, anticipate that some
topic areas may not fit comfortably into exactly one of the four
proposed groups.  On the other hand, it would be much better to
go ahead with it, and deal with that difficulty if and when it
arises, than to let things go on the way they are.

>+ whose subject or body doesn't contain one or more words from a
>  list designated by the moderation panel. Initially, this list
>  will contain the words "scalar, array, list, hash, string,
>  object, reference" and their plurals;

Can we add 'typeglob'? :-)

>+ that is deemed to contain text encoded using HTML or similar
>  schemes;

While I completely share the general alarm at the flood of
irrelevant HTML/CGI questions in clpm, I would question whether
it is indeed *impossible* for a worthwhile question about
Perl data structures to contain fragments of HTML.  If the
question is basically sound, but some sample code/data happens
to involve HTML, I don't think the poster should be excluded.

>+ that contains more quoted than unquoted text. This condition
>  will not be applied to articles containing less than 20 lines
>  of body text, excluding the signature if one is found. Articles
>  without any unquoted text, not taking into account the
>  signature if one is present, will be rejected;

The last clause sounds good, but I share Tad's reservations generally
about this provision.

>+ that contains a signature over 10 lines in length;

Could we make it 6? :-)


David Black
dblack@icarus.shu.edu


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

Date: Fri, 2 May 1997 08:09:19 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: [DRAFT] RFD: comp.lang.perl.{data-structure,inter-process,programmer,regex}
Message-Id: <tcyangE9JnzJ.5qF@netcom.com>

That could have killed Randal's signature :)

=================================
David Alan Black (dblack@icarus.shu.edu) wrote:

: (deleted)

: >+ that contains a signature over 10 lines in length;

: Could we make it 6? :-)

--
Tung-chiang Yang                       tcyang@netcom.com

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.clever.net/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: Fri, 2 May 1997 03:52:23 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: a question on striping characters
Message-Id: <E9JC3B.3Au@nonexistent.com>

On 1 May 1997 18:44:51 GMT, Jeff Stampes wrote in comp.lang.perl.misc
URL: news:5kaob4$bi0$1@neocad.com:
++ 
++ spanky@direct.ca wrote:
++ : how can you strip the character string, Ex ->  "I_LIKE_THE_NUMBER_9"
++ : to get just the number 9?
++ 
++ By reading the perlfunc manpage and studying the substr() function,
++ or the perlre manpage and understanding how regular expressions
++ work.  Or you could see the FAQ, or read any perl book, or even
++ search Deja News.
++ 
++ $foo = "I_LIKE_THE_NUMBER_9"
++ $bar = substr($foo,-1,1);

This gets the last character of the string, regardless whether it's
a number or not.

$foo = "I_LIKE_THE_NUMBER_9";
$bar =~ s/[^\d]+//g;

strips out all non numbers.


Abigail


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

Date: 2 May 1997 09:46:27 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: getting and derefencing in one go
Message-Id: <5kcd5j$3sn@info.abdn.ac.uk>


Hello, I like to pass in hashes (I will be caught one of these days)

#!/local/bin/perl -w
# this is an example, guv
use strict qw(subs vars refs); my %mates;
$mates{'james'}='clever'; $mates{'kevin'}='stupid';
print &myfunc("Hello", \%mates) || "bugger all\n";

sub myfunc {
  return unless my $name = shift @_;
  return unless my $hashref = shift @_;  # statement 1, get in ref arg
  my %hashes = %$hashref;                # statement 2, convert ref to var
  $name, ', I am kevin and I am ',%hashes{'kevin'},"\n";
}

Now, what I would like to know is:
Can I get arg2 in and dereferenced into %hashes with 1 statement,
rather than 2?

I was thinking 'my %hashes = %${shift @_};' but this nets me
a 'not a SCALAR reference'. I'm missing something here, and I haven't spotted
it in the FAQ or perlref manpage.

TIA

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!
"Cows can vary in length by up to one metre" - Open University


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

Date: Fri, 02 May 1997 16:09:57 +1000
From: "Peter G. Martin" <peterm@zeta.org.au>
Subject: Re: Good editor for W95?
Message-Id: <33698535.150E@zeta.org.au>

Benjamin Burack wrote:
> 
> I'm writing CGI scripts in perl on my W95 machine, and then uploading
> them to the Unix server.  I'm looking for recommendations on good
> editors that can easily save in a Unix format.
> 
Try emacs.  Works nicely in both environments.

Win 95/NT version should be at :

ftp://ftp.cs.washington.edu/pub/ntemacs/latest

You have the option to save in different formats if you want
to.  Mostly, if I have a line-end problem, I simply use 
Esc %     
Ctrl-Q Ctrl-M Ctrl-Q Ctrl-J
Ctrl-Q Ctrl-J  
(Query replace "^M^J" with "^J")

in the UNIX version if I've picked up DOS's CRLF
endings...

Now if you also pick up Ilya's cperl-mode.el, you get
nice coloured syntax and indenting and all that sort of
stuff ...   CPAN should have it in the ILYA directory
somewhere. 

And there are added extras to explore.
The UNIX emacs should be easy to find via GNU mirrors.
Consider Xemacs, too.. and you get web browsing as well!
-- 
Peter G. Martin, Contract Tech Writer
peterm@zeta.org.au  martin@shl.dec.com


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

Date: 2 May 1997 09:11:16 GMT
From: erik@paxp01.mipool.uni-jena.de (Erik Braun)
Subject: Re: help:  perl docs in german
Message-Id: <slrn45mjbtk.1tm.erik@paxp01.mipool.uni-jena.de>

On Thu, 01 May 1997 21:47:07 +0200, Sniper <sniper@on-line.de> wrote:

>i'm looking for a perl documentation in german language
>(book, html, etc.).
>
>can anybody help me?

Why didn't ask you in de.comp.lang.perl?

Since everyone who's interested in this topic speaks german, I switch
to this language, weil ich's einfach besser kann:

Es gibt das Buch "Einfuehrung in Perl" von Randal Schwartz, welches sehr
gut zum Lernen ist. Weiterhin erscheint in Baelde (Ende April ;-)
"Programmieren in Perl", die Perl-Bibel vom Christiansen, Wall et al.
NICHT empfehlen kann ich "Beispielhaft programmieren in Perl" von
Ellie Quigley. Zumindest die deutsche Version ist so uebel gesetzt
(Programmtexte in serifenloser Proportionalschrift!), dass das Lernen
gar keinen Spass macht.

Versuchs auch mal mit:
       http://www.phy.uni-bayreuth.de/~btpa25/perl/perl_main.html

Viel Erfolg,
Erik
-- 
erik@minet.uni-jena.de


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

Date: 2 May 1997 09:30:55 GMT
From: masoders@news.abo.fi (Magnus S|derstr|m MNF94)
Subject: Hostname
Message-Id: <5kcc8f$7hf@josie.abo.fi>



				Hello,

				I have a small problem that I would need to solve somehow:

				I need to get the hostname of the computer that I am currently
				logged into. I tried to look at the man pages, found a
				gethostbyaddr, but the man page itself didn't explain anything
				intelligent about the command. 

				Is that the command to use, and if so, how do is it to be used?
				Or can I get the hostname by another way? From an enviromental
				variable?

				Thanks,

				Magnus
-- 

	 masoders@aton.abo.fi		
	"Impressive young Gates, but you are not a Unix yet"


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

Date: Fri, 2 May 1997 01:48:46 -0400
From: "Tom Kruk" <tomkruk@perfekt.net>
Subject: How do I round things off?
Message-Id: <5kbvgi$373@linet06.li.net>

Have 
you ever had this problem?

You are doing some kind of math procedure in perl and you are
multiplying decimals like (tax) .0825 and the result is an answer
with as many decimals. I was wondering if someone could help
me or point me in the right direction,

If I get something like 80.0456 how do I round it to 80.05 or how do I cut
off the 56
to get 80.04 ???

If anyone could answer I would greatly appreciate it!!

Thanks 

Tom





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

Date: Thu, 01 May 1997 21:05:33 -0400
From: Jeremy James <spudm@grove.ufl.edu>
Subject: I need help with Perl
Message-Id: <33693DDC.554DF708@grove.ufl.edu>

Hello -

I'm just beginning to learn Perl and I'm really confused about the
compilation process - the implimentation of Perl for database
manipultion.

I am working on a large web page - much like amozon.com ** lots of
databases** I'm learning Perl to acomplish this tremendous job.

Please E-mail me at spudm@grove.ufl.edu if your interested in talking me
through some of this.

Thank you



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

Date: 2 May 1997 09:36:34 GMT
From: Donal K. Fellows <fellowsd.cs@man.ac.uk>
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <5kccj2$bom@m1.cs.man.ac.uk>

In article <3070804442620792@naggum.no>, Erik Naggum  <erik@naggum.no> wrote:
> Donal K. Fellows wrote:
>> Erik Naggum wrote:
>>> (yes, CPU's _do_ have instructions that C compilers don't use.)
>> 
>> I take it you don't work in computer hardware design, and haven't even
>> looked at the field for at least 10 or 15 years, since that last
>> statement is plain wrong.  Maybe Vaxes had a "Reverse Bit Shift, Cast
>> to Type and Catch Fire if the Programmer is Stupid" instruction (with
>> mnemonic RBSCTCFPS :^) but technology is substantially advanced since
>> then.  RISC CPU's have only the instructions that are measured as
>> being needed in practice, and virtually all new designs are RISC (with
>> the notable distiction of the ix86 line of processors). In future, try
>> to check your facts, and especially those that have been contradicted
>> by people (with good reason) for loads of years...
> 
> the SPARC architecture has several instructions that C compilers doesn't
> use, but which are convenient with type-tagged languages.  the _fact_ is
> that it has an the instruction, with Sun's recommended mnemonic "taddcctv",
> that is specifically useful in Lisp, and specifically unused in C.  other
> instructions are also measurably useful in languages _other_ than C.

What does the instruction do?  I've not got a SPARC manual to hand and
I'm quite sure that there are other people reading this thread who are
also unaware of the meaning of that instruction.  I must admit that
when I read it, I immediately think of something to do with Closed
Circuit Television - obviously, I'm way off the mark with that!  :^)

> C is _not_ the be-all, end-all of programming languages and C is _not_ the
> universal assembler that some would like it to be.  that you cannot even
> put this instruction to use without a lot of prior work that you also have
> a hard time doing in C, shows that the SPARC designers thought of more than
> increasingly myopic C crowd.

I was thinking in reference to the ARM, x86 and MIPS architectures
(which I know much better than SPARC).  Erik, if you are going to
claim something about the general case, you should have more than one
example lined up to illustrate your case.

> actually, I find it rather astonishing to learn that some people are so
> belligerently ignorant as to believe they can pull off a stunt like the
> above from D. K. Fellows.

Now, now, now.  There was no need for that last paragraph.  It turns
your argument from one of (reasonable) strength into one of ad hominem
flaming.  If you wish your technical points to be taken seriously by
most people on USENET, cutting out this sort of thing is going to be
virutally essential.

BTW, if you can point to a special instruction used in Lisp but not C
in the ARM architecture, I would like to know so that I can pass that
information on to the asynchronous microprocessor design team in my
department.  At the moment, their benchmarking is done using standard
pieces of C, and adding a new benchmark which exercises parts of the
silicon that other benchmarks do not reach would be of great utility
to them.

Donal.  (still in a good mood)
--
Donal K. Fellows   http://r8h.cs.man.ac.uk:8000/  (SAY NO TO COMMERCIAL SPAMS!)
(work) fellowsd@cs.man.ac.uk     Dept. Comp. Sci, Univ. Manchester, U.K.
 |     donal@ugglan.demon.co.uk  6,Randall Place, Heaton, Bradford, U.K. (home)
 +-> ++44-161-275-6137  Send correspondence to my office  ++44-1274-401017 <-+


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

Date: Thu, 01 May 1997 23:45:43 -0700
From: Nik Trivedi <ntrivedi@shrike.depaul.edu>
Subject: Looking for more SPEED!
Message-Id: <33698D97.45D2@shrike.depaul.edu>

Hello fellow programmers,

I was looking for a way to speed up some of my perl scripts, so I just
had a few questions.  What is faster, a for loop or a while loop?  A
switch or a series of else-if statements?  Any help is greatly
appreciated!

Nik Trivedi
ntrivedi@shrike.depaul.edu


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

Date: Thu, 1 May 1997 22:12:31 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Loosing clpm regulars (was Re: Perl auto-replier)
Message-Id: <v2mbk5.lu9.ln@localhost>

Eli the Bearded (usenet-tag@qz.little-neck.ny.us) wrote:
: A. Deckers <I-hate-cyber-promo@man.ac.uk> wrote:
: >I would like to know what regular readers of clpm think about adding a
: >comp.lang.perl.moderated to the pre-RFD. As I doubt we could find
: >enough human moderators willing to take on the job, I propose an
: >auto-moderated group.  Articles would have to include a "magic cookie"
: >in a given header in order to be passed by the moderation script. IMHO,
: >this should cut down the noise level to almost zero, as anyone who

: The hierarchy which cannot be mentioned uses several other strong
: tools, including arbitrary killing of stuff from certain providers.
: Additionally they keep vigilant watch on who gets feeds and are not
: averse to revoking feeds from sites that misbehave. I don't think
: anything looser could keep noise down to zero. Robomoderated groups
: will still get questions from the persistant clueless, but it may
: help.

: Elijah
: ------
: I'd vote for it.
  ^^^^^^^^^^^^^^^

Me too.  (no, I am not posting from AOL ;-)


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Fri, 02 May 1997 03:50:10 GMT
From: jeff@yoak.com (Jeff Yoak)
Subject: Re: Notice to antispammers PLEASE READ
Message-Id: <5kc2r8$qmd@sjx-ixn4.ix.netcom.com>

tadmc@flash.net (Tad McClellan) wrote:

>I would be very surprised if the harvesters don't already attempt
>to unmunge addresses.

>s/[ _-]*at[ _-]*/@/i;  

>would yield a significant number of addresses to send crap to...

I wouldn't be surprised.  Anyone who takes deliberate steps to avoid
being hit by UCE isn't in the target audience anyway.  If you did get
such names the only thing they would be good for would be to add to
the remove list.  Another thing that I know at least one person does
is strip all email addresses from net-abuse groups and add them to the
universal remove file.  Anyone posting there isn't going to be helpful
to send junk to.  Why send mail to people almost certain to cause you
grief.

Cheers,
Jeff

Jeff Yoak  jeff@yoak.com  http://yoak.com/



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

Date: Thu, 01 May 1997 22:30:35 -0700
From: erich@powerwareintl.com (Eric Harley)
Subject: ODBC driver for Informix and Perl
Message-Id: <erich-0105972230360001@ppp-207-104-16-35.snrf01.pacbell.net>

Does anybody know of an ODBC driver for Informix that is compatible with
the Win32::ODBC module?

Thanks!
Eric Harley
erich@powerwareintl.com


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

Date: 1 May 1997 12:05:57 GMT
From: rachel@virago.org.au (Rachel Polanskis)
Subject: Re: Output of sorted dated from an array into a table?
Message-Id: <5ka0v5$l4s@janis.virago.org.au>


Many thanks to everyone who replied, and helped me to 
learn a little more about arrays, lists and hashes.

rachel

                 defghijklmnopqrstuvwxyz:  What? No ABC?
--
Rachel Polanskis                 Kingswood, Greater Western Sydney, Australia 
grove@zeta.org.au                http://www.zeta.org.au/~grove/grove.html
r.polanskis@nepean.uws.edu.au    http://www.nepean.uws.edu.au/ccd/
                Witty comment revoked due to funding cuts


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

Date: 1 May 1997 18:17:17 GMT
From: Vincent Lefevre <vlefevre@ens-lyon.fr>
Subject: Re: Perl 5.003 bug???
Message-Id: <5kamnd$s6g@cri.ens-lyon.fr>

In article <5kab4h$b9j$1@amdint2.amd.com>, Quentin Fennessy <quentin@remington.amd.com> wrote:
>              If the PATTERN evaluates to a null string, the last
>              successfully executed regular expression is used
>              instead.

Thanks for all the replies. Now, this does not explain why the following
script does *not* die:

foreach ("a 0","b 0")
  {
    print "1 $_\n";
    "a" =~ // or die;
    if (1)
    {
      print "2 $_\n";
      / / and print "3 $_\n";
    }
  }

It prints:
1 a 0
2 a 0
3 a 0
1 b 0
2 b 0
3 b 0

If I remove the test and the inner block, it dies as expected.

-- 
Vincent Lefevre, vlefevre@ens-lyon.fr | Acorn Risc PC, StrongARM @ 202MHz
http://www.ens-lyon.fr/~vlefevre      | 20+1MB RAM, Eagle M2, TV + Teletext
PhD in Computer Science, 1st year     | Apple CD-300, SyQuest 270MB (SCSI)
-----------------------------------------------------------------------------


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

Date: 1 May 1997 22:00:57 GMT
From: Vincent Lefevre <vlefevre@ens-lyon.fr>
Subject: Re: Perl 5.003 bug???
Message-Id: <5kb3qp$66e@cri.ens-lyon.fr>

In article <r53es6hpro.fsf@tvmaster.turner.com>, Mike Campbell <mcampbel@tvmaster.turner.com> wrote:
> Incidentally, a Very Common way to "set a variable to something if it
> isn't already set" is to: (using $d and ".", as in the shown example)

> $d ||= ".";

No, this doesn't work if $d is "0", since 0 is regarded as false.
In this case, "0" would be replaced, and this is not the wanted
behavior.

Of course, this is a correct solution if it can be ensured that $d
isn't "0" (or something like that).

-- 
Vincent Lefevre, vlefevre@ens-lyon.fr | Acorn Risc PC, StrongARM @ 202MHz
http://www.ens-lyon.fr/~vlefevre      | 20+1MB RAM, Eagle M2, TV + Teletext
PhD in Computer Science, 1st year     | Apple CD-300, SyQuest 270MB (SCSI)
-----------------------------------------------------------------------------


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

Date: Thu, 1 May 1997 22:27:32 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl code-writing standards
Message-Id: <4vmbk5.r0a.ln@localhost>

Mark Bradshaw (not@hoople.demon.co.uk) wrote:
: Folks,

: The company I currently work for are keen to introduce Perl as one of
: the development languages which can be used.  However in order to
: do this we have to develop some minimal standards as to how to
: structure code, what debugging routines to embed into the code, etc.
: Are there any such standards already available or do we have to start
: from scratch?


I would be sure to include:


1) ALWAYS use the -w switch

2) use strict;

3) always use the -w switch


;-)


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Fri, 02 May 1997 12:36:55 +0200
From: Luca Passani <lpa@sysdeco.no>
Subject: problems with the debugger
Message-Id: <3369C3C7.7998@sysdeco.no>

Every time I start the debugger I get all of these messages, even though
everyhting seems to work OK afterwards.

Does anybody understand what's going wrong?

thanx

Luca

Current directory is /net/ocelot/data1/users/lpa/Systemator/bin/
Stack dump during die enabled outside of evals.

Loading DB routines from perl5db.pl patch level 0.9907
Emacs support enabled.

Enter h or `h h' for help.

Use of uninitialized value at /usr/local/lib/perl5/Carp.pm line 42.
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_</usr/local/lib/perl5/Carp.pm') called at
/usr/local/lib/perl5/Carp.pm line 0
	require Carp.pm called at /usr/local/lib/perl5/site_perl/Data/Dumper.pm
line 20
	Data::Dumper::BEGIN() called at /usr/local/lib/perl5/Carp.pm line 0
	eval {...} called at /usr/local/lib/perl5/Carp.pm line 0
	require Data/Dumper.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 9
	main::BEGIN() called at /usr/local/lib/perl5/Carp.pm line 0
	eval {...} called at /usr/local/lib/perl5/Carp.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_</usr/local/lib/perl5/Exporter.pm') called at
/usr/local/lib/perl5/Exporter.pm line 0
	require Exporter.pm called at /usr/local/lib/perl5/Carp.pm line 35
	require Carp.pm called at /usr/local/lib/perl5/site_perl/Data/Dumper.pm
line 20
	Data::Dumper::BEGIN() called at /usr/local/lib/perl5/Exporter.pm line 0
	eval {...} called at /usr/local/lib/perl5/Exporter.pm line 0
	require Data/Dumper.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 9
	main::BEGIN() called at /usr/local/lib/perl5/Exporter.pm line 0
	eval {...} called at /usr/local/lib/perl5/Exporter.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_</usr/local/lib/perl5/site_perl/Data/Dumper.pm')
called at /usr/local/lib/perl5/site_perl/Data/Dumper.pm line 0
	require Data/Dumper.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 9
	main::BEGIN() called at /usr/local/lib/perl5/site_perl/Data/Dumper.pm
line 0
	eval {...} called at /usr/local/lib/perl5/site_perl/Data/Dumper.pm line
0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_</usr/local/lib/perl5/vars.pm') called at
/usr/local/lib/perl5/vars.pm line 0
	require vars.pm called at
/usr/local/lib/perl5/PA-RISC1.1/5.00393/DynaLoader.pm line 15
	DynaLoader::BEGIN() called at /usr/local/lib/perl5/vars.pm line 0
	eval {...} called at /usr/local/lib/perl5/vars.pm line 0
	require DynaLoader.pm called at
/usr/local/lib/perl5/site_perl/Data/Dumper.pm line 18
	require Data/Dumper.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 9
	main::BEGIN() called at /usr/local/lib/perl5/vars.pm line 0
	eval {...} called at /usr/local/lib/perl5/vars.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.

DB::postponed('*main::_</usr/local/lib/perl5/PA-RISC1.1/5.00393/DynaLoader.pm')
called at /usr/local/lib/perl5/PA-RISC1.1/5.00393/DynaLoader.pm line 0
	require DynaLoader.pm called at
/usr/local/lib/perl5/site_perl/Data/Dumper.pm line 18
	require Data/Dumper.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 9
	main::BEGIN() called at
/usr/local/lib/perl5/PA-RISC1.1/5.00393/DynaLoader.pm line 0
	eval {...} called at
/usr/local/lib/perl5/PA-RISC1.1/5.00393/DynaLoader.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.

DB::postponed('*main::_</usr/local/lib/perl5/PA-RISC1.1/5.00393/Config.pm')
called at /usr/local/lib/perl5/PA-RISC1.1/5.00393/Config.pm line 0
	require Config.pm called at
/usr/local/lib/perl5/PA-RISC1.1/5.00393/DynaLoader.pm line 18
	require DynaLoader.pm called at
/usr/local/lib/perl5/site_perl/Data/Dumper.pm line 18
	require Data/Dumper.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 9
	main::BEGIN() called at
/usr/local/lib/perl5/PA-RISC1.1/5.00393/Config.pm line 0
	eval {...} called at /usr/local/lib/perl5/PA-RISC1.1/5.00393/Config.pm
line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_</usr/local/lib/perl5/AutoLoader.pm') called at
/usr/local/lib/perl5/AutoLoader.pm line 0
	require AutoLoader.pm called at
/usr/local/lib/perl5/PA-RISC1.1/5.00393/DynaLoader.pm line 19
	require DynaLoader.pm called at
/usr/local/lib/perl5/site_perl/Data/Dumper.pm line 18
	require Data/Dumper.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 9
	main::BEGIN() called at /usr/local/lib/perl5/AutoLoader.pm line 0
	eval {...} called at /usr/local/lib/perl5/AutoLoader.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.

DB::postponed('*main::_</usr/local/lib/perl5/PA-RISC1.1/5.00393/Socket.pm')
called at /usr/local/lib/perl5/PA-RISC1.1/5.00393/Socket.pm line 0
	require Socket.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 11
	main::BEGIN() called at
/usr/local/lib/perl5/PA-RISC1.1/5.00393/Socket.pm line 0
	eval {...} called at /usr/local/lib/perl5/PA-RISC1.1/5.00393/Socket.pm
line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_</usr/local/lib/perl5/strict.pm') called at
/usr/local/lib/perl5/strict.pm line 0
	require strict.pm called at Dialogsys.pm line 2
	Dialogsys::BEGIN() called at /usr/local/lib/perl5/strict.pm line 0
	eval {...} called at /usr/local/lib/perl5/strict.pm line 0
	require Dialogsys.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 15
	main::BEGIN() called at /usr/local/lib/perl5/strict.pm line 0
	eval {...} called at /usr/local/lib/perl5/strict.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<Component.pm') called at Component.pm line 0
	require Component.pm called at Dialogsys.pm line 5
	Dialogsys::BEGIN() called at Component.pm line 0
	eval {...} called at Component.pm line 0
	require Dialogsys.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 15
	main::BEGIN() called at Component.pm line 0
	eval {...} called at Component.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<Dialogsys.pm') called at Dialogsys.pm line 0
	require Dialogsys.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 15
	main::BEGIN() called at Dialogsys.pm line 0
	eval {...} called at Dialogsys.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<Block.pm') called at Block.pm line 0
	require Block.pm called at WindowBlock.pm line 4
	WindowBlock::BEGIN() called at Block.pm line 0
	eval {...} called at Block.pm line 0
	require WindowBlock.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 18
	main::BEGIN() called at Block.pm line 0
	eval {...} called at Block.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<WindowBlock.pm') called at WindowBlock.pm line
0
	require WindowBlock.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 18
	main::BEGIN() called at WindowBlock.pm line 0
	eval {...} called at WindowBlock.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<SimpleBlock.pm') called at SimpleBlock.pm line
0
	require SimpleBlock.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 19
	main::BEGIN() called at SimpleBlock.pm line 0
	eval {...} called at SimpleBlock.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<TableBlock.pm') called at TableBlock.pm line 0
	require TableBlock.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 20
	main::BEGIN() called at TableBlock.pm line 0
	eval {...} called at TableBlock.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<MenuBar.pm') called at MenuBar.pm line 0
	require MenuBar.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 21
	main::BEGIN() called at MenuBar.pm line 0
	eval {...} called at MenuBar.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<Menu.pm') called at Menu.pm line 0
	require Menu.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 22
	main::BEGIN() called at Menu.pm line 0
	eval {...} called at Menu.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<ToolBar.pm') called at ToolBar.pm line 0
	require ToolBar.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 23
	main::BEGIN() called at ToolBar.pm line 0
	eval {...} called at ToolBar.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<ListBlock.pm') called at ListBlock.pm line 0
	require ListBlock.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 24
	main::BEGIN() called at ListBlock.pm line 0
	eval {...} called at ListBlock.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<NoteBook.pm') called at NoteBook.pm line 0
	require NoteBook.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 25
	main::BEGIN() called at NoteBook.pm line 0
	eval {...} called at NoteBook.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<GeneralBlock.pm') called at GeneralBlock.pm
line 0
	require GeneralBlock.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 28
	main::BEGIN() called at GeneralBlock.pm line 0
	eval {...} called at GeneralBlock.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<DataBlock.pm') called at DataBlock.pm line 0
	require DataBlock.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 29
	main::BEGIN() called at DataBlock.pm line 0
	eval {...} called at DataBlock.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<ButtonBlock.pm') called at ButtonBlock.pm line
0
	require ButtonBlock.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 30
	main::BEGIN() called at ButtonBlock.pm line 0
	eval {...} called at ButtonBlock.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<EntityBlock.pm') called at EntityBlock.pm line
0
	require EntityBlock.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 31
	main::BEGIN() called at EntityBlock.pm line 0
	eval {...} called at EntityBlock.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<Cof.pm') called at Cof.pm line 0
	require Cof.pm called at Button.pm line 2
	Button::BEGIN() called at Cof.pm line 0
	eval {...} called at Cof.pm line 0
	require Button.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 34
	main::BEGIN() called at Cof.pm line 0
	eval {...} called at Cof.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<Button.pm') called at Button.pm line 0
	require Button.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 34
	main::BEGIN() called at Button.pm line 0
	eval {...} called at Button.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<MenuChoice.pm') called at MenuChoice.pm line 0
	require MenuChoice.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 35
	main::BEGIN() called at MenuChoice.pm line 0
	eval {...} called at MenuChoice.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<Label.pm') called at Label.pm line 0
	require Label.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 38
	main::BEGIN() called at Label.pm line 0
	eval {...} called at Label.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<Vaf.pm') called at Vaf.pm line 0
	require Vaf.pm called at TextField.pm line 3
	TextField::BEGIN() called at Vaf.pm line 0
	eval {...} called at Vaf.pm line 0
	require TextField.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 42
	main::BEGIN() called at Vaf.pm line 0
	eval {...} called at Vaf.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.
	DB::postponed('*main::_<TextField.pm') called at TextField.pm line 0
	require TextField.pm called at
/net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line 42
	main::BEGIN() called at TextField.pm line 0
	eval {...} called at TextField.pm line 0
Use of uninitialized value at /usr/local/lib/perl5/perl5db.pl line 1188.

DB::postponed('*main::_</net/ocelot/data1/users/lpa/Systemator/bin/convertdia.p...')
called at /net/ocelot/data1/users/lpa/Systemator/bin/convertdia.pl line
487
  DB<1>


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

Date: Fri, 02 May 1997 10:21:13 +0100
From: Jong <jong@mrc-lmb.cam.ac.uk>
Subject: Q on:   map { @M=$_=~/(\S+)/g && [$_, $M[$col]]  } @in;
Message-Id: <3369B209.41C6@mrc-lmb.cam.ac.uk>

Hi,

I am making a subroutine which uses map to sort
things in any column given.
The map function part above does not seem to produce
array and put it to next level 
&& [$_, $M[$col]]

The whole line is:

$col=2;

@out= map {$_->[0]} sort { $a->[1] <=> $b->[1] } map {@M=$_=~/(\S+)/g &&
[$_, $M[$col]]  } @in;


Can anybody help me?

thanks,


Jong


-- 
 I support Perl, Linux ...

With OVER SIX MILLION USERS, up from only ten or so a very few years
ago, Linux has taken it's place as the world's #3 computer operating
system overall. And Linux is breathing down the neck of #2 for very good
reasons. If growth rate to date continues, Linux will be the #1 computer
operating system by late '98 or '99. Are YOU ready?

	  ) Linux Newsletter

http://www.smli.com/people/john.ousterhout/scripting.html


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

Date: Thu, 01 May 1997 22:13:25 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: Tim Smith <trs@azstarnet.com>
Subject: Re: quoting parens in m() expression
Message-Id: <336977F5.863@egames.com>

[mail&post]
Tim Smith wrote:
> I get the following error:
> /^\s*
>         ([\w\\]+)\s+                    # tag
>         ([\w\\]+)\s*                    # keyword
>         (\([\s\w\\,]*))?\s*             # field
++++                   ^ missing \ here
>         (?::\s*([\w\\]+))?\s*           # base
>         (.+)?$                          #
> /: unmatched () in regexp at /tmp/trstest line 15.

Not sure how close what you posted is to what
you compiled, but you forgot to escape that
closing paren there.

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"No, I'm not going to explain it. If you can't figure it out, 
 you didn't want to know anyway..." --Larry Wall




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

Date: Fri, 02 May 1997 11:03:25 +0200
From: Rob J Meijer <rob@flnet.nl>
Subject: select and FD_ macro's?
Message-Id: <3369ADDD.ABD@flnet.nl>


I am triing to write a litle single process server deamon,
but in the Camel book i can find some info on select, but non
on a way to find out what handles are ready.
What would be the perl equivalents to the following macro's found in c?

FD_SET(fd, &fdset)
FD_CLR(fd, &fdset)
FD_ISSET(fd, &fdset)
FD_ZERO(&fdset)

Or does perl require other methods of finding out what socket handles
are ready?

T.I.A.

Rob J Meijer


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

Date: 2 May 1997 03:31:23 GMT
From: benichop@reality.cse.fau.edu (Philippe Benichou)
Subject: What is the best way of learning Perl?
Message-Id: <5kbn6b$eh6$1@cybernet.cse.fau.edu>

What is the best way for learning Perl?  Looking at other people's scripts
is too confusing, and the O'Rielly book doesn't explain things well.
 
Thank you in advance,

Phil (please email responses)

--
I believe the purpose of life is to       Philippe Martin Benichou
 live and then to die, with some          http://www.cse.fau.edu/~benichop
 entertainment sometime in between.       benichop@cse.fau.edu


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

Date: Fri, 02 May 1997 03:42:53 -0300
From: Paul Ramsey <togtog@bewley.net>
To: Philippe Benichou <benichop@reality.cse.fau.edu>
Subject: Re: What is the best way of learning Perl?
Message-Id: <33698CEB.789D@bewley.net>

> What is the best way for learning Perl?  Looking at other people's scripts
> is too confusing, and the O'Rielly book doesn't explain things well.
>  
> Thank you in advance,
> 
> Phil (please email responses)

The best book I have found to be is _Teach yourself Perl5 in 21 days_
$40

Another good book is _CGI Programming on the World Wide Web_
$30

Hope this helps!


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

Date: Thu, 01 May 1997 22:33:10 -0700
From: erich@powerwareintl.com (Eric Harley)
Subject: Write form to variable
Message-Id: <erich-0105972233100001@ppp-207-104-16-35.snrf01.pacbell.net>

how would I write a format to a variable instead of writing it out to a
file handle?


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

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

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