[6856] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 481 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 15 10:17:14 1997

Date: Thu, 15 May 97 07:00:33 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 15 May 1997     Volume: 8 Number: 481

Today's topics:
     "email me when the URL changes" script? <ctbates@tva.gov>
     Re: Bug report: Perl dumps core on funny split (Mark Mills)
     Re: Bug report: Perl dumps core on funny split (Mark Mills)
     CGI.pm Question <adam@crystal.ee.ntu.edu.tw>
     Re: Decoding CyberSitter in 1 line - but how long a lin <merlyn@stonehenge.com>
     Re: Decoding CyberSitter in 1 line - but how long a lin (I R A Aggie)
     Examples of what per/cgi can do (Anyone know any) (RHawadi)
     Re: Examples of what per/cgi can do (Anyone know any) (Mike Stok)
     Re: forget the seek..wierd open command found! <eglamkowski@mathematica-mpr.com>
     Re: Graphs (A. Deckers)
     How to stop FOMAT putting space between fields? <chapman@techctr.buddcompany.com>
     Re: idea for new for loop construct (David Alan Black)
     Re: idea for new for loop construct (Mark Mills)
     Re: idea for new for loop construct (Mark Mills)
     Re: idea for new for loop construct (Mark Mills)
     Re: Is there a port for NT (A. Deckers)
     Re: List of List Question I think (assigning LOTS of va (A. Deckers)
     ls vs. readdir <djenning@aisun6.ai.uga.edu>
     Re: MacPerl interface <neeri@iis.ee.ethz.ch>
     Re: Module problems. (Andrew M. Langmead)
     Re: Newbie confused by all those slashes (Kyzer)
     Re: Perl auto-replier (Kyzer)
     Re: Perl Neophyte has a Question <rfi@uebemc.siemens.de>
     Re: Perl Neophyte has a Question (Andrew M. Langmead)
     Please help!! <jrush@world.std.com>
     Re: Please help!! (Tad McClellan)
     Regex problem - removing trailing form input (David M Holmes)
     Re: running ftp in a Perl script. (Mike Stok)
     Re: running ftp in Perl script (I R A Aggie)
     Stuck with filehandling :-( <hallgren@easynet.fr>
     Re: Tough replacement problem <cedric=tio%design%eng=sin@bangate.compaq.com>
     Re: Tough replacement problem (David Alan Black)
     VORTEXodbc (Paul Vermette [NiD/BiM])
     Re: What is "socket.ph" and where can I get it? (Mike Stok)
     Why Am I Getting Message About Not Returning a True Val (Kevin M Simonson)
     Re: Why Am I Getting Message About Not Returning a True (Mike Stok)
     Re: Why Am I Getting Message About Not Returning a True (A. Deckers)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 15 May 1997 09:39:21 -0400
From: ctbates <ctbates@tva.gov>
Subject: "email me when the URL changes" script?
Message-Id: <337B1209.4D92@tva.gov>

Hi,
Could anyone recommend a Perl script that will monitor a URL
periodically and kick off an email when a certain string appears?
Thanks,
Tom Bates


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

Date: Thu, 15 May 1997 08:40:18 GMT
From: mark@ntr.net (Mark Mills)
Subject: Re: Bug report: Perl dumps core on funny split
Message-Id: <337cca14.19467254@news.ntr.net>

On Wed, 14 May 1997 10:41:35 +0300 (EET DST), reriksso@cc.helsinki.fi
(era eriksson) wrote:

>Here's a working script:
>
> $ echo foo | perl -ne 'split /\s*,\s*/'
> foo
>
>Here's one that dumps core:
>
> $ echo foo | perl -ne 'split /\s*(,\s*)?/'
> Segmentation fault (core dumped)
>
>I have verified this bug on two reasonably different Perls; one is an
>old Sun 4 running 5.001 unofficial patchlevel 1m, the other one thus:
>
> $ uname -a
> OSF1 vesuri V4.0 564 alpha
>
> $ perl -v
>
> This is perl, version 5.003 with EMBED
>	 built under dec_osf at Sep 14 1996 20:48:45
>	 + suidperl security patch

Also does so on irix_6_2 just so ya know...

>BUGS
>
>  Admittedly, it's perhaps not exactly clear what I thought I'd
>  accomplish with that regular expression. 

yours should (shudder) match zero-width and hack your string into
widdle tiny chars (missing all spaces and commas followed by spaces
but as you know....

I'll bet you wanted something more like:
   split /[\s,]+/

It must find at least space or , but could find many of both...

if it could only have one comma so that mark, ,dave returned 
mark NULL dave in your array from the split then maybe
   split /(?:\s*,\s*)|(?:\s+)/)

like this:
   echo foo, mark bill,sean ,dave , dale,,quire 
      | perl -ne 'print join(":",split /(?:\s*,\s*)|(?:\s+)/)'

gives:
   foo:mark:bill:sean:dave:dale::quire

>  The manual page doesn't tell you where to send bug reports so I
>  figured ...


       See the perl bugs database at  http://perl.com/perl/bugs/
       .  You may mail your bug reports (be sure to include full
       configuration information as output by the myconfig
       program in the perl source tree) to perlbug@perl.com.  If
       you've succeeded in compiling perl, the perlbug script in
       the utils/ subdirectory can be used to help mail in a bug
       report.

hmmm... man perl got me this...

>  I'm posting to CLPM but not reading it regularly. Newsgroup readers,
>  please Cc: me with any followups. Thanks. 

Well, just this once...
-- 
[Hopper, Dennis]: There's mines over there, there's mines over 
there, and watch out those goddam monkeys bite, I'll tell ya.
==Apocalypse Now==


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

Date: Thu, 15 May 1997 08:06:58 GMT
From: mark@ntr.net (Mark Mills)
Subject: Re: Bug report: Perl dumps core on funny split
Message-Id: <337abe9c.16531255@news.ntr.net>

On Wed, 14 May 1997 10:41:35 +0300 (EET DST), reriksso@cc.helsinki.fi
(era eriksson) wrote:

>Here's a working script:
>
> $ echo foo | perl -ne 'split /\s*,\s*/'
> foo
>
>Here's one that dumps core:
>
> $ echo foo | perl -ne 'split /\s*(,\s*)?/'
> Segmentation fault (core dumped)
>
>I have verified this bug on two reasonably different Perls; one is an
>old Sun 4 running 5.001 unofficial patchlevel 1m, the other one thus:
>
> $ uname -a
> OSF1 vesuri V4.0 564 alpha
>
> $ perl -v
>
> This is perl, version 5.003 with EMBED
>	 built under dec_osf at Sep 14 1996 20:48:45
>	 + suidperl security patch

Also does so on irix_6_2 just so ya know...

>BUGS
>
>  Admittedly, it's perhaps not exactly clear what I thought I'd
>  accomplish with that regular expression. 

yours should (shudder) match zero-width and hack your string into
widdle tiny chars (missing all spaces and commas followed by spaces
but as you know....

I'll bet you wanted something more like:
   split /[\s,]+/

It must find at least space or , but could find many of both...

if it could only have one comma so that mark, ,dave returned 
mark NULL dave in your array from the split then maybe
   split /(?:\s*,\s*)|(?:\s+)/)

like this:
   echo foo, mark bill,sean ,dave , dale,,quire 
      | perl -ne 'print join(":",split /(?:\s*,\s*)|(?:\s+)/)'

gives:
   foo:mark:bill:sean:dave:dale::quire

>  The manual page doesn't tell you where to send bug reports so I
>  figured ...


       See the perl bugs database at  http://perl.com/perl/bugs/
       .  You may mail your bug reports (be sure to include full
       configuration information as output by the myconfig
       program in the perl source tree) to perlbug@perl.com.  If
       you've succeeded in compiling perl, the perlbug script in
       the utils/ subdirectory can be used to help mail in a bug
       report.

hmmm... man perl got me this...

>  I'm posting to CLPM but not reading it regularly. Newsgroup readers,
>  please Cc: me with any followups. Thanks. 

Well, just this once...
-- 
[Hopper, Dennis]: There's mines over there, there's mines over 
there, and watch out those goddam monkeys bite, I'll tell ya.
==Apocalypse Now==


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

Date: Thu, 15 May 1997 20:08:56 +0800
From: Adam Hsu <adam@crystal.ee.ntu.edu.tw>
Subject: CGI.pm Question
Message-Id: <337AFCD8.51D41052@crystal.ee.ntu.edu.tw>

Hi,

	I reach a trouble about executing program SUDDENLY. My programs did all
the
way fine from last Sep. . By at the beginning of this month, they start
complain to me.But, I didn't make any changes to these files for months.

	The story belows.

	PERL 5.003
	CGI.pm 2.23

	When I run my program interactively, it says

	"Undefined subroutine CGI::header at /home/lhk/cgi-lib//CGI.pm line
494"

	I checked the modules, CGI.pm, I find the error is reported from the 	
subroutine AUTOLOAD, it seems like it can not recognize any subroutines.

	Somebody pls give me a hint.


				Chie-Wei Shie


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

Date: 15 May 1997 03:36:53 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: allen@gateway.grumman.com (John L. Allen)
Subject: Re: Decoding CyberSitter in 1 line - but how long a line?
Message-Id: <8c2079t41m.fsf@gadget.cscaper.com>

>>>>> "John" == John L Allen <allen@gateway.grumman.com> writes:

John> 	perl -lne '$,=$/;$_^="\224"x y///c;print /[ -~]{5,}/g'
John> or
John> 	perl -lne '$_^="\224"x y///c;map{print}/[ -~]{5,}/g'

Ugh. "Useless use of map in void context detected in line 1"

And it wastes a few characters too, why not just:

    perl -lne '$_^="\224"x y///c;print/([ -~]{5,})/g'

I grinned at your short-but-evil way of saying "length".  Not that I'd
ever dare use that in a real program, but having yet-another-way to do
it is pretty slick.  How many people know about y as an alias for tr? :-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 474 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Thu, 15 May 1997 09:17:31 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Decoding CyberSitter in 1 line - but how long a line?
Message-Id: <fl_aggie-ya02408000R1505970917310001@news.fsu.edu>

In article <8c2079t41m.fsf@gadget.cscaper.com>, Randal Schwartz
<merlyn@stonehenge.com> wrote:

+ How many people know about y as an alias for tr? :-)

<raises hand> The camel indicates that it was placed in perl as a crutch
for sed people...

James

-- 
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: 15 May 1997 08:16:04 GMT
From: rhawadi@aol.com (RHawadi)
Subject: Examples of what per/cgi can do (Anyone know any)
Message-Id: <19970515121601.IAA04904@ladder02.news.aol.com>

hi

I am a bit new here so forgive me if I am making a request that is here
already.  I would be grateful if folk could point me in the direction of
good sites which show examples of cool things that you can do with
perl/cgi scripts.

Thanks

Rachel
Rhawadi@aol.com


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

Date: 15 May 1997 13:13:12 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Examples of what per/cgi can do (Anyone know any)
Message-Id: <5lf258$5q3@news-central.tiac.net>

In article <19970515121601.IAA04904@ladder02.news.aol.com>,
RHawadi <rhawadi@aol.com> wrote:

>I am a bit new here so forgive me if I am making a request that is here
>already.  I would be grateful if folk could point me in the direction of
>good sites which show examples of cool things that you can do with
>perl/cgi scripts.

http://www.genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html

might be a place to start.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Thu, 15 May 1997 09:00:44 -0400
From: the count <eglamkowski@mathematica-mpr.com>
Subject: Re: forget the seek..wierd open command found!
Message-Id: <337B08FC.3038@mathematica-mpr.com>

Nessim Kisserli wrote:
> Hello!
> Back again. I just got the seek to work. Turns out it will prepend a 
> file if you open it with: open(FILE,"+<file.txt")
> The < isn't documented in the perl manual...it works though ..

it may not be in the man page, but check out page 193 in 
"Programming Perl" by Wall, Christiansen & Schwartz  :)

