[18210] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 378 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 28 18:06:14 2001

Date: Wed, 28 Feb 2001 15:05:18 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <983401517-v10-i378@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 28 Feb 2001     Volume: 10 Number: 378

Today's topics:
    Re: Absent Config.pm <bertilow@chello.se>
        ANNOUNCE: moodss-14.0 <jfontain@free.fr>
    Re: Attachments <peter.sundstrom-eds@eds.com>
        DBI Proxy: Constructor didn't return a handle <arifsaha@yahoo.com>
        Display Delay in Perl? <ranch@lager.engsoc.carleton.ca>
    Re: Display Delay in Perl? <shanem@ll.mit.edu>
    Re: Display Delay in Perl? <comdog@panix.com>
        Excluding commented lines from a grep search <jose.acosta@intel.com>
    Re: Glob & long directory names (Soren Andersen)
    Re: Help deciphering Perl code <mischief@velma.motion.net>
    Re: How are SOL_SOCKET and SO_REUSEADDR defined in vari (Abigail)
    Re: How are SOL_SOCKET and SO_REUSEADDR defined in vari <revjack@revjack.net>
    Re: How the CLPM turns <godzilla@stomp.stomp.tokyo>
    Re: How the CLPM turns <mischief@velma.motion.net>
    Re: How the CLPM turns <lmoran@wtsg.com>
    Re: Learning Perl and I need help. <c_clarkson@hotmail.com>
    Re: Learning Perl and I need help. <peter.sundstrom-eds@eds.com>
    Re: Learning Perl <dhwild@argonet.co.uk>
        Need help with an array... u678619384@spawnkill.ip-mobilphone.net
    Re: Newbie - HTML Mail <peter.sundstrom-eds@eds.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 28 Feb 2001 21:12:32 GMT
From: "Bertilo Wennergren" <bertilow@chello.se>
Subject: Re: Absent Config.pm
Message-Id: <4Rdn6.1844$bX.27691@nntp1.chello.se>

Vinny Murphy:

> The following should give you where it is, else there is a problem with
> your perl distribution.

> % perl -le 'for( @INC ) { print "$_/Config.pm" if -f "$_/Config.pm"}'

> on DOS machines change the quoting.

On DOS machines use this:

  perl -le "for( @INC ) { print \"$_/Config.pm\" if -f \"$_/Config.pm\"}"

-- 
#####################################################################
                         Bertilo Wennergren
                 <http://purl.oclc.org/net/bertilo>
                        <bertilow@chello.se>
#####################################################################




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

Date: Wed, 28 Feb 2001 21:17:55 GMT
From: Jean-Luc Fontaine <jfontain@free.fr>
Subject: ANNOUNCE: moodss-14.0
Message-Id: <3A9D6B01.83F13FB2@free.fr>

Hi everybody: here is a new version of moodss.


