[13022] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 432 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 9 15:07:29 1999

Date: Mon, 9 Aug 1999 12:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 9 Aug 1999     Volume: 9 Number: 432

Today's topics:
        "next" and "previous" page links for search results <a.r.mccoy@larc.nasa.gov>
        [ANNOUNCE] Tie::SentientHash 0.53 <andrew@icarus.demon.co.uk>
    Re: Anyone know how to use perl to parse data and gener (Mark Leighton Fisher)
    Re: auto email <cassell@mail.cor.epa.gov>
        Bacon's Corollary to Godwin's Law (Greg Bacon)
        bracket syntax <anita.villanueva@intel.com>
    Re: bracket syntax <sariq@texas.net>
        Comm package <Monty.Scroggins@mci.com>
    Re: DBI ODBC memory leak?? mmixon@primacis.com
    Re: FAQ 1.3: Which version of Perl should I use? <cassell@mail.cor.epa.gov>
    Re: Fetch document via proxy <cassell@mail.cor.epa.gov>
    Re: How to embed Perl in Html code <cassell@mail.cor.epa.gov>
    Re: kill pid scripts <vlad@doom.net>
    Re: lstat on a unicode file in NT? (Tom Shou)
    Re: Nastiness contrary to the spirit of perl? <cmcurtin@interhack.net>
    Re: Nastiness contrary to the spirit of perl? (Anno Siegel)
    Re: Nastiness contrary to the spirit of perl? (Larry Rosler)
    Re: Nastiness contrary to the spirit of perl? (J. Moreno)
    Re: Nicer Way <clerke@emirates.net.ae>
    Re: NT Perl script archives <cassell@mail.cor.epa.gov>
        PGP FormMail - Need Help! <jskeet@cwcom.net>
    Re: PGP FormMail - Need Help! (brian d foy)
    Re: pricing a perl job (brian d foy)
        Recurse function kiran.dronamraju@metamor.com
    Re: Return Value from "system" call <cassell@mail.cor.epa.gov>
    Re: send perl-users mini-faq <cassell@mail.cor.epa.gov>
    Re: Simple write routine <uri@sysarch.com>
    Re: Simple write routine (Larry Rosler)
    Re: User Authentication (brian d foy)
    Re: Win32: Window title from process id? <carvdawg@patriot.net>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Mon, 9 Aug 1999 13:06:11 -0400
From: "Alan McCoy" <a.r.mccoy@larc.nasa.gov>
Subject: "next" and "previous" page links for search results
Message-Id: <7on1q0$gtv$1@reznor.larc.nasa.gov>

I'm trying to put together a script that uses the WWW::Search module to pull
search results from NorthernLight and display them 10 at a time on a web
page. Currently, I can get the first 10, but can't figure out how to make
the script create links for the "next" as well as the "previous" pages.

The current version of the script is at
http://act-pcweb.larc.nasa.gov/searchcode.txt.

Any help or suggestions on how to do this would be highly appreciated.

Alan McCoy
a.r.mccoy@larc.nasa.gov





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

Date: 9 Aug 1999 18:13:59 GMT
From: Andrew Ford <andrew@icarus.demon.co.uk>
Subject: [ANNOUNCE] Tie::SentientHash 0.53
Message-Id: <7on5p7$jc7$1@play.inetarena.com>

Version 0.53 of Tie::SentientHash has been uploaded to CPAN.  The man
page follows:


Name
       Tie::SentientHash - Perl module implementing intelligent
       objects

Synopsis
         use Tie::SentientHash;

         $hashref = new Tie::SentientHash $meta_data, $initial_data;
         $untiedhash = $hashref->export;
         $metadata   = $hashref->_metadata;

         $hashref->{key} = 'value';
         $hashref->{key1}{key2} = $value;
         $value2 = $hashref->{key};
         undef $hashref;

Description
       The Tie::SentientHash package provides intelligent
       objects.  The objects are represented as hashes which:

       *    provide read-only elements

       *    provide 'special' elements that are handled by user-
            supplied functions

       *    disallow changes to the data as specified by metadata

       *    track changes and call a 'commit changes' function
            when the object is destroyed

       References to scalars, arrays and hashes can be stored in
       hash elements in which case the referenced object is tied
       to an internal class of the appropriate type
       (Tie::SentientHash::NestedHash, ::NestedArray or
       ::NestedScalar), so that changes to the nested data
       structures can be tracked.

       The constructor is invoked with two hash references: the
       first contains metadata and the second the initial data
       values.  The metadata hash may contain the following
       flags:

       READONLY
           a list of hash entries that are read-only (read-only
           elements cannot be modified -- except by special
           element handlers -- or deleted and are not deleted
           when the CLEAR method is called)

       SPECIAL
           a hash of name/subroutine-refs pairs that specifies
           elements that are handled specially (special elements
           also cannot be deleted).  The user function is called
           both for STORE (with four arguments) and for FETCH
           (with three arguments).  The arguments are: a
           reference to the metadata hash, a reference to the
           data hash, the element key and if the funtion is being
           called for a STORE operation, the value to be stored.
           SPECIAL elements can be used to implement calculated
           attributes.

       TRACK_CHANGES
           flag to indicate that the class should keep track of
           the keys of modified (top-level) hash elements

       COMMIT_SUB
           a reference to a subroutine to commit changes (called
           with a reference to the data hash and a reference to
           the metadata hash)

       FORBID_INSERTS
           forbid inserts into hash and sub-hashes/arrays

       FORBID_DELETES
           forbid deletes from hash

       FORBID_CHANGES
           forbid any changes

       Trying to change an object in a way that is forbidden by
       the metadata will cause the module to croak.

       Changes are only tracked at the top level.