-- 
Due to continuing problems with my hotmail account, any mail received
from eglamkowski@hotmail.com dated after 5/9/97 should be considered
fraudulent.  I am no longer using my hotmail account, and never will
again;  due to the fact that I have been unable to logon for several
days in a row, "Invalid login/password combination", I must assume my
account was hacked and the password changed.

-*-*->    Please do not send mail to, nor accept mail from    <-*-*-
-*-*->                 eglamkowski@hotmail.com                <-*-*-


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

Date: 15 May 1997 11:45:38 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: Graphs
Message-Id: <slrn5nltr2.f8e.I-hate-cyber-promo@news.rediris.es>

In comp.lang.perl.misc,
	god4golf@aol.com wrote:
>Hi All :
>
>   looking for a Perl Library to do Graphs(Bar charts) .....
>does anyone know if there is such a thing ?

Did you read the FAQ? Did you visit CPAN? If not, go there and look for
the GD module.

 <URL:http://www.perl.com/CPAN/modules/by-module/>

HTH,

Alain

-- 
Perl information: <URL:http://www.perl.com/perl/>
    Perl archive: <URL:http://www.perl.com/CPAN/>
        Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<


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

Date: Thu, 15 May 1997 09:13:22 -0400
From: Harold Todd Chapman <chapman@techctr.buddcompany.com>
Subject: How to stop FOMAT putting space between fields?
Message-Id: <ACC03D8D940E1376.7C48780809EC7642.76598DBAE941E3BE@library-proxy.airnews.net>