Check it out! (or at least the screenshots at
http://jfontain.free.fr/moodss3.gif or
http://jfontain.free.fr/moodss4.gif :).


Notes:
- moodss modules can now be written in Python! Sample randpy and
minipy modules are provided. Documentation (see randpy.py file)
needs improving. Feedback is highly welcomed.
(modules can also be written in Perl, and Tcl of course)
- please let me know if you are interested in writing modules in
Ruby (I'm on a roll :-)

### CHANGES ###

--- version 14.0 ---
modules can now be written in the Python language (the tclpython
  package is required, available in my homepage)
added Python based randpy and minipy modules

### README ###

This is moodss (Modular Object Oriented Dynamic SpreadSheet) version
14.0.

Moodss won in the Best System Admin Technology category (Tcl Tips and
Tricks, Valuable Real World Programming Examples) at the O'Reilly
Tcl/Tk 1999 Conference.
Linux Magazine calls it a "lifesaver".
Tucows gives it 5 stars (cows or penguins :-).

Moodss is a modular application. It displays data described and
updated in one or more modules, which can be specified in the command
line or dynamically loaded or unloaded while the application is
running. Data is originally displayed in tables. Graphical views
(graph, bar, 3D pie charts, ...), summary tables (with current,
average, minimum and maximum values) and free text viewers can be
created from any number of table cells, originating from any of the
displayed viewers. Thresholds can be set on any number of cells.

Specific modules can easily be developed in the Tcl, Perl and Python
scripting languages or in C.

A thorough and intuitive drag'n'drop scheme is used for most viewer
editing tasks: creation, modification, type mutation, destruction,
 ... and thresholds creation. Table rows can be sorted in increasing or
decreasing order by clicking on column titles. The current
configuration (modules, tables and viewers geometry, ...) can be saved
in a file at any time, and later reused through a command line switch,
thus achieving a dashboard functionality.

The module code is the link between the moodss core and the data to be
displayed. All the specific code is kept in the module package. Since
module data access is entirely customizable (through C code, Tcl,
Perl, Python, HTTP, ...) and since several modules can be loaded at
once, applications for moodss become limitless.
For example, thoroughly monitor a dynamic web server on a single
dashboard with graphs, using the Apache, MySQL, cpustats, memstats,
 ...  modules. If you have replicated servers, dynamically add them to
your view, even load the snmp module on the fly and let your
imagination take over...

Along with a core trace module, random, ps, cpustats, memstats,
diskstats, mounts, route, arp, kernmods, netdev, pci, system, MySQL
(myquery, mystatus, myprocs, myvars) modules for Linux, ping, snmp and
snmptrap for UNIX, apache and apachex modules are included (running
"wish moodss ps cpustats memstats" mimics the "top" application with a
graphic edge and remote monitoring capability).

Thorough help is provided through menus, widget tips, a message area,
a module help window and a global help window with a complete HTML
documentation.

Moodss is multi-langual thanks to Tcl internationalization
capabilities. So far only English and partially French are
supported. Help with other languages will be very warmly welcomed.

Development of moodss is continuing and as more features are added in
future versions, backward module code compatibility will be maintained.

I cannot thank the authors of the tkTable, BLT, MIME/SMTP and the HTML
libraries enough for their great work.

In order to run moodss, you need to install the following packages
(unless you can use the rpm utility, see below):
Tcl/Tk 8.3.1 or above, at (or at a mirror near you)
  http://dev.scriptics.com/ or ftp://ftp.scriptics.com/
the latest tkTable widget library at:
  http://www.hobbs.wservice.com/tcl/main.html
the latest BLT library at:
  ftp://tcltk.sourceforge.net/pub/tcltk/blt/
eventually the latest tclperl library for writing modules in Perl, or
the latest tclpython library for writing modules in Python at:
  http://jfontain.free.fr/
(see the INSTALL file for complete instructions, for UNIX and also
Windows platforms).

You also have the option of using the moodss rpm file (also in my
homepage), if you are using a Redhat Linux system (6.0 or above).
You can find the required tcl, tk, tktable, blt, tcpperl and other
rpms at: http://jfontain.free.fr/

Whether you like it (or hate it), please let me know. I would like to
hear about bugs and improvements you would like to see. I will correct
the bugs quickly, especially if you send me a test script (module code
with a data trace would be best).

###

you may find it now at my homepage:

http://jfontain.free.fr/moodss-14.0.tar.gz
http://jfontain.free.fr/moodss-14.0-1.i386.rpm
http://jfontain.free.fr/moodss-14.0-1.spec

and a bit later at:

ftp://contrib.redhat.com/ in libc6 sub-directory.

Enjoy and please let me know what you think.


--
Jean-Luc Fontaine  mailto:jfontain@free.fr  http://jfontain.free.fr/





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

Date: Thu, 1 Mar 2001 10:09:35 +1300
From: "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
Subject: Re: Attachments
Message-Id: <97jpeg$db$1@hermes.nz.eds.com>


"Todd Anderson" <todd@mrnoitall.com> wrote in message
news:3A9D2A7B.DA7B5DC8@mrnoitall.com...
> Dear Sirs,

What about the other half, or have they had sex changes?




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

Date: Wed, 28 Feb 2001 21:00:46 GMT
From: S P Arif Sahari Wibowo <arifsaha@yahoo.com>
Subject: DBI Proxy: Constructor didn't return a handle
Message-Id: <Pine.LNX.4.21.0102280932390.1080-100000@gede.parokinet.org>

Hi!

I tried to connect to an Oracle database using DBI Proxy, but when I ran
the script in the client side, it gave this error:

DBI->connect(hostname=x.x.x;port=3012;dsn=DBI:Oracle:host=x.x.x;sid=xsid)
failed: Constructor didn't return a handle:  at ./search.pl line 62

The Oracle part using DBD::Oracle has been tried both locally and
remotely. I tried to run the script from the same machine (the database
server) with same error. I confirmed that dbiproxy is running. I tried
mode=single & mode=fork with no change.

I use RedHat Linux 7, perl-5.6.0-9, perl-DBI-1.14-8 (ProxyServer 0.2003),
PlRPC-0.2014, Net-Daemon-0.34, Storable-1.0.10, DBD-Oracle-1.06, Oracle
8.1.6.

Here is the line from the script:

my $db= DBI->connect("DBI:Proxy:hostname=x.x.x;port=3012;".
                     "dsn=DBI:Oracle:host=x.x.x;sid=xtir", 
                     $user, $pwd) || err_db();

Here is configuration file for dbiproxy:

{
    'facility' => 'daemon',
    'pidfile' => '/var/run/dbiproxy.pid',
    'user' => 'nobody',
    'group' => 'nobody',
    'localport' => 3012,   
    'logfile' => '/var/log/dbiproxy.log',
    'maxmessage'=> 1073741824,
    'mode' => 'single',
    'clients' =>
        [
         {
             'mask' => '^192\.168\.100\.\d+$',
             'accept' => 1,
         },
         {
             'mask' => '.*',
             'accept' => 0,
         },
         ],
}

Actually, on compilation PlRPC had a little problem: make test falled:

t/base..............ok                                                       
t/client............Use of uninitialized value in concatenation (.) at
t/lib.pl line 30.
Use of uninitialized value in concatenation (.) at t/lib.pl line 31.
Use of uninitialized value in concatenation (.) at t/lib.pl line 32.
t/client............NOK 10FAILED tests 1-10                                  
        Failed 10/10 tests, 0.00% okay
t/compress..........skipped test on this platform
t/crypt.............skipped test on this platform
t/methods...........Use of uninitialized value in concatenation (.) at
t/lib.pl line 30.
Use of uninitialized value in concatenation (.) at t/lib.pl line 31.
Use of uninitialized value in concatenation (.) at t/lib.pl line 32.
t/methods...........ok 11/11FAILED tests 1-9                                 
        Failed 9/11 tests, 18.18% okay
Failed Test  Status Wstat Total Fail  Failed  List of failed
-------------------------------------------------------------------------------
t/client.t                   10   10 100.00%  1-10
t/methods.t                  11    9  81.82%  1-9
2 tests skipped.
Failed 2/5 test scripts, 60.00% okay. 19/24 subtests failed, 20.83% okay.

But somebody said to go on, so I installed it anyway.

-- 
                                   S P Arif Sahari Wibowo
  _____  _____  _____  _____ 
 /____  /____/ /____/ /____          arifsaha@yahoo.com
_____/ /      /    / _____/       http://www.arifsaha.com/



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

Date: 28 Feb 2001 21:38:57 GMT
From: Ranjithalingam Camalalingam <ranch@lager.engsoc.carleton.ca>
Subject: Display Delay in Perl?
Message-Id: <97jr5h$etq$1@bertrand.ccs.carleton.ca>

Hi Friends,

How do i delay print an output?(in monitor)
say i want to print "Hello World!";

I want each letter in "Hello World" to appear after 1 second delay.
Example:

Sec.	Letter
1	H
2	He
3	Hel
4	Hell
5	Hello
and so on...
Please Help Me out!

-- 
-------------------------------------------
==Ranch== Camalalingam
ranch@canada.com
Faculty of Engineering, Carleton University


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

Date: Wed, 28 Feb 2001 17:06:12 -0500
From: Shane McDaniel <shanem@ll.mit.edu>
Subject: Re: Display Delay in Perl?
Message-Id: <3A9D7654.141CA5C4@ll.mit.edu>

foreach $let (split //, "Hello World!")
{
	print $let;
	sleep 1;
}

Ranjithalingam Camalalingam wrote:
> 
> Hi Friends,
> 
> How do i delay print an output?(in monitor)
> say i want to print "Hello World!";
> 
> I want each letter in "Hello World" to appear after 1 second delay.
> Example:
> 
> Sec.    Letter
> 1       H
> 2       He
> 3       Hel
> 4       Hell
> 5       Hello
> and so on...
> Please Help Me out!
> 
> --
> -------------------------------------------
> ==Ranch== Camalalingam
> ranch@canada.com
> Faculty of Engineering, Carleton University


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

Date: Wed, 28 Feb 2001 17:16:50 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: Display Delay in Perl?
Message-Id: <comdog-C2DBBD.17165028022001@news.panix.com>

In article <3A9D7654.141CA5C4@ll.mit.edu>, Shane McDaniel 
<shanem@ll.mit.edu> wrote:

> Ranjithalingam Camalalingam wrote:

> > I want each letter in "Hello World" to appear after 1 second delay.
> > Example:

> > Sec.    Letter
> > 1       H
> > 2       He
> > 3       Hel
> > 4       Hell
> > 5       Hello
> > and so on...


> foreach $let (split //, "Hello World!")
> {
> 	print $let;
> 	sleep 1;
> }

don't forget to set the filehandle to piping hot:

#!/usr/bin/perl

$|++;  # flush after each print

print, sleep 1 while ( $_ = substr "Hello!", $pos++, 1 );

-- 
brian d foy <comdog@panix.com>



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

Date: Wed, 28 Feb 2001 14:11:49 -0700
From: "Jose Acosta" <jose.acosta@intel.com>
Subject: Excluding commented lines from a grep search
Message-Id: <97jpim$ko0@news.or.intel.com>

I am trying to grep for certain lines in a file containing a certain word
but would like to exclude lines that are commented out.  In the following
example I want to retrieve the first five rows but not the sixth since it is
commented out.  I am then placing the third column, which is the name of the
printer, into an array for processing.  Can anybody help me figure out how
to exclude this line.  The code I have does not recognize the line with the
# sign in front so I cannot even do an if statement checking to see if the #
sign appears.  I think it is seeing it as a comment but I am not sure.

FILE:
BG!int4100tcp!tictest1!chdigi01!2102!5

BG!int4100tcp!tictest2!chdigi01!2103!5

BG!int4100tcp!tictest3!chdigi01!2104!5

BG!int4100tcp!tictest4!chdigi01!2105!5

BG!int4100tcp!tictest5!wrxlabdp!2102!5

#BG!int4100tcp!tictest6!wrxlabdp!2102!5

CODE:

chomp(@prclst = `cat $prclst`);

@command=(grep(/int4100tcp/, @prclst));


foreach $iter (@command) {

@a = split("!", $iter);

`echo "a is" >> $maxDir/$me.lastrun`;

`echo @a >> $maxDir/$me.lastrun`;

`echo $a[1] $a[2] $a[3] >> $maxDir/$me.

`echo "This is a test" $a[2]"END" >> $ma


if ($a[0])

{

`echo "in if" >> $maxDir/$me.lastrun`;

push(@barcd, $a[2]);

}

};





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

Date: 28 Feb 2001 19:17:04 GMT
From: soren@spmfoiler.removethat.wonderstorm.com (Soren Andersen)
Subject: Re: Glob & long directory names
Message-Id: <97jirg$9d3$1@slb6.atl.mindspring.net>

a.mcintosh@lilly.nospam.com (Mac) wrote in
<er4n6.1$Z3.128@iq-lilly1>: 

{snip}
>I get an array of all the file names - no name length limit - but I
>only get folder names that are 8.3 or less in length.
>If I glob("/123456789/*.*") I get the contents of *that* folder -
>excepting any folders with long names ...
>
>Is there another module I could use ?
>Any other way to get a complete list ?
>
>Any help appreciated

I'd really suggest you devote time to paistakingly persuing the HTML 
documentation tree that's installed automatically by ActivePerl when you setup. 
(Your Q is basically a Perl-Win32 FAQ, unquestionably). This ng and similar 
fora are not, common behavior (and what it suggests) to the contrary, in 
existance so that people can avoid studying the documentation.

That said -- and I don't mean to sound like a scold -- the answer might be (and 
BTW your prob with glob is something I hadn't stumbled across) the Win32 module  
subroutine Win32::GetLongPathName, which will return the LFN of any DOS 8.3 
name (real name -- the file/dir has to actually exist -- this actually checks 
the physical filesystem unlike most such similar-seeming routines in other 
File:: modules) fed to it. Tip: avoid using backslashes (even tho that's 
natural for WinDOS) in the shortname parameter / argument.

  hth,
     soren andersen



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

Date: Wed, 28 Feb 2001 21:30:01 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Help deciphering Perl code
Message-Id: <t9qrep3aa8p767@corp.supernews.com>

Falc2199 <falc2199@aol.comnojunk> wrote:


> The following code selects a line randomly from a file....

> while (<FILE>)
> {
>   if (rand($.) < 1) 
> {
>    $line = $_;
> }

> }

Others have done a good job explaining the logic of the above. I'll
go ahead and extend it to multi-line parts of files. The below reads
a file such that:

    /^%%$/           starts a new section (as does /^%$/ for backwards
                     compatibility with fortune files [1] )
    /^;/             indicates a comment line,

and

    anything else    is part of a section.

It randomly prints one of the sections.


###----- _begin_ _code_ -----
#!/usr/bin/perl -w
use strict;

open(TL, "./.taglines") || die "./.taglines could not be read: $!\n";

my $add_to_string = my $tags = 0;
my $string = '';
while(<TL>) {
    if(/^%{1,2}$/) {
        $tags++;
        if( $add_to_string ) {
            $add_to_string = 0;
        } elsif( rand($tags) < 1 ) {
            $add_to_string = 1;
            $string = '';
        }
    } elsif(/^;/) {
        # comment in the file
    } elsif($add_to_string) {
        $string .= $_;
    }
}
print $string;
exit(0);
###----- _end_ _code_ -----


This boils down from my initial version of the above, which is here:


###----- _begin_ _code_ -----
#!/usr/bin/perl -w
use strict;

open(TL, "./.taglines") || die "./.taglines could not be read: $!\n";

my $tags = 0;
while(<TL>) {
    $tags++ if /^%{1,2}$/;
}

my $which_tag = int(rand($tags));
$tags = 0;
seek(TL, 0,0);

while(<TL>) {
    if(/^%{1,2}$/) {
        $tags++;
        if($tags > $which_tag) {
            last;
        }
    } elsif(/^;/) {
    } elsif($which_tag == $tags) {
            print("$_");
    }
}
exit(0);
###----- _end_ _code_ ------


My original version doesn't store $_ into another variable, and it
does use only two scalars instead of three. However, on average the
original goes through the lines of a file about 1.5 times instead
of the 1 time of the version adapted from the FAQ, and it has the
overhead of a seek() thrown in. These are small differences, but
the usage pattern of the program is on potentially very long files
with many fairly short sections.

How at least some versions of fortune handle the efficiency problem
is by having an indexing option to create an index file. You can
then pick a random value from the index file and map it to the text
file. Some versions of fortune also randomly choose which file from
which to read which might even be weighted in a config file, or they
let you choose the topic file from which you would like your quote
or anecdote to come.

NOTE 1: I allowed one minor incompatibility with traditional fortune
files. Normally, a fortune file uses /^%$/ as a section _end_, not
a section _beginning_. The difference is because fortune compatibility
was an afterthought. Either way, just add a double-oh-seven at the top
of the file and delete the one at the bottom and you're set. Otherwise,
my program works with fortune's files but the first section may as
well be a comment and the last section will be considered empty. You
may not want an empty fortune sneaking in, but jsut for variety's sake
you may. The fortune programs often don't have a concept of comments,
which my program does. I haven't made mine work with multiple files and
all just yet because I use it as a tagline generator for my signature
in tin.

Chris

-- 
Christopher E. Stith
Parking for people we like only. All other vehicles will be vandalized.



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

Date: 28 Feb 2001 19:48:26 GMT
From: abigail@foad.org (Abigail)
Subject: Re: How are SOL_SOCKET and SO_REUSEADDR defined in various flavors of Unix?
Message-Id: <slrn99qlga.hu2.abigail@tsathoggua.rlyeh.net>

Kenny McCormack (gazelle@yin.interaccess.com) wrote on MMDCCXXXVIII
September MCMXCIII in <URL:news:97jcnv$m0p$1@yin.interaccess.com>:
:} In article <comdog-987647.12052028022001@news.panix.com>,
:} brian d foy  <comdog@panix.com> felt compelled to opine:
:} ...
:} >this is not mathematics.  if you want to masturbate about theorems and
:} >proofs and systems that's fine.  most of us, however, live in the real
:} >world.  real world solutions often involve cleverness and indirect
:} >solutions.  it is often the postulates that are the problem, just as in
:} >this case.
:} 
:} It is hysterical that you should say this.  I have been arguing that
:} although "install Perl (completely)" may be the theoretically correct
:} answer, the fact is that in the real world, you may have to make do with
:} less.  Part of living in the real world is accepting that you may not be
:} able to get your clients to install huge development environments on their
:} systems just to run one little application.