Example
       I use Tie::SentientHash as the basis for implementing
       persistent objects in my CGI/mod_perl scripts.  The
       details of reading and writing the objects from and to the
       database is handled by a class, but neither the class nor
       the high level code needs to keep track of whether the
       object has been changed in any way.

       For example if you had a pay per view system of some kind
       you could have a script that contained the following
       fragment:

          sub pay_per_view ($$) {
            my($cust_id, $cost) = @_;

            my $cust = load Customer $cust_id;
            $cust->{CREDIT} -= $cost;
          }

       The customer object would be implemented in a module
       sketched out below.  A commit function is specified on the
       call to create a new sentient object, and that function
       will be called when $cust goes out of scope at the end of
       the pay_per_view function and can write the modified
       object back to the database.  If none of the attributes
       had been modified then the commit function would not be
       invoked.

          package Customer;

          sub load ($$) {
            my ($class, $cust_id) = @_;
            my $data = {};

            # read customer data from a database into $data

            my $meta = { COMMIT_SUB     => \&_commit,
                         READONLY       => [ qw( CUST_ID ) ],
                         FORBID_INSERTS => 1 };

            return bless new Tie::SentientHash($meta, $data), $class;
          }

          sub _commit ($$) {
            my ($meta, $data) = @_;

            # As we have been called, something has changed.  The names of
            # the modified fields are the keys of $meta->{MODIFIED}.  We had
            # better write the data back out to the database.

          }

Restrictions
       Full array semantics are only supported for Perl version
       5.005.

Author
       Andrew Ford <A.Ford@ford-mason.co.uk>

See Also
       perl(1).

Copyright
       Copyright 1999 Ford & Mason Ltd. All rights reserved.

       This library is free software; you can redistribute it
       and/or modify it under the same terms as Perl itself.


-- 
Andrew Ford,  Director       Ford & Mason Ltd           +44 1531 829900 (tel)
A.Ford@ford-mason.co.uk      South Wing, Compton House  +44 1531 829901 (fax)
http://www.ford-mason.co.uk  Compton Green, Redmarley   +44 385 258278 (mobile)
http://www.refcards.com      Gloucester, GL19 3JB, UK   




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

Date: Mon, 9 Aug 1999 13:33:51 -0500
From: fisherm@tce.com (Mark Leighton Fisher)
Subject: Re: Anyone know how to use perl to parse data and generate excel reports automatically?
Message-Id: <MPG.1218e917c4b1fd0e9896c1@news-indy.indy.tce.com>

In article <7od2sb$ci2$1@news.fm.intel.com>, wing.k.tang@intel.com 
says...
>     I want to know if it is possible to write a perl script that will parse
> throught data from a file and port extracted data into MS Excel spreadsheet.