I have the following format:


format =
GRID@>>>>>>>>>>>        @<<<<<<<@<<<<<<<@<<<<<<<
$node,                  $x,     $y,     $z
 .


The x/y/z vars are floating point numbers. I want them right next to
each other but FORMAT seems to insist that there be a space. How can
I prevent this.

Thanks.


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

Date: 15 May 1997 11:37:54 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: idea for new for loop construct
Message-Id: <5lesii$793@pirate.shu.edu>

Hello -

Trenton Lipscomb <trenton@ssil.uoregon.edu> writes:

[...]

>However, there is a construct that seems natural to me, but is not
>recognized by the interpreter.  It is:
>	for(4 x){
>		print $_;
>		print "\n";
>    }
>and, similiarly:
>	for $it (4 x){
>	    print $it;
>	}
>where $it would be assigned the value of the current iteration of the
>loop.

But what is that value?

>Basically, I'm using the x string repetition operator to say: do this, 4
>"times". This seems very intuative and would be a good addition to

Do *what* 4 times?

I can't quite see what you are expecting it to do.  What would be the value
of the loop variable?

You can certainly do this, though I don't know whether it's what you
mean:

for ("hello\n" x 4) { print };
^D
hello
hello
hello
hello


David Black
dblack@icarus.shu.edu


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

Date: Thu, 15 May 1997 08:41:39 GMT
From: mark@ntr.net (Mark Mills)
Subject: Re: idea for new for loop construct
Message-Id: <337ecc3d.20021032@news.ntr.net>

On Wed, 14 May 1997 14:38:22 -0700, Trenton Lipscomb
<trenton@ssil.uoregon.edu> wrote:

>    for(1 .. 5){

>    for $it (1 .. $count){

>However, there is a construct that seems natural to me, but is not
>recognized by the interpreter.  It is:

>	for(4 x){

>and, similiarly:

>	for $it (4 x){

>where $it would be assigned the value of the current iteration of the
>loop.

Hmm...  
howz about:
      for($i=0; $i<4; $i++) { print $i,"\n"; }

that would have a conflict with above, since what you were doing
was really the foreach (LIST) [perl has been taking care of you]

The full version above is nice and powerful to boot. if ya really
want a short form that is simple try

while ($it++ < 4) { print $it,"\n"; }

which is pretty darn brief.  of course it doesn't initialize or
localize the $it variable so $it=2 would get you:
3
4

what you are asking for is sort of equivalent to:

for (split (//, "." x 4)) {print $it++,"\n";}

Hope that Helps  :>

(I like the while one myself)

-- 
[Hopper, Dennis]: There's mines over there, there's mines over 
there, and watch out those goddam monkeys bite, I'll tell ya.
==Apocalypse Now==


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

Date: Thu, 15 May 1997 08:59:49 GMT
From: mark@ntr.net (Mark Mills)
Subject: Re: idea for new for loop construct
Message-Id: <337ad07f.21110859@news.ntr.net>

On Wed, 14 May 1997 14:38:22 -0700, Trenton Lipscomb
<trenton@ssil.uoregon.edu> wrote:

>    for(1 .. 5){

>    for $it (1 .. $count){

>However, there is a construct that seems natural to me, but is not
>recognized by the interpreter.  It is:

>	for(4 x){

>and, similiarly:

>	for $it (4 x){

>where $it would be assigned the value of the current iteration of the
>loop.

Hmm...  
howz about:
      for($i=0; $i<4; $i++) { print $i,"\n"; }

that would have a conflict with above, since what you were doing
was really the foreach (LIST) [perl has been taking care of you]

The full version above is nice and powerful to boot. if ya really
want a short form that is simple try

while ($it++ < 4) { print $it,"\n"; }

which is pretty darn brief.  of course it doesn't initialize or
localize the $it variable so $it=2 would get you:
3
4

what you are asking for is sort of equivalent to:

for (split (//, "." x 4)) {print $it++,"\n";}

Hope that Helps  :>

(I like the while one myself)

-- 
[Hopper, Dennis]: There's mines over there, there's mines over 
there, and watch out those goddam monkeys bite, I'll tell ya.
==Apocalypse Now==


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

Date: Thu, 15 May 1997 08:30:27 GMT
From: mark@ntr.net (Mark Mills)
Subject: Re: idea for new for loop construct
Message-Id: <337bc554.18251199@news.ntr.net>

On Wed, 14 May 1997 14:38:22 -0700, Trenton Lipscomb
<trenton@ssil.uoregon.edu> wrote:

>    for(1 .. 5){

>    for $it (1 .. $count){

>However, there is a construct that seems natural to me, but is not
>recognized by the interpreter.  It is:

>	for(4 x){

>and, similiarly:

>	for $it (4 x){

>where $it would be assigned the value of the current iteration of the
>loop.

Hmm...  
howz about:
      for($i=0; $i<4; $i++) { print $i,"\n"; }

that would have a conflict with above, since what you were doing
was really the foreach (LIST) [perl has been taking care of you]

The full version above is nice and powerful to boot. if ya really
want a short form that is simple try

while ($it++ < 4) { print $it,"\n"; }

which is pretty darn brief.  of course it doesn't initialize or
localize the $it variable so $it=2 would get you:
3
4

what you are asking for is sort of equivalent to:

for (split (//, "." x 4)) {print $it++,"\n";}

Hope that Helps  :>

(I like the while one myself)

-- 
[Hopper, Dennis]: There's mines over there, there's mines over 
there, and watch out those goddam monkeys bite, I'll tell ya.
==Apocalypse Now==


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

Date: 15 May 1997 11:49:15 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: Is there a port for NT
Message-Id: <slrn5nlu1r.f8e.I-hate-cyber-promo@news.rediris.es>

In comp.lang.perl.misc,
	jspeight@mselva.demon.co.uk wrote:
>Could anyone out there tell me if there is a port of Perl to Windows NT?
>If so who sells it is there one from Gnu?

You didn't read the FAQ. Go to CPAN:

  <URL:http://www.perl.com/CPAN/ports/win32/>

HTH,

Alain

-- 
Perl information: <URL:http://www.perl.com/perl/>
    Perl archive: <URL:http://www.perl.com/CPAN/>
        Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<


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

Date: 15 May 1997 12:01:17 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: List of List Question I think (assigning LOTS of variables.)
Message-Id: <slrn5nluod.f8e.I-hate-cyber-promo@news.rediris.es>

In comp.lang.perl.misc,
	hunter@fsc.fujitsu.com wrote:
[...]
>I have conducted a survey (web page survey). Now, it's time to process
>the data. I have collected it all, split it up, everything is dandy I
>can print out things the way I want.
>
>NOW, I need to make some variables for each question return value so I
>can process percentages and statistics, etc.
>
>How can I assign these variables without typing them all out?
[...]
>What is the best way to get the variables assigned without typing them
>all out? Can you perhaps show me how you'd do it?

There are really two issues here: (1) reading in the data, and (2)
storing it in a suitable data-structure for further manipulation.

As far as (1) is concerned, I presume you have your survey results
stored in a file or database of some sort, but without knowing what the
format of your data is (comma delimited, tab delimited, key:value
format, DB, etc.) its not possible to get any further. Perhaps if you
post a _brief_ example we can take a look at it and provide some
assistance.

With regard to (2), you should look up the perllol and perldsc manual
pages, which explain how to create and manipulate List of Lists and
similar data-structures.

If you don't have the manual pages installed on your system, you can find
them on any CPAN site in a variety of formats. Here's the URL for the
HTML version:

  <URL:http://www.perl.com/CPAN/doc/manual/html/perldsc.html>
  <URL:http://www.perl.com/CPAN/doc/manual/html/perllol.html>

Further info is also availabkle in the Camel book, chapter 4. Of course,
you should also read the FAQ if you haven't already done so.

HTH,

Alain

-- 
Perl information: <URL:http://www.perl.com/perl/>
    Perl archive: <URL:http://www.perl.com/CPAN/>
        Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<


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

Date: Thu, 15 May 1997 09:59:35 -0400
From: "David Jennings [MSAI]" <djenning@aisun6.ai.uga.edu>
Subject: ls vs. readdir
Message-Id: <Pine.SUN.3.91.970515095220.22311B-100000@aisun6.ai.uga.edu>

I recently wrote a small script for cleaning up some directories, and I 
used the backticked UNIX command ls to get filenames.  I am curious: is 
using the backticked command more or less computationally expensive than 
using the built-in Perl commands opendir and readdir?

It seems like you can make Perl as much like or unlike conventional shell 
programming as you please.  Neat, I guess.

**********************
    David Jennings
 Dept. of Philosophy/
      AI Center
University of Georgia
**********************


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

Date: 15 May 1997 14:32:48 +0200
From: Matthias Neeracher <neeri@iis.ee.ethz.ch>
Subject: Re: MacPerl interface
Message-Id: <86yb9gyky7.fsf@iis.ee.ethz.ch>

frostbyt@shell01.ozemail.com.au (Stephen Frost) writes:
> I had the good fortune (?) to be doing some web design and programming
> for someone last Tuesday ... on a PowerMac.  I was intrigued by the
> interface to MacPerl, but didn't have much opportunity to play with
> it.  Seems there is a "system window" which traps the output of all
> your scripts, and a "system toolbar" at the top of the screen which
> seems to "know" about your scripts, giving you the option to compile
> and view warnings, run, etc etc.
> 
> I'm curious ... would a Mac-o-phile like to post and explain the
> benefits of such an interface.

I wrote MacPerl, so I'll try to say a few words (There is also an article in
The Perl Journal, issue #2 or #3):

On one hand, on a Mac, there is a *necessity* to do such a GUI: There is a
command line based development system (MPW), but a majority of MacPerl users
don't have it.

Second, in a GUI environment, a GUI Perl has some *advantages*:

 - You can save text filters as programs activated by dragging&dropping files
   on them.
 - MacPerl collaborates with Web broswers and a Pod viewer to deliver instant
   online help. If, e.g., you want to look up the arguments to "gethostbyname",
   you option-click that word and the perlfun pod will pop up in the right
   place. If you want to learn about object oriented programming, you select
   the right entry from the help menu and the perlbot pod will pop up.

> Does the Mac not have a "command line"?

Not for mortals.

> Could this sort of interface be grafted onto the Win-32 port of Perl?

No inherent reason against it. The code itself is not portable, but the ideas
certainly are.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
   "What is the search for the next great compelling application but a
    search for the human identity?"        -- Douglas Coupland, _Microserfs_


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

Date: Thu, 15 May 1997 12:55:58 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Module problems.
Message-Id: <EA83xA.4Mu@world.std.com>

GuideQueue Master <quemast@bvsd.k12.co.us> writes:

>I have two versions of Ping.pm installed.  One that only supports
>pingecho() and doesn't work on half my machines, and one that is an all
>out ping module.  Problem is, I can't find anywhere how to access the new
>module vs. the old.  THe old is:

You can set the perl search path before the script starts by setting
the PERLLIB or PERL5LIB environment varialbles.

You can add a library to the begining of the search path within a
script by saying:

     use lib directory;

replacing "directory" with the name of the directory you want to add
to the search path.

Otherwise you can change things by mucking with the @INC array
directly. (but there are some tricky aspects about the "use" directive
and the @INC array. If 'use lib' doesn't do what you want, its
documentation will probably clue you into whatever else you need to
know.)

If you want to remove a directory within a script, you can either say:

  no lib directory;

(again replacing "directory" with the name of the directory you want
removed from the search path.)

or by mucking with @INC.
-- 
Andrew Langmead


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

Date: 15 May 1997 13:44:59 GMT
From: junkmail@sysc.abdn.ac.uk (Kyzer)
Subject: Re: Newbie confused by all those slashes
Message-Id: <5lf40r$g4d@info.abdn.ac.uk>

Hurrah, for 'tis said that Eli the Bearded did write:
: still not a clpm top 10 poster by number of posts -- must post more

If you look at today's statistics, you only need to post 1 more article to
get on 10th place. Go on go on :)

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!

-- 
Random sig of the day:
My other sig is a Ford Fiesta


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

Date: 15 May 1997 13:37:14 GMT
From: junkmail@sysc.abdn.ac.uk (Kyzer)
Subject: Re: Perl auto-replier
Message-Id: <5lf3ia$g4d@info.abdn.ac.uk>

Hurrah, for 'tis said that rga did write:
: Q:  How many internet mail list subscribers does it take
:       to change a light bulb?

: A:  1,331 + a few more
[snip] .....
:         143 votes for alt.lite.bulb.
      2 to post to the mailing list that their newsadmin won't newgroup it
    406 to post to the mailing list that alt.lite.bulb hasn't propagated
        to them yet
  83486 to confirm that they haven't got alt.lite.bulb yet either
     50 to panic and create WWWBoard cgis for discussion of alt.lite.bulb
        (damn you Matt Wright ;)
     54 people to post 'this is a test' to alt.lite.bulb
      8 people to flame alt.config because all they get is test messages in
        alt.lite.bulb
      5 newsadmin to rmgroup alt.lite.bulb

 ....etc :)
[What has this to with perl? Well, I mentioned WWWBoard, didn't I? :)]

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!

-- 
Random sig of the day:
My other sig is a Ford Fiesta


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

Date: 15 May 1997 11:43:11 +0200
From: Ronald Fischer <rfi@uebemc.siemens.de>
To: rudy@mitec.net
Subject: Re: Perl Neophyte has a Question
Message-Id: <xz2k9l1vzo0.fsf@uebemc.siemens.de>

>>>>> On Wed, 14 May 1997 14:59:42 -0500
>>>>> "Rudy" == Rudy Richter <rudy@mitec.net> wrote:
Rudy> I'm using a basic sort sequence to sort by fields of my data, however,
Rudy> when it returns I find that Perl thinks BLANK fields come before data
Rudy> filled fields.  Right or wrong this doesn't work for me.  I need to put
Rudy> the BLANK fields behind the FILLED fields.  
Rudy> 
Rudy> @sortedkeys = sort by_names keys(%thefile);
Rudy> sub by_names {
Rudy> 	if ($thefile{$a} eq "") {
Rudy> 		1;
Rudy> 	} else {
Rudy> 		$thefile{$a} cmp $thefile{$b};
Rudy> 	}
Rudy> }
Rudy> 
Rudy> ...and although this works better, it still doesn't work correctly. 
Rudy> Anyone know how I can fix it?  Thanks!
Why don't you extend your idea and handle explicitly the case where
length($thefile{$b}) is zero? This should work.
-- 
Ronald Otto Valentin Fischer (PGP public key available on request)
business:	ronald.fischer@uebemc.siemens.de
private:	ronald.fischer@acm.org
http://ourworld.compuserve.com/homepages/ronald_fischer/


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

Date: Thu, 15 May 1997 12:41:29 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Perl Neophyte has a Question
Message-Id: <EA8396.K2t@world.std.com>

Rudy Richter <rudy@mitec.net> writes:

>I'm using a basic sort sequence to sort by fields of my data, however,
>when it returns I find that Perl thinks BLANK fields come before data
>filled fields.  
[stuff deleted]

>...this put the BLANKS first.  Then I tried this...

>@sortedkeys = sort by_names keys(%thefile);
>sub by_names {
>	if ($thefile{$a} eq "") {
>		1;
>	} else {
>		$thefile{$a} cmp $thefile{$b};
>	}
>}

To do it this way, you also need to specify what happens if
$thefile{$b} is blank or if they are both blank.

sub by_names {
  # both blank, they are equal.
  return 0 unless $thefile{$a} && $thefile{$b};
  # $a blank but not $b, $a is sorted after $b
  return 1 unless $thefile{$a};
  # $b blank but not $a, $a is sorted before $b
  return -1 unless $thefile{$b};
  # otherwise sort alphabetically.
  $thefile{$a} cmp $thefile{$b};
}
-- 
Andrew Langmead


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

Date: Mon, 12 May 1997 18:55:40 GMT
From: James B Rush <jrush@world.std.com>
Subject: Please help!!
Message-Id: <Pine.SGI.3.95.970512145115.13751A-100000@world.std.com>

I have a question:  
I have a file called results and it is the result of a grep on 
a directory.   I want to get the file names from the results file to
make links to them.  I have no problem grepping, and I can read the
results file, but I can't seem to strip the file names from the results
file.

#read 'results' file 
open RESULTS,"path/cgi-bin/results" || die "no such file";

while ($line= <RESULTS> )
{
  #a little stub testing
 printf "in while, general \n" if $line =~ m/\/*\.html:/; #this works 
 printf "in while, more specific\n" if $line =~ m/\/articles\/*.html/;
#this doesn't, don't know why

 # if I write:
 @dummy = $line;
 printf  "dummy = @dummy\n";

 #I get output like:
 #dummy = /articles/P-BeforeAfterpr.html:<TD WIDTH="199">
<FONT FACE="Times New Roman">Gates of Microsoft</FONT>&nbsp;

 #dummy = /articles/P-BeforeAfterpr.html:<TD WIDTH="199">
<FONT FACE="Times New Roman">Allen of Microsoft </FONT>&nbsp;

 #if I write
 @dummy= grep /*.html/, $line;
 printf  "dummy= @dummy\n";

 #I get output like:
 #dummy = 

 #dummy =

}#close while

close(RESULTS);

Unfortunately I need to get the *.html to make a link.  Does anyone have a
idea what I am doing wrong.  Besides getting out of bed  :-)

#######################################################################
Jay Rush
Intranet Web Master - Polaroid New Technologies
jrush@world.std.com
#######################################################################



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

Date: Thu, 15 May 1997 06:09:25 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Please help!!
Message-Id: <5tqel5.mj.ln@localhost>

James B Rush (jrush@world.std.com) wrote:
: I have a question:  
: I have a file called results and it is the result of a grep on 
: a directory.   I want to get the file names from the results file to
: make links to them.  I have no problem grepping, and I can read the
: results file, but I can't seem to strip the file names from the results
: file.


($filename, $matched_line) = split /:/, $line, 2;


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


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

Date: Tue, 13 May 1997 14:41:27 GMT
From: david.holmes@bigfoot.com (David M Holmes)
Subject: Regex problem - removing trailing form input
Message-Id: <EA4JLC.C9y@ciba-geigy.ch>

Hi,

I'm having a problem deleting trailing form input from a URL.  Here is 
the code.

#!/usr/local/bin/perl -w

use strict;
use diagnostics;

my $testurl = "http://www.here.com/path/to/file/me.html?a=b&c=d";

print "$testurl\n";

# remove trailing form input

$testurl =~ m/.*?(\?.*)/;
$testurl =~ s/$1//;

print "$testurl\n\n";

The error message I get is:

Uncaught exception from user code:
        /?a=b&c=d/: ?+* follows nothing in regexp at testurl.pl line 13.

I haven't been able to find this error message in Programming Perl (2e).

Thanks.

Dave

--
David M Holmes           |             Novartis, Inc.
david.holmes@bigfoot.com | Views expressed are my own
-------------------------+---------------------------
Dave's Origami - http://www.geocities.com/Tokyo/2162/


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

Date: 15 May 1997 13:06:13 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: running ftp in a Perl script.
Message-Id: <5lf1o5$5aa@news-central.tiac.net>

In article <01bc6155$19c9c7e0$a27813ac@FlorenceKuan.asia.compaq.com>,
Florence Kuan <Florence=Kuan%Design%Eng=Sin@netgate.compaq.com> wrote:
>I need to ftp a file from another server while running a Perl program. Does
>anyone know how I can pass arguments to the ftp program while running a
>Perl program? Is it possible for the Perl program to supply the user
>account name, password, and ftp commands to the ftp program so that the
>user does not have to enter anything.

If you're using perl5.xxx then you might consider using the libnet package
of CPAN which includes Net::FTP

NAME
  Net::FTP - FTP Client class

SYNOPSIS

      use Net::FTP;

      $ftp = Net::FTP->new("some.host.name");
      $ftp->login("anonymous","me@here.there");
      $ftp->cwd("/pub");
      $ftp->get("that.file");
      $ftp->quit;
                           
One way to get to CPAN is to use a web browser to access Tom
CHristiansen's multiplexor at http://www.perl.com/CPAN/ and look in the
modules tree.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Thu, 15 May 1997 09:19:28 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: running ftp in Perl script
Message-Id: <fl_aggie-ya02408000R1505970919280001@news.fsu.edu>

In article <01bc60e4$bf78b460$5378238a@pc1.asia.compaq.com>, "cedric tio"
<cedric=tio%design%eng=sin@bangate.compaq.com> wrote:

+ I need to ftp a file from another server while running a Perl program. Does
+ anyone know how I can pass arguments to the ftp program while running a
+ Perl program? Is it possible for the Perl program to supply the user
+ account name, password, and ftp commands to the ftp program so that the
+ user does not have to enter anything.
+ I am working on a Unix X-terminal.

To quote an earlier article:

In article <5lf1o5$5aa@news-central.tiac.net>, mike@stok.co.uk wrote:

+ If you're using perl5.xxx then you might consider using the libnet package
+ of CPAN which includes Net::FTP
+ 
+ NAME
+   Net::FTP - FTP Client class
+ 
+ SYNOPSIS
+ 
+       use Net::FTP;
+ 
+       $ftp = Net::FTP->new("some.host.name");
+       $ftp->login("anonymous","me@here.there");
+       $ftp->cwd("/pub");
+       $ftp->get("that.file");
+       $ftp->quit;
+                            
+ One way to get to CPAN is to use a web browser to access Tom
+ CHristiansen's multiplexor at http://www.perl.com/CPAN/ and look in the
+ modules tree.

James

-- 
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: Thu, 15 May 1997 12:24:42 +0000
From: Michael Hallgren <hallgren@easynet.fr>
Subject: Stuck with filehandling :-(
Message-Id: <337B0085.339B@easynet.fr>

Hello,

I'm using the following subroutine:


sub remove_expired_users_from_htpasswd {
        open TMP, "$target_dir/.tmp" or die "Cannot open .tmp : $!";
        open PSWD, "$target_dir/.htpasswd" or die "Cannot open .htpasswd
: $!";
        open OUT, ">$target_dir/.out" or die "Cannot open .out : $!";
        flock OUT, 2;
        my %remove;
        my $login;
        while (<TMP>) {
        $login = $_;
        chomp $login;
        $remove{$login} = 1;
        }
        while (<PSWD>) {
        my ($login,$pswd) = split /:/;
        print OUT join(":",$login,$pswd) unless $remove{$login};
        }
        flock OUT, 8;
        close OUT;
        close PSWD;
        close TMP;
        unlink ("$target_dir/.htpasswd");
        rename ("$target_dir/.out","$target_dir/.htpasswd") or die
"Cannot refresh .htpasswd : $!";
}


The idea is to use the file .tmp (containing single-word lines ---
logins) to remove the corresponding (that is containing the logins from
 .tmp) .htpasswd lines. I plan doing so passing by a temporary file:
 .out, and then renaming that on .htpasswd. However, running the above
subroutine doesn't touch .htpassdw :-(.
Brief, I'm stuck --- so any advice's appreciated.


	Cheers

		Michael


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

Date: Thu, 15 May 1997 07:39:25 GMT
From: "cedric tio" <cedric=tio%design%eng=sin@bangate.compaq.com>
Subject: Re: Tough replacement problem
Message-Id: <01bc6103$1d252120$5378238a@pc1.asia.compaq.com>

If your text file has only one occurance of <greek>...<greek> per line, you
can try the following:

Assuming you are already in the loop that reads the input file line by line
into $_ and you want to replace v or x by k :

	$str=$_;
	m/<greek>.*<greek>/;
	$dummy = $&;
	$dummy =~ s/[v]|[x]/k/g;
	$str =~ s/<greek>.*<greek>/$dummy/eg;

	Now the string you want is in $str;


Hampton Keathley <hamptonk@bible.org> wrote in article
<01bc60ed$d4adb200$391a56a0@hercules.ods.com>...
> 
> I use perl almost daily and do lots of regular expression stuff, but
don't
> have any idea how to do the following:
> 
> I have a file with lines that look like this:
> 
> text text text text <greek>agapv wuix</greek>

	
> I need to search through a rather large file and search and replace
various
> characters between the <greek> codes.
> 
> How do I grab only the text between the tags and then do a search and
> replace on only the "v" or the "x" that is within the <greek> tags and
not
> mess up the v or x outside the tags?
> 
> 
> Thanks
> 
> Hampton Keathley
> webmaster
> www.bible.org
> hamptonk@bible.org
> 
> 


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

Date: 15 May 1997 10:41:46 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: Tough replacement problem
Message-Id: <5lep9a$5jf@pirate.shu.edu>

Hello -

"Hampton Keathley" <hamptonk@bible.org> writes:

>I use perl almost daily and do lots of regular expression stuff, but don't
>have any idea how to do the following:

>I have a file with lines that look like this:

>text text text text <greek>agapv wuix</greek>

>I need to search through a rather large file and search and replace various
>characters between the <greek> codes.

>How do I grab only the text between the tags and then do a search and
>replace on only the "v" or the "x" that is within the <greek> tags and not
>mess up the v or x outside the tags?

Here's one possibility.  For the sake of testing, I'm changing
v to V and x to X.

#!/usr/local/bin/perl -w

@greeks = map { tr/vx/VX/ if /<greek>/; $_ }
            split m!(<greek>.*?</greek>)!s,
              join '', <DATA>;

print @greeks;

__DATA__
The Greeks believed in lots of gods whose
names <greek>had no x or v in them</greek>.
The Romans had <greek>Minerva</greek>, which
doesn't belong in a greek tag.  Oh well. <greek>here's a v
and an x on separate lines, just for good measure</greek>.


Of course you could refine the .*? subpattern, depending on how you
feel about page 226 of _Mastering Regular Expressions_.  :-)


David Black
dblack@icarus.shu.edu


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

Date: 15 May 1997 12:21:49 GMT
From: e5ir@jupiter.sun.csd.unb.ca (Paul Vermette [NiD/BiM])
Subject: VORTEXodbc
Message-Id: <5lev4t$o6b@sol.sun.csd.unb.ca>

I was just curious on what VORTEXodbc is.  I checked out the web site
(Trifox's) but could not get alot of information from it about the
VORTEXodbc.  Will this work with ANY odbc driver? for any database?



--
                   '''
                  (o o)
  .---------oOOO---(_)------------------.
  |       Paul Vermette [NiD/BiM]       |
  |             e5ir@unb.ca             |
  |    B O D i E S  i N  M o T i O N    |
  `----------------------oOOO-----------'
                 |__|__|
                  || ||
                 ooO Ooo



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

Date: 15 May 1997 12:56:11 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: What is "socket.ph" and where can I get it?
Message-Id: <5lf15b$4fe@news-central.tiac.net>

In article <337A4E18.4830@gdesystems.com>,
Michael Levasseur  <levass@gdesystems.com> wrote:
>I'm trying to do some FTP inside of a Perl script. When
>I try running the script "ftp.pl" in perl 5, I get an
>error that it can't find "socket.ph". I've gone to CPAN
>and read the notes on IPC. Is "socket.ph" part of Perl
>or is it part of my OS? If it's part of perl, does anyone
>know of where I can get it?

The way to generate .ph files is to use the h2ph (it should be in the
utils directory) to mangle your C header files into perl header files.

If you're using perl5 you might first try replacing the line requiring
socket.ph with a line like

  use Socket;

which will pull in the perl 5 module Socket.pm which may well define the
"constants" ftp.pl needs

There is a perl 5 module set, libnet, which contains Net::FTP which might
be of interest to you.

NAME
  Net::FTP - FTP Client class

SYNOPSIS

      use Net::FTP;

      $ftp = Net::FTP->new("some.host.name");
      $ftp->login("anonymous","me@here.there");
      $ftp->cwd("/pub");
      $ftp->get("that.file");
      $ftp->quit;
                         
You can get to CPAN at ftp://ftp.funet.fi under /pub/languages/perl/CPAN
or use a web browser and go to http://www.perl.com/CPAN/

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 15 May 1997 13:00:20 GMT
From: simonson@skopen.dseg.ti.com (Kevin M Simonson)
Subject: Why Am I Getting Message About Not Returning a True Value?
Message-Id: <5lf1d4$3a3@sf18.dseg.ti.com>
Keywords: require true value

     I'm putting into use two "perl" scripts that make use of a common trio
of subroutines, so the obvious choice to me seemed to be to put those sub-
routines in their own file and use the "require" function to include the
functionality of the three in each of the two scripts that will need to
make use of them.

     So I took a look at what _Programming perl_ (by Wall and Schwartz,
published by O'Reilly & Associates) had to say about "require".  Experi-
menting with what it said, I created two "perl" scripts, as shown below.

,---SubSubArg--------------------------------------.
|#!/usr/local/bin/perl                             |
|                                                  |
|sub Inner                                         |
|{                                                 |
|   $Jqz = $_[0];                                  |
|   print "Inner called with argument /$_[0]/.\n"; |
|}                                                 |
`--------------------------------------------------'

,---SubArg----------------------------------------.
|#!/usr/local/bin/perl                            |
|                                                 |
|require "/tmp_mnt/user/simonson/Perl/SubSubArg"; |
|                                                 |
|&Inner ("abc");                                  |
`-------------------------------------------------'

     It looks to me like executing "SubArg" should result in printing
"Inner called with argument /abc/."  But instead I get the following.

,-------------------------------------------------------------------------.
|re^simonson/Perl} pwd                                                    |
|/tmp_mnt/user/simonson/Perl                                              |
|re^simonson/Perl} ls -l SubArg SubSubArg                                 |
|-rwxrw-r--  1 simonson       89 May 15 07:50 SubArg*                     |
|-rwxrw-r--  1 simonson      104 May 15 07:34 SubSubArg*                  |
|re^simonson/Perl} SubArg                                                 |
|/tmp_mnt/user/simonson/Perl/SubSubArg did not return a true value at SubArg line 3.
|re^simonson/Perl}                                                        |
`-------------------------------------------------------------------------'

     Anybody have any idea why this is happening?

                                     ---Kevin Simonson


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

Date: 15 May 1997 13:24:37 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Why Am I Getting Message About Not Returning a True Value?
Message-Id: <5lf2ql$6fa@news-central.tiac.net>
Keywords: require true value

In article <5lf1d4$3a3@sf18.dseg.ti.com>,
Kevin M Simonson <simonson@skopen.dseg.ti.com> wrote:
>     I'm putting into use two "perl" scripts that make use of a common trio
>of subroutines, so the obvious choice to me seemed to be to put those sub-
>routines in their own file and use the "require" function to include the
>functionality of the three in each of the two scripts that will need to
>make use of them.

>,---SubSubArg--------------------------------------.
>|#!/usr/local/bin/perl                             |
>|                                                  |
>|sub Inner                                         |
>|{                                                 |
>|   $Jqz = $_[0];                                  |
>|   print "Inner called with argument /$_[0]/.\n"; |
>|}                                                 |
>`--------------------------------------------------'

A library needs to end with a logically true statement, typically this is
forced by having

1;

as the last line in the required file.  Check out the section on require
in the book Programming Perl.

Hope this helps,

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 15 May 1997 13:26:13 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: Why Am I Getting Message About Not Returning a True Value?
Message-Id: <slrn5nm3nl.f8e.I-hate-cyber-promo@news.rediris.es>

In comp.lang.perl.misc,
	simonson@skopen.dseg.ti.com wrote:
[stuff about why subroutine in require'd file doesn't work]

As the error message says, require'd files must _always_ return a true
value. The traditional way of achiving this is to put "1;" on the last
line of the file, as explained in the man perlfunc manual page, and I'm
sure it's in the FAQ too.

HTH,

Alain

-- 
Perl information: <URL:http://www.perl.com/perl/>
    Perl archive: <URL:http://www.perl.com/CPAN/>
        Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<


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

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

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