This group is about Perl. It's not about customer relationships. And if
it's just a tiny little application that doesn't deserve something "huge"
like Perl, please meet mister /bin/sh. He's happy to serve you.

You can always charge your customer for the training you need to take
to operate in his/her environment. Oh, then the customer hires someone
cheaper? Not our fucking problem. Welcome to the real world.



Abigail
-- 
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print 
               qq{Just Another Perl Hacker\n}}}}}}}}}'    |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w


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

Date: 28 Feb 2001 20:20:39 GMT
From: revjack <revjack@revjack.net>
Subject: Re: How are SOL_SOCKET and SO_REUSEADDR defined in various flavors of Unix?
Message-Id: <97jmin$epi$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

I claim this thread in the name of Lemuria.

All Hail Lemuria.

-- 
___________________
revjack@revjack.net


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

Date: Wed, 28 Feb 2001 13:30:06 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: How the CLPM turns
Message-Id: <3A9D6DDE.6A1C54CF@stomp.stomp.tokyo>

Randal L. Schwartz wrote:
 
> mothra wrote:

(snippage)
 
> > How to spell check a textform field

> Hmm.  An idea for a snippet, but perhaps not a full program,
> so I'll file this in the "when I'm doing things to a form, what's
> one of them".
 
Back in 1991, when you and myself were teenagers and the better
qualities of these other yahoos were sheet wet spots, I purchased
a piece of software, "Writer's Toolkit," available only on ten
old fashion floppy disks, the 3.5 inch variety. Boggles me to
think I still have some 5.25 inch truly floppy disks.