If you need just plain data (not macros, not charts, etc.) then take a 
look at CPAN (http://www.perl.com/CPAN/) for modules dealing with CSV 
files (Comma-Separated Values).  This is a much easier way to 
import/export stuff than working with a binary format. 
==========================================================
Mark Leighton Fisher          Thomson Consumer Electronics
fisherm@.tce.com              Indianapolis, IN
"Browser Torture Specialist, First Class"


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

Date: Mon, 09 Aug 1999 11:22:43 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: auto email
Message-Id: <37AF1C73.F8B5CA8C@mail.cor.epa.gov>

Predator wrote:
> 
> hi, can some1 show me or tell me where to look for a send mail program in
> NT platform.
> thanks

You'll want to read the answer to this which is already provided in the 
Perl FAQs.  If you don't have them on your hard drive, go to 
www.activestate.com and download the latest stable version of Perl.
Click on it and let it install itself.  Then you'll have all the FAQs
and the docs and lots of other helpful info, all in a nice HTML tree
for your favorite browser, on your own Start Menu. 

This will explain in detail that your options are limited, and are
dependent on what you [or your ISP, depending] have as an MTA, and
whether
you want to use the Perl modules which will make your life easier, or
else if you prefer to do it the non-portable and clunky way as it is
usually done in bad scripts lifted off icky websites.

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


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

Date: 9 Aug 1999 17:58:24 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Bacon's Corollary to Godwin's Law
Message-Id: <7on4s0$gtp$1@info2.uah.edu>

As the length of a thread in comp.lang.perl.{misc,moderated} approaches
infinity, the probability that someone will argue with a benchmark goes
to one.

Greg, not a member of Germany's National Socialist Party
-- 
If work is so terrific, how come they have to pay you to do it?
    -- George Carlin


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

Date: Mon, 09 Aug 1999 10:46:48 -0700
From: Abominable Sonoman <anita.villanueva@intel.com>
Subject: bracket syntax
Message-Id: <37AF1408.F8D405B7@intel.com>

I have been writing Perl scripts for a few weeks now, and from time to
time i've been coming across some rather strange syntax warnings/errors.

for example,  sometimes when i say something like

$something = "file";
$exp = "abc";

$word = $something.${exp}_1234;  #say this is line 56

the unix thing complains, saying "Ambiguous use of ${exp} resolved to
$exp at line 56" or something like that. But if I take the brackets out,

it thinks the variable is $exp_ so i  get a null value for it, and $word

becomes "file.1234". I am not even  using the -w switch so I don't
understand why I am getting this warning. I run the program anyway and
it runs okay, but I don't understand why I am getting this warning in
this case, because I use the brackets similarly in other situations and
it doesn't complain there. I don't get what's so "ambiguous" about my
use of brackets here. On page 44 of "Learning Perl" it says you can use
brackets
as i did above as a delimiter....

also, i got a similar error in another program, where i say something
like

$var = "abc";
$aline = "xxxxabc!xxxx";

$aline =~ /${var}!/;   #say this is like line 60

Sometimes when i try to run the above program, it complains of a syntax
error, occuring around line 100 or something. After debugging i find out

that my emacs editor doesn't like the brackets i use  above for whatever

reason. So then *the only thing i change* is this one line 60, to say
$aline =~ /{$var}!/; and that syntax error is gone, and the program can
run. The things i don't get are (1) how my original syntax was wrong,
and (2) why it complains only on certain machines. I ran it on a Solaris

just fine without even a warning, but then on a Sun OS it wouldn't even
run!

thanks to whomever replies.

Arielle
anita.villanueva@intel.com





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

Date: Mon, 09 Aug 1999 13:15:53 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: bracket syntax
Message-Id: <37AF1AD9.638CFCCB@texas.net>

Abominable Sonoman wrote:
> for example,  sometimes when i say something like
> 
> $something = "file";
> $exp = "abc";
> 
> $word = $something.${exp}_1234;  #say this is line 56
> 
> the unix thing complains, saying "Ambiguous use of ${exp} resolved to
> $exp at line 56" or something like that.

perldoc perldiag

will give additional insight.  Read the explanation carefully.

> I am not even  using the -w switch

Ah, but you should.  *Always*.  And it's better to start using Perl's
built-in pragmata sooner than later.

- Tom


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

Date: Mon, 09 Aug 1999 18:35:44 GMT
From: "Monty Scroggins" <Monty.Scroggins@mci.com>
Subject: Comm package
Message-Id: <4cFr3.1049$8X1.95416@PM01NEWS>

Does anyone know of a better way to telnet to a remote machine and
have the terminal stay up for an interactive session???  or does anyone
know about the Comm.pl package (I cant find it referenced in CPAN)??

I am using Net::Telnet in a script to telnet to remote machines.
Comm.pl is also used to allow interactive input to the terminal device
during the session.  I am having a problem with the command line
when Comm.pl is doing this.   If I backspace through the command
line (and the command on theline has variable references etc),
the cursor will jump up a line at a certain point.    Also the command
line seems to want to wrap at ~70 characters.  When the wrapping
occurs, old text is left to the right of the wrap point causing a
nasty confusing command line display.


Any information would be greatly appreciated..

Monty

--

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Monty Scroggins    MCI Telecommunications
Monty.Scroggins@mci.com
vnet: 766-1573       Voice: 972.729.1573

"If you really want something in life you
have to work for it.  Now quiet, they're
about to announce the lottery numbers."..
- Homer Simpson




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

Date: Mon, 09 Aug 1999 17:25:18 GMT
From: mmixon@primacis.com
Subject: Re: DBI ODBC memory leak??
Message-Id: <7on2te$o0m$1@nnrp1.deja.com>

In article <dwilgaREMOVE-0608991555570001@wilga.mtholyoke.edu>,
  dwilgaREMOVE@mtholyoke.edu (Dan Wilga) wrote:
> > All I'm doing is executing several thousand $dbh->prepare +
> > $dbh->execute statements to perform SQL selects.  The MSSQL
temporary
> > database on the server just grows and grows until it runs out of
disk
> > space...
> >
> > Also experimented using the $sth->finish, thinking that might help,
but
> > the problem persists.
> >
> > Any ideas? Many Thanks -- Marlin Mixon
>
> You may need to do a $dbh->commit from time to time, if
$dbh->{AutoCommit}
> is off. It should be on by default, though.
>
Thanks for the reply, Dan.  That isn't the problem as I have not changed
autocommit.  I did try sneaking a $db->commit in there anyway, but all I
get are warning messages that say "commit ineffective with Autocommit
enabled" and then the same problem of the tempdb expanding out of
control.

I suppose one workaround I could use is to break the processing up into
smaller batches, but that's a pain.  Any other workaround solutions?

Thanks.

Marlin Mixon


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 09 Aug 1999 11:18:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 1.3: Which version of Perl should I use?
Message-Id: <37AF1B61.88BB3111@mail.cor.epa.gov>

Bill Moseley wrote:
> 
> I'm working with a client running CGI scripts with:
> 
> This is perl, version 5.002
> 
> "FAQ 1.3: Which version of Perl should I use?" says in article:
> http://language.perl.com/newdocs/pod/perlfaq1.html
> 
> "All releases prior to 5.004 were subject to buffer overruns, a grave
> security issue."
> 
> I want to suggest they get rid of this version, but they might like to
> see more information about the problem than just the FAQ reference.

Check out the CERT advisories.  There are a few on 5.002/3 that should
convince your clients to $#!%can that version, except for regression 
testing.

> They are also running:
> This is perl, version 5.005 built for sun4-solaris
> 
> so I don't know why they have the old version around.  Any reason their
> scripts running under 5.002 wouldn't run fine under 5.005?

Umm, careful maintenance of software for testing of Perl modules
they're writing?

Code that depends on arcane bugs now removed from source code?

Okay, I give up.

David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: Mon, 09 Aug 1999 10:56:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Fetch document via proxy
Message-Id: <37AF1639.87569C95@mail.cor.epa.gov>

Guideline Chan wrote:
> 
> Dear all,
>     i had written a script to fetch a document directly without using
> any modules. It works fine.

That's good.  Why did you do this, unless you were just working out
how it is done for your own satisfaction?

>     Now i want to get document via proxy. So i connect to proxy and send
> a command GET absolute_url HTTP/1.0, but it is no response after a long
> time wait.
> 
> p.s. using netstat -a to check that the state of proxy server is
> ESTABLISED and the proxy works fine.
> 
> What's problem and any idea???

Yes.  The problem is that you're asking us to perform Kreskin-like
feats when my copy of the PSI::ESP module seems to be on the blink
again.  There is no way to tell from here whether the problem is your
code or your connection or your understanding of the protocol or
even some peculiarity of the particular page you're trying to access.

Please post a complete piece of code, no more than 40 lines, which 
illustrates your problem.  Then perhaps someone here can help.

David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: Mon, 09 Aug 1999 11:02:03 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How to embed Perl in Html code
Message-Id: <37AF179B.99D53C3D@mail.cor.epa.gov>

Ying Wang wrote:
> 
> Any idea or web sites guide is ok,

Perhaps you would find some useful tutorials on the web.  You can get
a number of URLs if you go to www.perl.com, click on the SEARCH feature,
and type `CGI' or `tutorial' into the box.

You will want to work through a tutorial on the Perl language before you
try to embed Perl in your webpages.  Try:

http://www.netcat.co.uk/rob/perl/win32perltut.html

And then buy the book "Learning Perl" or "Learning Perl for Win32
Systems" depending on your situation.  You will also want to study
the CGI.pm module which will make your weblife a lot easier.  There
is a book on using it for websites by its author, Lincoln Stein.  You
can also visit his website and find lots of info.

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


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

Date: 9 Aug 1999 13:45:29 GMT
From: <vlad@doom.net>
Subject: Re: kill pid scripts
Message-Id: <7omm1p$t8c$1@news.servint.com>

Dutch McElvy <dutch@mindspring.com> wrote:
> Anyone else know of a script to kill specific hung processes?

> The script below will not work either through command line or in a perl
> script. Anyone know why?

> kill -9 `ps -ef | grep foo | awk -e '{print $2}'`

It won't work in a command line?  Works for me, I often use it to kill tons of httpd
processes when /var/run/httpd.pid is not available.

[vlad@host run]# ps auxw | grep yes
vlad     18117  8.0  0.2   720   312  p1 S    13:34   0:00 yes 
vlad     18123  0.0  0.2   836   348  p2 S    13:34   0:00 grep yes 
[vlad@host vlad]# kill -9 `ps auxw |grep "[y]es" |awk '{print $2}'`
[vlad@host vlad]# ps auxw | grep yes
[vlad@host vlad]# 

-v


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

Date: 9 Aug 1999 17:14:12 GMT
From: shou@logos.engr.sgi.com (Tom Shou)
Subject: Re: lstat on a unicode file in NT?
Message-Id: <7on294$6l0$1@murrow.corp.sgi.com>


It turns out that on a WindowsNT4.0 system,  lstat returns "no such
file" because lstat can't handle the unicode name of the file since
its 2 bytes per character. Someone suggested I look at Win32 modules
for dealing with the files. Any ideas about specific Win32 modules
which can open files which have unicode names?

Thanks,

Tom

In article
<Pine.GSO.4.10.9908080821350.19222-100000@user2.teleport.com>, Tom
Phoenix <rootbeer@redcat.com> writes:
|> On 7 Aug 1999, Tom Shou wrote:
|> 
|> > I'm trying to open a unicode file on an Windows NT4.0 system,
|> but
|> > lstat (stat behaves the same way) doesn't seem to be able to
|> examine
|> > the file. 
|> 
|> Maybe you should encourage perl to tell you what went wrong. 
|> 
|> > ($dev,$ino,$mode,$nlink) = lstat($_);  # where $_ happens to be a
|> unicode file
|> > print "lstat output:$dev,$ino,$mode,$nlink \n";
|> 
|> How about something like this, between those two statements:
|> 
|>     die "Can't lstat '$_': $!" unless defined $dev;
|> 
|> I should say that I'm not completely certain that $dev should be
|> defined
|> on Windows after a successful lstat, and that I'm not certain that
|> the
|> reason for failure will be in $!, since I don't have any Windows
|> machines
|> to test this on. And of course, if you don't want your code to die,
|> that's
|> easily changed.
|> 
|> The fact that it's a unicode file shouldn't have anything to do
|> with your
|> troubles.
|> 
|> Good luck with it!
|> 
|> -- 
|> Tom Phoenix       Perl Training and Hacking       Esperanto
|> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
|> 

-- 
____________________________________________________________________
Tom Shou | shou@engr.sgi.com | SGI | 650.933.5362 | 650.932.5362 fax

http://reality.sgi.com/employees/shou_engr 



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

Date: 09 Aug 1999 13:09:48 -0400
From: Matt Curtin <cmcurtin@interhack.net>
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <xlx907k519f.fsf@gold.cis.ohio-state.edu>

>>>>> On Mon, 09 Aug 1999 04:44:21 GMT, mck@iag.net (Matt) said:

Matt> I agree. Unfortunately I have allowed the general lack of
Matt> politeness here to draw me into a war of the last word.

But you can't possibly win that one. :-)

-- 
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/


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

Date: 9 Aug 1999 17:19:38 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <7on2ja$lon$1@lublin.zrz.tu-berlin.de>

Darrell Stec <darstec@aol.com> wrote in comp.lang.perl.misc:
>In article <1dw746v.irehoo1kdrynuN@roxboro0-0021.dyn.interpath.net>,

[...]

>>-snip-
>>> it is difficult to understand that MOV means "MOVe", SUB means "SUBtract",
>>> CMP means "CoMPare", and JL means "Jump if Less than".  And that is so
>>> much more difficult to understand with abbreviations so close to their
>>> real words, than something as terse and cryptic like:  if
>>> m/^\w+(?=\s+Nasty)/
>>
>>It's a lot easier than reading and understanding what the equivalent
>>assembly would look like.
>
>The keywords in Assembly are abbreviations which resemble the words they stand
>for, much closer to the English language, than do the cryptic abbreviations and
>symbols used in Perl.

The assembler code for evaluating a regex would be about a mile and a
half long.  Your cherished assembler mnemonics wouldn't help you much
in understanding what it does.

>                       Take for instance the "g" option used in pattern
>matching, there is nothing in that character that even remotely hints that it
>is used to find every occurrance of the pattern.

The traditional way to express that a pattern should match every
occurrence in a string is "global match".  Hence the "g".  Nothing
cryptic about it when you know what it means.  Not a bit more cryptic
than JL meaning "Jump if Less".  Join Link?  Junk Low bit?  Jambolaya
Lalala?

Regular expressions are in fact a little language in themselves, spoken
in various dialects not only by Perl but by many other tools that use
them.  They are a very compact and powerful way to state facts about
strings, and it's well worth the effort to learn them.  Complaining
that they look weird makes about as much sense as complaining that
Hebrew looks weird.  Learning takes effort.  Take it or leave it.

[more snippage]

Anno


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

Date: Mon, 9 Aug 1999 10:13:08 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <MPG.1218ac0196c432d989e10@nntp.hpl.hp.com>

In article <19990809123256.22916.00003751@ngol05.aol.com> on 09 Aug 1999 
16:32:56 GMT, Darrell Stec <darstec@aol.com> says...
 ...
> While this is part of the discussion is way off topic, I needed to add that
> they "broke" the news reader with improvements last year, and what you see is
> what I get.  Every once in a while they fix the problem then break things
> again.  No controls or word wrapping options exist.  We have no choice of mail
> or news readers.

But you do have a choice of ISPs, don't you?

> The keywords in Assembly are abbreviations which resemble the words they stand
> for, much closer to the English language, than do the cryptic abbreviations and
> symbols used in Perl.  Take for instance the "g" option used in pattern
> matching, there is nothing in that character that even remotely hints that it
> is used to find every occurrance of the pattern.

The 'g' stands for 'global'.  It refers to global matching across a 
single line.

In the heritage of text editors leading to 'vi' (it started with 'ed' or 
before), the command g/re/p meant  "globally (for every line in the 
file) print every line that matches the specified regular expresion'.  
Now read that without the slashes to see the origin of the name of a 
popular text-processing command, that has also turned into a verb.

