[8360] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1977 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 25 23:07:37 1998

Date: Wed, 25 Feb 98 20:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 25 Feb 1998     Volume: 8 Number: 1977

Today's topics:
    Re: better way to do this? (jay)
    Re: Changing From address in Mail (Martien Verbruggen)
    Re: Changing From address in Mail (Martien Verbruggen)
    Re: Home Page Click. (steve)
    Re: Home Page Click. <webmaster@fccj.cc.fl.us>
    Re: Home Page Click. (Martien Verbruggen)
        MacPerl book: disc available, new chapters online (Rich Morin)
        mirror: Out of Memory? (D.A. Harris)
    Re: No. of days?? (Nicholas Carey)
    Re: POD style comments revisited <ajohnson@gpu.srv.ualberta.ca>
    Re: proper filename extensions <rjk@coos.dartmouth.edu>
    Re: Running a perl script on Windows 95 (Martien Verbruggen)
    Re: The Ineffable Tom C. shaker@netusa1.net
    Re: The Ineffable Tom C. (Kenneth Herron)
        The young man and the beach, part II (John Callender)
    Re: use system or backticks?? (Martien Verbruggen)
    Re: Verifying a form field <rjk@coos.dartmouth.edu>
    Re: Why PERL? [Re: Beginner in trouble] (Martien Verbruggen)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 26 Feb 1998 03:03:36 GMT
From: mocat@spamtrap.best.com (jay)
Subject: Re: better way to do this?
Message-Id: <34f4da1e.133471@nntp.best.com>

Alright, with some help from you guys, and some tweaking around of my
own, here is what I got so far:

#!/usr/bin/perl
%images = (
	"jpg"  =>  "jpeg image",
	"jpeg" =>  "jpeg image",
	"gif"  =>  "gif image",
);
@html = <>;
foreach $line (@html) {
        ($imgargs) = $line =~ /<img(.*?)>/i;
        if ($imgargs !~ /\balt\s?=/i) {
                ($alt) = $imgargs =~ /\bsrc\s?=\s?"(.*?)"/i;
                $size = -s $alt;
                ($imgtype) = $alt =~ /\.(.*?)$/;
                $line =~ s/\bsrc/alt="$images{$imgtype}($size bytes)"
src/i; #damn wordwrap :)
        }
                print $line;
}                                                         

If you're adept at reading disgusting Perl code, I'm sure ya'll know
what I'm trying to do here.
It works fine, except for one thing...
When I try to match $imgtype, it works fine for normally named images
such as indexmap.gif, but it doesn't match anything for images named,
say, index.map.gif.  I don't know why this pattern match is not
working.

Just to clarify why the code is so nasty... I'm waiting until it does
exactly what I want it to do before I get rid of some variables and
use $_ and such.
I know it does it line by line, but I'll deal with that when I find
out why this particular pattern match is not working.

Thanks for any help...

-j
:mocat@best.com/www.best.com/~mocat:


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

Date: 26 Feb 1998 00:49:46 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Changing From address in Mail
Message-Id: <6d2e7a$2g5$1@comdyn.comdyn.com.au>

In article <34f493b0.457051952@enews.newsguy.com>,
	nospamtovanhalen@coredcs.com-nospammy (Steve) writes:

> I am limited to using cgi-lib.pl on my server as the sysop won't
> install cgi.pm.  Therefore I am using cgi-lib.pl.

Poor you. Is it at least perl5? If it is, you should be using one of
the Mail:: modules on CPAN. You could also just install CGI.pm in your
own directory. 

http://www.perl.com/CPAN/
perldoc perlfaq8
/How do I keep my own module/library directory?

Of course, if it isn't even perl5, you're stuck.

> I'm looking to send mail by opening a pipe to the mail command.
> However I would also like to change the "From" address of the
> resulting messages.

Again: use one of the Mail:: modules. If you don't want to, or can't,
don't use mail, use sendmail. See the manual page for sendmail on how
to do that. It's not a perl issue anymore.