Although antiquated and intended for Windows 3.1 and early
Windows 95, I do run this software on my new Pentium 3 class
machine. This software includes a Grammar Checker, a Spell Checker,
a Dictionary, a Thesaurus, a Knowledge Base, a Handbook Of Writing
Mechanics, Quotes and an Abbreviation Guide. It is a very decent
bit of software with extensive abilities.

What I enjoy the most, is its Grammar Checker. By default, this
software sets standardized grammar rules for writing styles
including, Business, Technical, Fiction, Academic, Legal, Formal,
Informal and user configurable rules for custom grammar checking.

You will note, this Writer's Toolkit includes a grammar checker
for Technical writings.

A truly valuable Perl module would be a grammar checker along the
lines of my Writer's Toolkit although this would be a module rarely
used by Perl Techno-Geeksters.

Randal, why don't you write a Grammar module so I can rip it
off and use it for my androids?

My Roberta The Remarkable Robot is now 1200 lines of Perl code
supported by over a gigabyte of data bases. Linking Roberta to her
databases is not a problem. However, more than half of her main
program is dedicated to grammar checking and writing mechanics.
Even so, she still creates, at times, on-the-fly, some of the 
most wanged out crazy statements you could ever read, all perfectly
grammatically correct and highly logical yet so strange as to cause
me to tug at my dyed black corkscrewy hair. She is a cute one
capable of very clever conversation.