Now you know what the 'g' stands for.

 ...

> Later,
> Darrell Stec                               E-Mail: DarStec@aol.com
> 
> Webpage Sorcery
> http://webpagesorcery.com
> We Put the Magic in Your Webpages

But We Don't Know How to Choose an ISP.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 9 Aug 1999 14:07:32 -0400
From: planb@newsreaders.com (J. Moreno)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <1dw9vgw.12azwp1mklbfnN@roxboro0-0016.dyn.interpath.net>

Darrell Stec <darstec@aol.com> wrote:

> planb@newsreaders.com (J. Moreno) writes:
> 
> 
> >Darrell Stec <darstec@aol.com> wrote:
> >
> >> fl_aggie@thepentagon.com (I R A Darth Aggie) writes:
> >> 
> >> >
> >> >Darrell Stec <darstec@aol.com>, in
-snip-
> >You can't set it to 72, but there is something so that it normally wraps
> >at 74...(not in the display of course, but when sending).
> 
> While this is part of the discussion is way off topic, I needed to add
> that they "broke" the news reader with improvements last year, and what
> you see is what I get.  Every once in a while they fix the problem then
> break things again.  No controls or word wrapping options exist.  We have
> no choice of mail or news readers.

Well, I'd recommend using AOL Link and a commercial or public server
then -- that sucks (although I've gotten mail recently that was
definitely wrapped at 74).
 