Martien

PS. Be very very careful with pipes, shell escapes, system() and
exec() calls when using user supplied input. read the perlsec man
page

perldoc perlsec
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: 26 Feb 1998 02:29:52 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Changing From address in Mail
Message-Id: <6d2k30$37d$2@comdyn.comdyn.com.au>

In article <6d2fed$pj0$1@news.orst.edu>,
	stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
> In article <34f493b0.457051952@enews.newsguy.com>,
> Steve <nospamtovanhalen@coredcs.com-nospammy> wrote:
>>I'm looking to send mail by opening a pipe to the mail command.
>>However I would also like to change the "From" address of the
>>resulting messages.
>>
>>Can this be done?  
> 
> Of course it can. I do it every day. When you pipe the message to
> sendmail, just put whatever From: header you want in the message.

He's using mail, not sendmail. But, options to either have nothing to
do with perl.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Inside every anarchy lurks an old boy
Commercial Dynamics Pty. Ltd.       | network - Mitchell Kapor
NSW, Australia                      | 


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

Date: Thu, 26 Feb 1998 01:52:34 GMT
From: me@here.com (steve)
Subject: Re: Home Page Click.
Message-Id: <3508cad5.125802635@news.cent.com>

yes you can 

On 24 Feb 1998 18:37:33 GMT, petdance@maxx.mc.net (Andy Lester) wrote:

>: Does anyone know how to add an element to a page so that when the user
>: clicks on it, it becomes their home page?
>
>1) You can't.
>
>2) Your question has nothing to do with Perl.
>
>xoxo,
>Andy
>
>
>
>
>
>
>
>
>--
>--
>Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
>Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/
>



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

Date: Thu, 26 Feb 1998 02:40:36 GMT
From: Bill Jones <webmaster@fccj.cc.fl.us>
Subject: Re: Home Page Click.
Message-Id: <34F4D4FC.E669F5DB@fccj.cc.fl.us>

You mean you actually wanted a script?
Or to know if I can do it?

C'Ya,
Sneex :-)


steve wrote:

> yes you can
>
> On 24 Feb 1998 18:37:33 GMT, petdance@maxx.mc.net (Andy Lester) wrote:
>
> >: Does anyone know how to add an element to a page so that when the user
> >: clicks on it, it becomes their home page?
> >
> >1) You can't.
> >
> >2) Your question has nothing to do with Perl.

True, but possible with Perl :-) anyways...



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

Date: 26 Feb 1998 02:57:54 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Home Page Click.
Message-Id: <6d2lni$3bf$1@comdyn.comdyn.com.au>

In article <3508cad5.125802635@news.cent.com>,
	me@here.com (steve) writes:
> yes you can 

Not in perl.
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: Wed, 25 Feb 1998 18:08:49 -0800
From: rdm@cfcl.com (Rich Morin)
Subject: MacPerl book: disc available, new chapters online
Message-Id: <rdm-2502981809110001@140.174.42.30>