Writing a grammar rule book, writing a mechanics of writing rule
book, is exceptionally challenging, seemingly an impossible task
to ever perfect to degree which complies with an English teacher's
inhuman expectations, even more inhuman considering my personality.

You are a talented Perl programmer Randal. Rather than write a
simple spell check for form textfields, write me a Grammar module.
Whatcha say?

Godzilla!


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

Date: Wed, 28 Feb 2001 21:54:30 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: How the CLPM turns
Message-Id: <t9qssmsflc4sb1@corp.supernews.com>

Bernard El-Hagin <bernard.el-hagin@lido-tech.net> wrote:

> Hi,

'Ello!

> 	After frequenting this newsgroup for over 2 years I've come to know
> some of the regular posters here and decided that, as a service to
> newbies, I'd write up some typical regular poster replies to typical
> newbie questions. That way someone new to the group can pick the style
> of answer he/she prefers and look for that person in the future.

This isn't a bad idea. If nothing else, it's humorous to other regulars.

> DISCLAIMER!
> My goal in doing this is not to offend anyone. Quite the contrary,
> actually.

It doesn't offend me, and I doubt it would if I was included. I do feel a
little left out considering I'm pretty regular these days (just look at the
stats), but I guess I haven't earned my stripes just yet. :-/

> __________
> Typical newbie question:

> Subject: NEWBIE DEMANDS HELP NOW!!!!!!

> I'm new to PERL. I want to sort an array, but don't know how. I've spent
> hours searching the Web, the docs, the FAQs, the books, and under my
> bed, but couldn't find the answer. You must help me NOW or I'll get
> fired.
> __________

I don't bother with my newsreader's killfile, but I'd be very likely to
skip a subject with a demand or the word 'demand' in it or with all caps.
Of course, asking how to do something 'on demand' in Perl is different.

If I would respond, I think you can tell whose posting style on the list
has affected my posting style:

> Martien Verbruggen:

> It's not clear from your post what it is you're sorting and how you want
> to sort it. If it's a simple ASCII sort you want just use the builtin sort
> function:

> my @sorted = sort @unsorted;

> If, on the other hand, you'd like to sort the array numerically, you'll 
> have to try something like:

> my @sorted = sort {$a <=> $b} @unsorted;

> To make that sort ascending just switch $a and $b:

> my @sorted = sort {$b <=> $a} @unsorted;

> Note that you can also ASCII sort in ascending order like so:

> my @sorted = sort {$b cmp $a} @unsorted;

> To get more information about sorting read:

> perldoc -f sort
> perldoc -q 'sort'
> __________

I tend to post voluminous messages with multiple examples. While I'm
sure I bother some people doing so, I haven't had complaints and some
neophytes have thanked me for my detail - so much as to follow up to
my email sometimes.