-snip-
> >> it is difficult to understand that MOV means "MOVe", SUB means
> >> "SUBtract", CMP means "CoMPare", and JL means "Jump if Less than".  And
> >> that is so much more difficult to understand with abbreviations so
> >> close to their real words, than something as terse and cryptic like:
> >> if m/^\w+(?=\s+Nasty)/
> >
> >It's a lot easier than reading and understanding what the equivalent
> >assembly would look like.
> 
> The keywords in Assembly are abbreviations which resemble the words they
> stand for, much closer to the English language, than do the cryptic
> abbreviations and symbols used in Perl.  Take for instance the "g" option
> used in pattern matching, there is nothing in that character that even
> remotely hints that it is used to find every occurrance of the pattern.
> 
> While the Assembly version of that expression might be more tedious to
> write, the keywords like MOV, CMP, etc., that would be used in the code,
> would be much easier to read with less memorization than the Perl
> counterpart.

The individual statements would be easier to understand, but so what --
you could do the regular expression by hand too and it'd be just as
understandable as in assembly (which wouldn't be very).  The regular
expression is a lot more understandable than the equivalent assembly
language code would be.

> >> >  $year="20$year";
-snip-
> >> And the only ones that would have been aware of that, are the blessed
> >> holy order of the RTFMers?  So THEY had to answer and no one else?
> >
> >No, but you'd have had to have read some manual on localtime (either from
> >perl or from C or elsewhere) to see that it is wrong at first glance. The
> >problem with that is that someone who hasn't read that part of the manual
> >may choose NOT to read the manual based upon a false understanding of
> >what is supposed to happen.
> >
> >So when someone post such utter stupidity the only proper response is to
> >flame the hell out of them, in the hopes that (1) they won't do it again,
> >(2) the non-clueless newbie will read it and RTFM, and (3) as a warning
> >to other morons that they should be more careful when posting or they too
> >will go through life extra crispy.
> 
> 
> Well, John, I'm happy to have finally met someone like yourself, with the
> intelligence and genius to have never made a mistake, and to have never
> misunderstood or misinterpeted a book, manual, or any other documentation
> you have read.  It is an exceedingly rare gift that you have.