Precis
======

  Prime Time Freeware (http://www.ptf.com) is developing a book/CD product
  to be called "MacPerl: Power and Ease".  An early version of the disc has
  been published; most of the book's chapters are available for inspection,
  downloading and printing, etc.


The Disc
========

  The MacPerl 0.5 disc has been shipping for a few weeks now; reports are
  beginning to come in.  The response has been quite favorable; people
  seem to like the unpacked, indexed CPAN snapshot, the utilities, etc.

  We have received some problem reports as well, which we hope to handle
  in the 1.0 release.  If you have noticed any problems with the 0.5 disc,
  PLEASE send us a note.  We can't fix things we don't know about!


The Book
========

  We have written half a dozen new chapters, completed and/or revised a
  few others, and performed innumerable tweaks on the rest.  Altogether,
  nearly two dozen chapters are now available in both PDF and PostScript
  format.  Ignoring overhead chapters (e.g., Contents), here is a summary
  of the material that is currently available in the Draft Chapters area
  of the MacPerl Pages (http://www.ptf.com/MacPerl/ptf_book/draft.html):

    Chapter Title                    Revision   Notes
    =============                    ========   =====

    Foreword                         -          in progress
    Conventions                      ABCDE

    Part I - Preparation

    Introduction                     ABCDEF
    A Peek Into Programming          ABCDEF
    A Dip Into Data                  ABCDEF
    A Step Into Syntax               ABCDEF
    Installation And Overview        ABCDE

    Part II - Learning The Language

    Building Blocks                  ABC
    Stacking The Blocks              AB         completed
    Filing The Edges                 A          new
    Curious Constructions            -          in progress
    Odd Corners                      -          in progress
    What Next?                       -          in progress

    Part III - Advanced Topics

    Extensibility And Re-use         ABCDE
    The MacPerl Package              ABC
    The Toolbox Modules              ABC
    Graphics And GUIs                -          in progress
    Data Storage                     A          new
    CGI Scripting                    AB         revised
    Network Programming              AB         revised
    AppleScript, Etc.                A          new

    Part IV - Reference

    Language                         -          in progress
    Special Variables                ABC
    Functions                        A          new
    Docs And Debugging Aids          -          in progress
    MPW Perl                         ABC        revised
    Building MacPerl And Extensions  A          new

    Part V - Resources

    Books, Etc.                      ABCDEF
    Contact Information              ABCDEF
    Colophon                         A          new


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

Date: 26 Feb 1998 03:43:38 GMT
From: rodmur@ecst.csuchico.edu (D.A. Harris)
Subject: mirror: Out of Memory?
Message-Id: <6d2oda$6ol$1@hubble.csuchico.edu>


Hi,

Trying to use the good old standard mirror package (that hasn't been 
worked on since 95 or so), on perl, version 5.004_04 built for PA-RISC1.1,
HP 10.20.  And all I get are "Out of Memory" errors.  It works fine under
perl, version 5.003 with EMBED, on the same platform.  Any suggestions?

Would it be worth turning mirror into a module?  I could make it a 
project.


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dale Harris  <rodmur@csuchico.edu>   PGP KeyID: E26EC5FD      
Chico State home of the NCAA Div. II National Baseball Champs!
|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|


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

Date: Thu, 26 Feb 1998 01:53:36 GMT
From: a-bnc@microsoft.com (Nicholas Carey)
Subject: Re: No. of days??
Message-Id: <34f4c82a.595421@newsvr>

On 26 Feb 98 01:02:12 GMT, "TomH" <beans@bedford.net> wrote:

>Don't forget to deal with the sixteenth century problem, when the Pope
>decreed (in 1582) that the day after Oct 5 would be Oct 17. 

*That* little problem is dependent upon *where* you're talking about.
England, for instance, and that means the US as well, didn't convert
from the Julian (old-style) to the Gregorian (new-style) calendar
until 1752. Russia didn't convert until the Bolshevik Revolution in
1918. Not quite as simple as it seems.

For more information than you *really* need about calendars (including
source code), see

  _Calendrical Calculations_
  Nachum Dershowitz and Edward M. Reingold
  1997
  The Cambridge University Press
  The Edinburgh Building, Cambridge CB2 2RU, United Kingdom
  ISBN 0-521-56474-3
  http://www.cup.com

or see the authors' web page at

  http://emr.cs.uiuc.edu/home/reingold/calendar-book/index.shtml

Cheers!

N.


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

Date: Wed, 25 Feb 1998 21:42:32 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: POD style comments revisited
Message-Id: <34F4E4A8.50D05BF1@gpu.srv.ualberta.ca>

Chipmunk wrote:
!
[snip]

! Which is why Perl should have a true multi-line commenting syntax.
! 
! An example of its usefulness:
! 
! $guess =
!   'some complex expression' ?
!   'a tricky ' .
!   'multi-line expression' :
!   'another expression';
! 
! Now, suppose I think of another way to do the tricky multiline
! expression, but I want to leave the old version there in a
! comment, in case I decide to go back to to it.
! 
! I could do this:
! 
! $guess =
!   'some complex expression' ?
! #  'a tricky ' .
! #  'multi-line expression' :
!   'tricky expression, take two' :
!   'another expression';
! 
! 
! But I cannot do this:
! 
! $guess =
!   'some complex expression' ?
! =comment
!   'a tricky ' .
!   'multi-line expression' :
! =cut
!   'tricky expression, take two' :
!   'another expression';

personally, even if the second version worked I know I would
opt for the first version every time---for the same reason that
many people opt for:
/* some multi-line
 * comments in C
 * code
 */

instead of
/* some multi-line
comments in C
code
*/

! Instead, I'd have to do it like so:
! 
! =comment
! $guess =
!   'some complex expression' ?
!   'a tricky multi-line ' .
!   'expression' :
! =cut
! $guess =
!   'some complex expression' ?
!   'tricky expression, take two' :
!   'another expression';
!
! Which forces me to duplicate some complex expression.  How annoying.

yeah, and not only will pod directives not work mid-statement,
regular comments won't work mid-string:

$a=qq/blah blah
blah blah
# some stuff that
# I might put back in
blah blah
/;

annoying :-)

regards
andrew

now people will ask for an /x modifier on q// and qq// ;-/


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

Date: Wed, 25 Feb 1998 20:57:09 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: "Charles E. Burleson" <walrus@qis.net>
Subject: Re: proper filename extensions
Message-Id: <34F4CBF8.6D7E4243@coos.dartmouth.edu>

[posted and mailed]

Charles E. Burleson wrote:
> 
>         I would like to know the proper extensions to use for a perl
> script. In the past I have named mine "something.pl", and as far as I knew
> that was the correct extension for my programs. The other night on Efnet
> in the #perl channel I saw that was not the proper way, and that only the
> clueless use this.(I am obviously clueless)

Well, I guess I'm clueless too.  I generally end my Perl scripts with .pl, for
a couple reasons:
1. It makes it obvious to me which files are Perl scripts and which aren't.
2. It helps emacs know to load perl-mode.  (emacs will recognize perl in the
#! line, but only if it's followed by white space.  [i.e. not perl5])

There are also reasons not to:
1. It clutters up the command line.  Generally, executables don't have
extensions, at least on Unix systems.
2. It is often understood to mean Perl Library (the precursor to Perl
Modules), as in 'cgi-lib.pl'. 

>         I have been reading through the faq's and could not find anything
> to tell me what type files have what extensions. Also visited several web
> pages with tutorials which also used the .pl extension.

On many servers CGI scripts written in Perl have the .pl extension so that the
server knows what to do with it.  (Other servers allow a .cgi extension.)

> In the "Advanced Perl Programming"  book were also examples with .pl
> extensions.

I guess there are some non-clueless people who follow that convention then.  ;-)

> Would someone please tell me what the proper file extensions are, and what they
> are for so I could think of myself as less clueless?

My advice to you is to use .pl if you want to.  .pm should only be used for modules.

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/
        It's funny 'cause it's true ... and vice versa.


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

Date: 26 Feb 1998 01:26:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Running a perl script on Windows 95
Message-Id: <6d2gc8$2sm$1@comdyn.comdyn.com.au>

In article <34F4BE7E.17275026@ca.ibm.com>,
	Thieu <tcam@ca.ibm.com> writes:
> I have a Perl script that is running fine on UNIX. I now want to run it
> on Windows 95 but it is not being executed at all. I am suspecting that
> it cannot even find the Windows version Perl interpreter that I
> installed. What is the Windows equivalent of the first line used for
> UNIX (#!/usr/local/bin/perl) that tells where the Perl interpreter is?
> Any other details that I should pay attention to as well? Thanks.

There is no equivalent. The standard win95/NT/DOS shell is too
braindead to do anything like that. Execute your perl scripts like
this:

blabla> perl -w script

You can try associating .pl extensions with the perl executable, but
that is a win95 specific thingie.

Martien
-- 
Martien Verbruggen                  | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au    | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd.       | I can ask him what he meant - Steven
NSW, Australia                      | Wright


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

Date: Wed, 25 Feb 1998 20:10:36 -0600
From: shaker@netusa1.net
Subject: Re: The Ineffable Tom C.
Message-Id: <6d2ius$dlj$1@nnrp1.dejanews.com>

In article <6d25bq$1n8$1@comdyn.comdyn.com.au>,
  mgjv@comdyn.com.au (Martien Verbruggen) wrote:

> If you have to use perl for your work, but they won't even give you
> access through the firewall through a proxy, or through a SOCKSified
> ftp, then they're making your life unnecessarily hard. There simply is
> NO reason to not provide proxied access to the Internet.
>

People have been (and still are) using mostly 'c' to do the kind of
work I do. I got some folks to agree to let me try perl. It has worked
phenomenally well. However, it is not likely that too many others
will go in this direction. I am hoping that at least they will let me
continue using perl. There is a procedure to get access past the
firewall as a special case. However, this is one more admin thing
to do and will take some time.

Through this group, I did locate another person at our place
of work who uses perl. He has his own install. I use the corporate
central copy.

> You can always download it and unpack it somewhere. Normally, you
> don't need to look at the source code of perl. If you mean, the source
> code of the modules, check your @INC array,
>

I am interested in looking at the perl ('c') source code. I do realize
that this is 'inside the box' look and is, strictly speaking, not necessary
to work with perl.

Shaker



-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 26 Feb 1998 02:41:14 GMT
From: kherron@campus.mci.net (Kenneth Herron)
Subject: Re: The Ineffable Tom C.
Message-Id: <6d2koa$59e$1@news.campus.mci.net>

In article <34f471f9.9584078@news.clara.net>,
Sean Ahern <SxA@wrdcom.clara.net> wrote:
|On 25 Feb 1998 11:43:14 +0000, James Gillespie
|<jim.gillespie@ssmb.com> wrote:
|
|
|>    Hmmm, my copy doesn't have a page xxvii.  Page xv has a bit about
|>usenet groups though.  Maybe you meant the bit which says: "Like Perl
|>itself, comp.lang.perl.misc is meant to be useful, and no question is
|>too silly to ask(*)."
|>
|	I repeat, 2nd Edition.  Where the portion you mention is on
|page xx.

My _Programming Perl_, "2nd Edition--Covers Perl 5", September '96
printing, ISBN 1-56592-149-6, doesn't have a page xxvii either, and the
USENET section quoted above is on xv.  The preface ends on xxi.  I
presume there's a later printing with added material.

Somewhat germaine to this thread, I was recently RFTM'ed--rather
gently, I'll admit--after mentioning that it'd be nice to have an
each()-like capability that only returned keys.  It seems that each()
in a scalar context does this and has since 5.003 at least, but it
wasn't *documented* until 5.004 (and this hypothetical later printing
of the camel book; one of the RTFM'ers said it's in his copy), nor is
it mentioned in any changelog or new-features list that I could find.
It would seem my crimes were purchasing my camel book too soon and
failing to completely re-read the man page set following a point
upgrade.
-- 
Kenneth Herron -- kherron@campus.mci.net
"When Microsoft first took control of the Funk & Wagnalls Encyclopedia
product, there was a flattering biography of Bill Gates.  But it said he
was known as a tough competitor.  Now it says that he's known for his
charitable contributions." -- Gary Reback, <http://www.ljx.com/reback/>


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

Date: 25 Feb 1998 17:57:47 -0800
From: jbc@west.net (John Callender)
Subject: The young man and the beach, part II
Message-Id: <6d2i6r$fqp@acme.sb.west.net>

That same afternoon in the high street pub next to the apothecary shop, a 
well-to-do traveler, overhearing the comments of the young chemist, 
leaned towards an old man sitting near him. "A sad tale. I feel for the 
poor fellow, to be used so cruelly by those heartless gypsies."

The old man smiled into his empty mug, then looked up and gave a wink. 
"Aye, it's a sad tale, as far as it goes. But there's a bit more to the 
story, and I'd be happy to tell it if you could see your way to 
refreshing this pint of mine."

The traveler agreed to the bargain, and the old man hitched his stool 
closer, taking a long swallow from the newly replenished mug. "There 
*are* some thankless gypsies at the beach," he began. "But in truth they 
represent only a small fraction of all beachgoers." The man explained 
that the beach's population had grown dramatically in recent years, an 
inevitable result of the even greater growth in the population of the 
region as a whole. "Most of the newcomers are ignorant, it's true," said 
the old man. "But only a few of them are intentionally rude.

"Still," he continued, "for those of us who remember the beach as it was, 
all these newcomers constantly asking for directions grows tiresome." 
This was especially true of the young chemist, the man explained.

The chemist's claim that he had not visited the beach for some time was 
not to be taken seriously, however. The old man told the traveler that in 
recent months the chemist had made a habit of regaling the pub with 
stories of his victimization at the hands of the gypsies, each time 
claiming to have innocently offered his advice to them, not suspecting 
their true nature. It had gotten to the point where old-timers would 
nudge each other and wink when they saw the chemist heading down the path 
to the beach, something he did almost every day, as the records of the 
local lifeguards made clear.

The old man leaned closer to the traveler, glancing back over his 
shoulder to make sure no one was listening. "But riddle me this: How do 
you think a young chemist can afford to spend so much time at the beach, 
when so many others must toil from dawn to dusk?" He raised an eyebrow at 
the traveler.

"By selling his powders and potions, I presume."

The old man smiled. "Partly true. He *does* sell his potions, and it's a 
fact that the potion business has been especially good of late. But he 
has another source of income..."

The old man explained that a thriving local industry had sprung up around 
the many ignorant newcomers flooding into the region. The young chemist, 
it turns out, had taken to hiring himself out to these newcomers as a 
guide and tutor. Well-heeled foreigners, newly arrived and anxious to 
take advantage of the many opportunities the region offered, would pay 
handsomely for someone who could school them in the local customs and 
points of interest.

Now it was the traveler's turn to raise an eyebrow. "Nice work if you can 
get it."

The old man nodded. "The young chemist has a well-deserved reputation as 
an expert guide, due in part to his longtime practice of offering free 
advice on the beach."

"Wait a moment," said the traveler. "In his tale, the chemist implied 
that his trip to the beach was merely for purposes of recreation. You 
mean he actually makes money from his activities there?"

"Not directly," responded the old man. "And there are those of us who 
believe he would spend just as much time there even if there were no 
self-interest involved. But yes, he does benefit, at least indirectly."

The old man shot a keen glance at the traveler. "There is another point I 
should mention. I suppose that you, though but newly arrived in these 
parts, have heard of the Azure Pavilion?"

"Oh, yes, I overheard some talk of it only this morning," replied the 
traveler. "It is the abode of a local oracle, is it not?"

"Indeed," said the old man. "As with the boom in guide and tutoring 
services, the influx of newcomers has led to the erection of many 
pavilions where oracles dispense scrolls and tablets inscribed with local 
lore. Chief among these is the Azure Pavilion, renowned for its deep and 
subtle illumination of all manner of mysteries."

"What of it?" asked the traveler. "I fail to see how this relates to..."

"Attend," said the old man, raising a finger. "The Azure Pavilion was 
built upon the foundations of its predecessor, the much-beloved Magenta 
Pavilion, which actually predated the current boom. When the population 
began its rapid growth, those who ran the Magenta Pavilion realized that 
a new, improved version would be a very profitable venture, and they 
began looking for someone to help them construct it. The person they 
selected was..."

"The young chemist!"

"Precisely. And in return for his services in helping to construct the 
pavilion, he now receives a small but significant portion of the proceeds 
every time a seeker of truth purchases one of its scrolls."

"But that would mean..."

The old man nodded, and grinned as he saw realization dawning on the 
traveler. "...That far from being the innocent victim of the many 
newcomers to these parts, the young chemist actually stands to profit 
quite handsomely from them."

"Well, that certainly puts a different gloss on things," said the 
traveler. "Thank you for filling me in, old-timer." He stood then, 
reached into his pocket and pulled out a copper, which he flipped to the 
old man. "Here. Have another mug for your trouble. For myself, I've 
several hours of journeying left today, or I'd join you in another myself."

"Thank you kindly, sir. Thank you for a gentleman," said the old man, 
coming forward and embracing the other.

Later, the old man stood in the doorway, watching the traveler disappear 
into the distance. Hearing a step behind him, he turned and saw the young 
chemist, who gazed past him at the retreating traveler.

"You get his wallet?"

"Of course; what do you think?" said the old gypsy. "C'mon. I'll buy you 
a beer." And the two repaired to the pub, where they hoisted their mugs 
and intoned as one, "To progress."
-- 
John Callender
jbc@west.net
http://www.west.net/~jbc/


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

Date: 26 Feb 1998 02:35:11 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: use system or backticks??
Message-Id: <6d2kcv$37d$3@comdyn.comdyn.com.au>

In article <mshavel-2502982036310001@130.9.16.207>,
	mshavel@erols.com (Michael Shavel) writes:

> My question is, should I be using something like "system" to call this
> statement or are the backticks the way to go. Also could someone please

Depends. Do you need the output from the command? Then use backticks.
Do you need the return value, use system.

> explain the difference between the backticks and using "system". I looked
> in  the Blue camel book but did not get as clear an answer as I needed. 

perldoc -f system
perldoc perlop
(look for "`STRING`")

The difference is clearly discussed in those parts of the
documentation.

You are aware that there are a whole bunch of modules around for
database connectivity?

http://www.hermetica.com/technologia/DBI/

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | Curiouser and curiouser, said Alice.
NSW, Australia                      | 


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

Date: Wed, 25 Feb 1998 21:02:45 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: Cactus <cactus@mpinet.net>
Subject: Re: Verifying a form field
Message-Id: <34F4CD48.EBFC6442@coos.dartmouth.edu>

[posted and mailed]

Cactus wrote:
> 
> Hello, I'm writing a Perl script to read in a number from the
> query_string and verifly that it is only a number and no letters or
> neg-nums. Any clues as to how I can verify this?
> 
> $order = $ENV{'QUERY_STRING'};
> ($Label,$Amount) = split(/=/,$order);
> 
> #if($Amount)is a number!

What formats do you want to allow for numbers?

This regex from Randal Schwartz can match numbers in scientific notation:

/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/

To disallow negative numbers, either change the first [+-] to \+, or make sure
the value of the variable is greater than or equal to 0.

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/
        It's funny 'cause it's true ... and vice versa.


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

Date: 26 Feb 1998 02:27:08 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Why PERL? [Re: Beginner in trouble]
Message-Id: <6d2jts$37d$1@comdyn.comdyn.com.au>

In article <3506ba5c.121585458@news.cent.com>,
	me@here.com (steve) writes:
> that ain't nothing,  my wife asked me what SEX was.

Well, as long as you were able to explain it..
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The gene pool could use a little
Commercial Dynamics Pty. Ltd.       | chlorine.
NSW, Australia                      | 


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

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

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