Sometimes I try to be more conscise, but I think that all the help
I've gotten from Martien, Uri, and some of the others who habitually
or sometimes make big posts has rubbed off.

While I'm at it, I'd like to thank Martien, Uri, nobull, Randal,
Anno, Abigail, and Ilmari for helping me grow as a Perl programmer.

Chris

-- 
Christopher E. Stith
Product shown enlarged to make you think you're getting more.



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

Date: Wed, 28 Feb 2001 17:21:13 -0500
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: How the CLPM turns
Message-Id: <5auq9t8gberef94purr8a5s6pi9rncq845@4ax.com>

On Tue, 27 Feb 2001 07:49:59 +0000 (UTC),
bernard.el-hagin@lido-tech.net (Bernard El-Hagin) wrote wonderful
things about sparkplugs:


Everything you wrote is excellent, and funny.  Should be posted on
perl.com!  One major ommision. Not one reponse contained the word:

plonk

<Lou ducks as kill filters slam over his head>


--
"> thanks in advance !!!
If you are going to do anything 'in advance' it should be RTFM."
       --swiped from a nobull clp.misc post

Lou Moran <lmoran@wtsg.com>


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

Date: Wed, 28 Feb 2001 16:25:13 -0600
From: "Charles K. Clarkson" <c_clarkson@hotmail.com>
Subject: Re: Learning Perl and I need help.
Message-Id: <38C8B40B6B470BF8.509D0CF31E78A6F6.94600A30297A04C5@lp.airnews.net>

Rick M <remalone@sympatico.ca> wrote:
: From a shell scripter to a perl programmer in 24 hours. Not likely!
: Its tough, trying to do in Perl what I used to do in shell, but I'm not
: giving up.
:
: How can I do this?
: if $string exists in @arr do this else do something else.
:
: I read
: perlfaq4 / : How_can_I_tell_whether_a_list_or_array_
: contains_a_certain_element_ html
: and much more but I still can't quite get my tongue around it.
:
: I tried this on my HP-UX 10.20 machine using perl v5.6.0
:
:    #!/opt/perl5/bin/perl -w
:    @FILES = ('file1', 'file2', 'file3', 'file4', 'file5');
:    print "@FILES\n";

    Since you asked about arrays, just ask the user for a number:

    print $_ + 1, " - $FILES[$_]\n" foreach 0 .. $#FILES;

:    print "Please select a file.\n";
:    chomp ($USERS_CHOICE = <STDIN>);  # A string (file name)
:                                                                        #
selected by user

    Decrement the user's choice:
    $USERS_CHOICE--;

:    if ($USERS_CHOICE eq $FILES[$USERS_CHOICE])
:    {
:       print "Good choice. Go to the next step.\n";
:    }
:    else
:    {
:       print "Sorry! That file does not exist.\n;
:       print "Please select another file.\n";
:    }
:
 [SNIP]

HTH,
Charles K. Clarkson

with a hash:

my %valid_files;
@valid_files{'file1', 'file2', 'file3', 'file4', 'file5'} = '1' x 5;
print join ', ', sort keys %valid_files;
print "\nPlease select a file.\n";
while (1) {
    chomp (my $users_choice = <STDIN>);
    last if $valid_files{$users_choice};
    print "Sorry! That file does not exist.\n",
            "Please select another file.\n"
}
print "Good choice. Go to the next step.\n";





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

Date: Thu, 1 Mar 2001 10:07:03 +1300
From: "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
Subject: Re: Learning Perl and I need help.
Message-Id: <97jp9n$vvn$1@hermes.nz.eds.com>


"Arvid Warnecke" <arvid.warnecke@tu-clausthal.de> wrote in message
news:cucj79.ln8.ln@heim2.tu-clausthal.de...
> Hello!
>
> In article <rM9n6.261720$Pm2.4067910@news20.bellglobal.com>, Rick M wrote:
> >
> >   #!/opt/perl5/bin/perl -w
> >   @FILES = ('file1', 'file2', 'file3', 'file4', 'file5');
> >   print "@FILES\n";
> >   print "Please select a file.\n";
> >   chomp ($USERS_CHOICE = <STDIN>);  # A string (file name) selected by
user
> >   if ($USERS_CHOICE eq $FILES[$USERS_CHOICE])
>
> I am not really sure about it, coz I am beginner, too, but I think you
> have to use if($USERS_CHOICE eq $FILES{$USERS_CHOICE})
>
> Hope that will work,
> Arvid