You missed the entire point then -- it's not that I haven't made my
share of bone head mistakes, it's that when I did so I deserved to be
called an idiot and when that happened (usually from myself, but not
always), I tried to take it to heart and not be such an idiot in the
future.

More importantly -- other people deserve to see me called an idiot so
that they'd know that what I did wasn't merely "incorrect" but WRONG!

That's the part you don't seem to get -- you screwup, you get reamed a
well deserved new one, you say sorry and thank you, and then you go back
and do better next time.

I still don't grok complex data structures in perl, despite have read
the manual on just that 3 or 4 times, it just isn't sinking in for some
reason -- which is fine, just so long as I neither need it nor try to
explain it to other people.

"I just said that the current president of the United States is Teddy
Roosevelt, and the press is covering up the fact that he is crippled,
but I deserve to be treated with respect and kindness".  Bullhocky.


-- 
John Moreno


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

Date: Mon, 9 Aug 1999 21:49:34 +0400
From: "wayne clerke" <clerke@emirates.net.ae>
Subject: Re: Nicer Way
Message-Id: <7on55b$57m4@news.emirates.net.ae>

Yep. This is correct (OE5). Cutting and pasting doesn't help. You need to go
all the way back to the original message source to see the correct '//' and
not 'file://'.
Wow.


--
regards,
Mail: wayne clerke <clerke@emirates.net.ae>    Voice: +971 506 43 4853
PGP key id: AEB2546D  F/P: D663D11EDA19D74F5032DC7EE001B702
PGP key id: 57AA1C10  F/P: 9926BF8918B7EB3623A7 AFA46572C5B857AA1C10
If you're not living on the edge, you're taking up too much space.

Uri Guttman <uri@sysarch.com> wrote in message
news:x7zp01c5wi.fsf@home.sysarch.com...
> >>>>> "SB" == Scott Beck <admin@gatewaysolutions.net> writes:
>
>   SB>   join "" => map {eval join "+" => split file://}
>
> abigail's code via anno's post:
>
>   join "" => map {eval join "+" => split file://}
>
>
> redmond does it again!!! they actually munged plain text thinking it is
> a broken url. those assholes!
>
> uri
>
> --
> Uri Guttman  -----------------  SYStems ARCHitecture and Software
Engineering
> uri@sysarch.com  ---------------------------  Perl, Internet, UNIX
Consulting
> Have Perl, Will Travel  -----------------------------
http://www.sysarch.com
> The Best Search Engine on the Net -------------
http://www.northernlight.com
> "F**king Windows 98", said the general in South Park before shooting Bill.




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

Date: Mon, 09 Aug 1999 11:14:40 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: NT Perl script archives
Message-Id: <37AF1A90.2443BCB9@mail.cor.epa.gov>

Yossarin wrote:
> 
> Hello,
> 
> I have recently swapped ovet to an NT host and m provider only supports .pl
> files.

That only means that they expect you to stick a .pl on the end of your
filenames of your Perl programs.  They are running some webserver which
makes associations based on file extensions, as is not uncommon in the
win32 world.

>         I have tried a simple MailForm from matts script archive but it
> requires a path to a mail program.

Please please please do NOT use programs from there.  Those programs
are not well-written, and are actually broken in some places.  If you
want to know how to mail people from a webpage, I suggest you:
[1] go to www.activestate.com and download your own copy of win32 Perl;
[2] read the HTML docs this puts on your hard drive;
[3] read the Perl FAQ and win32 ActiveState Perl FAQ in there;
[4] read the answer to the question on sending mail;
[4] read the question on 500 server errors and see the URLs for the
    web security FAQS (because letting anyone mail stuff from your
    website can open a lot of security holes if you do it wrong).

> I phoned up my host and they said simply because I was asking that question
> I was using a Unix script and not an NT script. They said I needed to get
> hold of an NT specifiic version of scripts.

They are right and wrong.  Matt Wright's script requires a path to
sendmail, which is a unix program.  NT systems don't have sendmail by
default,
although a very few do.  To fix this, you will have to either: re-write
the code to handle the mail program on your ISP's system, changing all
the sendmail-specific pieces in the program you have; or else use the
directions in the win32 Perl FAQ .

On the other hand, Perl runs the same on NT as on unix.  There are
system-specific differences.  These are covered in the win32 Perl FAQ
I have already talked about.
 
> This doesn't sound right to me, but I am new at this so if any one knows of
> any NT perl script archives I would appreciate it.

What you need to do is to stop using stuff from Matt's Script Archive.

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


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

Date: Mon, 9 Aug 1999 19:33:44 +0100
From: "JS" <jskeet@cwcom.net>
Subject: PGP FormMail - Need Help!
Message-Id: <b7Fr3.2639$Yu4.98820@news2-hme0.mcmail.com>

Hi,

Does anyone have experience of using FormMail with PGP? I'm trying to
configure it to work with PGP2.6i on a Unix server. It appears to write to
the server but then dies.Here's the code:

####################################
# PGP part

# now open PGP

$pgptmp = 'pgptmp';

$pgptmp .= getppid();

$pgptmp .= '.asc';

$ENV{PGPPATH} = '/home/sites/netsolution/users/secure118/.pgp';

$ret_val = open (PGP, "|$pgpprog -fa +VERBOSE=0 -r \"$pgpuserid\" >
$pgptmp");

if($ret_val < 1)

{

die ("Can't open $pgpprog!\n");

}

print PGP "PGP encrypted version.\x0d\x0a";

print PGP "$confirm\n";

close (PGP);



$encrypt = "";

open(PGPFILE, $pgptmp) || die "Can't open $pgptmp!";

while(<PGPFILE>) {

$encrypt .= $_;

}

close (PGPFILE);

unlink("$pgptmp");

here is the code that is the problem.......

$pgpuserid has been configured and we know is correct

$pgpprog configured to '/usr/local/bin/pgpe'

the problem is this the program is dying on line 16 where it says

open(PGPFILE, $pgptmp) || die "Can't open $pgptmp!";

I figured that this was something to do with this line

$ret_val = open (PGP, "|$pgpprog -fa +VERBOSE=0 -r \"$pgpuserid\" >
$pgptmp");

Can anyone explain this line of code???

Has anyone got any ideas? I'd be grateful for any suggestions

 - please email me at: jskeet@cwcom.net

James






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

Date: Mon, 09 Aug 1999 14:50:54 -0400
From: brian@pm.org (brian d foy)
Subject: Re: PGP FormMail - Need Help!
Message-Id: <brian-ya02408000R0908991450540001@news.panix.com>

In article <b7Fr3.2639$Yu4.98820@news2-hme0.mcmail.com>, "JS" <jskeet@cwcom.net> posted:

> Does anyone have experience of using FormMail with PGP? I'm trying to
> configure it to work with PGP2.6i on a Unix server. It appears to write to
> the server but then dies.Here's the code:

[Jeff - this code looks like a candidate for CRAP]

run away from that code.  not only is FormMail a completely piece of
shit to start with, but using PGP and temp files just makes it worse.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Mon, 09 Aug 1999 14:45:06 -0400
From: brian@pm.org (brian d foy)
Subject: Re: pricing a perl job
Message-Id: <brian-ya02408000R0908991445060001@news.panix.com>

In article <090819990037311725%max@maxgraphic.com>, Max Pinton <max@maxgraphic.com> posted:

> I just finished my largest perl project to date, and I'm wondering what
> to bill. It took me about 16 hours, but I'm a newbie and much of that
> time was debugging and head-scratching. It's a job-tracking site, and
> can:

there a few problems with asking this sort of question:

   * it has questionable legality.  see books that talk about
   consulting, price-fixing, and collusion.  

   * your price depends on what your time is worth, not on what
   you actually do with that time.  if you are really busy, your
   price is higher.

   * your price is the most that you can get the client to pay,
   as in any business.  this has long-term considerations as well.

   * all of this should have been decided BEFORE you started work.
   never work without a signed contract.  don't start because the
   contract is "in the mail".  wait for the ink.

this has nothing to do with Perl since it's the same whether you are
doing any sort of contractual work, even if it isn't programming.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Mon, 09 Aug 1999 18:42:52 GMT
From: kiran.dronamraju@metamor.com
Subject: Recurse function
Message-Id: <7on7f9$rk1$1@nnrp1.deja.com>

A perl newbie question

Env: ActivePerl v5.18 on WindowsNT v4.0

I have written a small .pl which parses a
single file and echoes output to another file.
I'm trying to use this function to process several
files in a directory.(Pass file as an argument)

I was told to install recurse function available in a .pm.
I couldn't find this in the libwww module set.
Is there some place else I should be looking OR
is there a better way to accomplish this ?
thanks in advance.

/kd


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 09 Aug 1999 11:04:47 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Return Value from "system" call
Message-Id: <37AF183F.A4EBF5FB@mail.cor.epa.gov>

rick_bindview@my-deja.com wrote:
> 
> How can I get the value that was returned from the executable I called
> using system? All I seem to get is what "wait" is returning 128 not the
> number I was looking for. Can anyone help?

Yes.  Someone already did.  I answered this last week when you asked the 
exact same thing before.  Perhaps you need to post some of your code
[less than 20 lines should be plenty], the errors you got, and the
results you wanted.  Do not expect a really polite response, since 
everyone who may answer can check that you've been posting this for
days now and still haven't read the suggested documentation yet.

David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: Mon, 09 Aug 1999 11:25:33 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: send perl-users mini-faq
Message-Id: <37AF1D1D.E5128D03@mail.cor.epa.gov>

Dennis M. Parrott wrote:
> 
> Bill Jones wrote:
> >
> > send perl-users mini-faq
> 
> ahem. Usenet IS NOT an FTP-by-email device.
> 
> Read the post titled '[Perl] How to find the Perl FAQ' which
> can be found in the comp.lang.perl.announce newsgroup on a
> very regular basis. ...and then say thank you to Tom Phoenix
> who makes sure that it gets posted there...

Dennis [and others who have wondered about this]:

I checked, and this is actually the same Bill Jones who has been
providing reasonably correct answers here under the alias Sneex.
He is currently at the mercy of some sysadmins who are mucking things 
up for him, and he is not the one posting these stupid one-line
autobot requests.  But feel free to e-mail him at bill@fccj.org so
you can make him feel even worse about these stupid posts he has not
been
able to prevent.

HAND,
David
--
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist
mathematical statistician


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

Date: 09 Aug 1999 13:12:55 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Simple write routine
Message-Id: <x7btcgdgiw.fsf@home.sysarch.com>

>>>>> "CP" == Cornel Popescu <cornelp@webdevelopmentgroup.net> writes:

  CP> In article <7on09a$m0n$1@nnrp1.deja.com>,
  CP>   Stone Cold <paulm@dirigo.com> wrote:
  >> Anyone have simple code that takes the current date and writes it out
  >> to a temp file?  Any subroutine?  Any place where I can find this
  CP> code?

  CP> $date=`date`;
  CP> open (OUT,">today_date");

where is the error checking clause?

  CP> print OUT $date;

aw, come on! if you are going to call a unix command with backticks to
get the date and then write it to a file, at least use the shell to do
that!

system( 'date > date_file' );

but of course that sux in general.

	$date_file = 'y2kcompatible' ;
	open( DATE, ">$date_file" ) || die "can't create file $date_file $!" ;
	print DATE scalar( localtime ), "\n" ;
	close( DATE ) || die "can't close file $date_file $!" ;

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Mon, 9 Aug 1999 10:25:53 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Simple write routine
Message-Id: <MPG.1218aefe3ff609f989e11@nntp.hpl.hp.com>

In article <7on0ob$mcj$1@nnrp1.deja.com> on Mon, 09 Aug 1999 16:48:15 
GMT, Cornel Popescu <cornelp@webdevelopmentgroup.net> says...
> In article <7on09a$m0n$1@nnrp1.deja.com>,
>   Stone Cold <paulm@dirigo.com> wrote:
> > Anyone have simple code that takes the current date and writes it out
> > to a temp file?  Any subroutine?  Any place where I can find this
> code?
> 
> $date=`date`;
> open (OUT,">today_date");
> print OUT $date;

Oh, please!  That spawns a nonportable command to do something that Perl 
is quite capable of doing itself.  Better.

perldoc -f localtime

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

The problem seems to be epistemological -- knowing what you know.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 09 Aug 1999 14:47:46 -0400
From: brian@pm.org (brian d foy)
Subject: Re: User Authentication
Message-Id: <brian-ya02408000R0908991447460001@news.panix.com>

In article <37AEFE22.84EE89B1@wwt.com>, Matthew Porter <matthew.porter@wwt.com> posted:

> Does anyone know how to strip the username and password sumitted from an
> authentication box? I need to do this in order to log the user into
> other on-line systems.  Any assistance would be greatly appreciated.

either compile your server to pass that info along or use some sort
of server API programming, such as mod_perl.  see http://www.modperl.com
for more info.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Mon, 09 Aug 1999 14:50:29 -0400
From: "Harlan Carvey, CISSP" <carvdawg@patriot.net>
Subject: Re: Win32: Window title from process id?
Message-Id: <37AF22F5.AA6FCB6D@patriot.net>

> I'm trying to get the Window title's of all
> processes running under NT. ie: the same output
> as TLIST.EXE. Does anyone know if this is
> possible?
>

Try this:

http://www.generation.net/~aminer/Perl/iprocess.htm

The FindWindow() method looks promising...



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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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 V9 Issue 432
*************************************


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