No it will not work.  Surely you test answers before posting them.




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

Date: Tue, 27 Feb 2001 21:39:18 +0000 (GMT)
From: David H Wild <dhwild@argonet.co.uk>
Subject: Re: Learning Perl
Message-Id: <4a539556a3dhwild@argonet.co.uk>

In article <kLUm6.4838$v5.17682@newsfeeds.bigpond.com>,
   Gregory Toomey <gtoomey@usa.net> wrote:

> Beginners Books:
> Don't laugh, I first learnt Perl with "Perl for Dummies" by Paul Hoffman.
> Cheap, comes with a CD, 4/5 stars at Amazon.com.

I've bought one or two of these "Dummies" books, and most of them are good.
I don't think I could bring myself to buy one of the "Complete Idiots"
books, though.

> Advanced Books:
> Programming Perl, by Larry Wall et al.
> Perl Cookbook, by Tom Christiansen et al.

Also from O'Reilly there is Learning Pearl, by Schwartz and Christiansen.

-- 
 __  __  __  __      __ ___   _____________________________________________
|__||__)/ __/  \|\ ||_   |   / Acorn StrongArm Risc_PC
|  ||  \\__/\__/| \||__  |  /...Internet access for all Acorn RISC machines
___________________________/ dhwild@argonet.co.uk



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

Date: Wed, 28 Feb 2001 22:13:05 GMT
From: u678619384@spawnkill.ip-mobilphone.net
Subject: Need help with an array...
Message-Id: <l.983398385.1275115966@[207.196.68.130]>

I have an array that looks like:

$webhost = 'app2.exactone.net';
$webpage[0] =
'/servlet/ApparelKeySearch?xaction=%2Fservlet%2FApparelKeySearch&iqformat=xml&
iqdtdtype=0&site=spreexml&keywords=' .$key.
'&logic=0&Submit=Submit+Query&maxpersite=1&maxtotal=100&pagesize=9999';
$webpage[1] =
'/servlet/AuctionKeySearch?xaction=%2Fservlet%2FAuctionKeySearch&iqformat=xml&
iqdtdtype=0&site=spreexml&keywords=' .$key.
'&logic=0&Submit=Submit+Query&maxpersite=1&maxtotal=100&pagesize=9999';

but, it goes up to $webpage[21], and I'm trying to call it like this:

$PageUrl  = 'http://' . $webhost . @webpage[0..21];
$rqst = HTTP::Request->new('GET', $PageUrl);

which is working only for the last URL ($webpage[21]).  Can anyone tell me how
to get it to do all of the webpage's?

Also... It's returning all of the content in XML, does anyone know how to just
get it return Apparel or Auction if there's content?  Rather than all of the
actual content.  Thanks so much in advance...Janet (please send reply to jgs2283@hotmail.com since I don't check newsgroups too often...) Thanks!

 



-- 
Sent by  jgs2283 from  hotmail within area com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.com/cgi/content/new


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

Date: Thu, 1 Mar 2001 09:45:58 +1300
From: "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
Subject: Re: Newbie - HTML Mail
Message-Id: <97jo28$tpv$1@hermes.nz.eds.com>


"Charles K. Clarkson" <c_clarkson@hotmail.com> wrote in message
news:CDCB8DD439FBDDBC.B721FFECE20DA91D.F2D95FC83167DE8D@lp.airnews.net...
> "Sharon Weis" <stiroff@elsitech.com> wrote
> : Hi,  I am new to Perl CGI and I am trying to send mail in HTML
> : format. I am using ActivePerl and installed the MIME::Lite
> : package. I am able to send mail successfully. However, it is
> : printing the following errors on my CGI form. I have never
> : modified, let alone opened the Config.pm or the Domain.pm.
> : I've noticed that 3 out of 4 errors have to do with the domain.
> : Am I suppose to modify these files and if so what am I
> : suppose to modify?
> [SNIP]
>
>     While it is possible, it is unlikely the error is in the modules.
> Why don't you show us the code you are using?

I'd bet with 99.99% certainty that it is a mail server configuration issue.




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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 378
**************************************


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