[7906] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1531 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 24 01:07:36 1997

Date: Tue, 23 Dec 97 22:00:20 -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           Tue, 23 Dec 1997     Volume: 8 Number: 1531

Today's topics:
     Re: $* warning even though I didn't use it (Gabor)
     Access Denied Problem running script on NT4 <myleslawrence@email.msn.com>
     Re: Advanced Perl Programming book (Richard G. Roberto)
     Re: Bidirectional IPC with long strings (Tom "Tom" Harrington)
     Built Tk with multi-threaded Perl5.004_55? <satishg@qualcomm.com>
     Re: Changing the file name dynamically when the user sa <rootbeer@teleport.com>
     Re: Correct syntax for length function? <reibert@mystech.com>
     Re: Don't want to offend <tlowery@MCIONE.com>
     Re: getting directory size <shadowweb@worsdall.demon.co.uk>
     Re: help newbie at wit's end (almost) ushere@ibm.net
     Re: help newbie at wit's end (almost) ushere@ibm.net
     Re: help newbie at wit's end (almost) ushere@ibm.net
     Re: How to check files exists and if it does then? <shadowweb@worsdall.demon.co.uk>
     Is there a perl function eq to cut in bash? <feng@haas.berkeley.edu>
     Re: Is there a perl function eq to cut in bash? <ebohlman@netcom.com>
     Opening a telnet process as a filehandle? (Mike McCarthy)
     Re: Perl editor needed (Woody Jin)
     Re: perl4 -> perl5 operation thospel@mail.dma.be
     Re: Review of CGI/Perl book (Craig Patchett)
     server misconfig <sflower@cyberportal.net>
     Teen Perl Programmers Mailing List <jefpin@bergen.org>
     Re: Teen Perl Programmers Mailing List (brian d foy)
     Re: What kind of machine wouldn't support FLOCK? (Ton Hospel)
     Works from Telnet, not SSI #Exec... <joel@microworld.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 24 Dec 1997 02:32:16 GMT
From: gabor@vinyl.quickweb.com (Gabor)
Subject: Re: $* warning even though I didn't use it
Message-Id: <slrn6a0sml.6a0.gabor@vinyl.quickweb.com>

In comp.lang.perl.misc, M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
# Tom Phoenix  <rootbeer@teleport.com> wrote:
# >
# >Somehow, perl thinks it is being used, or at least referenced. Since
# >you're interpolating, I'd look closely at any dollar signs within the
# >here-document to see whether one of them might be in front of an asterisk.
# >Hope this helps! 
# 
# And to expand on Tom's comment, it may be less than self-evident to you
# that
# 
# print <<"PROG_USAGE";
# $
# 
# 
# 
#      *
# PROG_USAGE
# 
# will generate the above message.
# 
# If you don't need any variable substitution in your here stream, it's
# safer to use single quotes   'PROG_USAGE'.
# 

Thanks.  I did have the following 
 ... $ * ...
in the here document.  And I realized when Tom mailed me that the
dollar sign wasn't even being printed out! :-(  It was only a help
message if there was no argument to the script on the command line,
but missing the dollar sign in the help was not good.  The single
quote works, I just added a backslash in front of the dollar sign,
that worked fine too.

gabor.
--
    Does the same as the system call of that name.
    If you don't know what it does, don't worry about it.
        -- Larry Wall in the perl man page regarding chroot(2)


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

Date: Tue, 23 Dec 1997 20:13:49 -0800
From: "Myles Lawrence" <myleslawrence@email.msn.com>
Subject: Access Denied Problem running script on NT4
Message-Id: <#TE5MGCE9GA.216@upnetnews03>

I've got one for you. I've got a script that executes the copy command on an
NT4 server using IIS to copy a file from one pc to another. If I remotely
key in and execute the copy command by typing \\server\copy
\\machineA\fileA \\machineB\fileB, everything works fine. But If I try to
run this command from a script I get an access denied message because the
script doesn't seen to have access to the network computers. Any ideas?
Myles
myleslawrence@msn.com




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

Date: 24 Dec 1997 02:57:28 GMT
From: robertor@dedlegend.nwmarkets.co.jp (Richard G. Roberto)
To: Allen Choy <achoy@us.oracle.com>
Subject: Re: Advanced Perl Programming book
Message-Id: <67ptmo$g6k$1@news.typhoon.co.jp>

In article <349848E6.E0D54461@us.oracle.com>,
	Allen Choy <achoy@us.oracle.com> writes:
>Hi.
>
>Does anyone have any opinions, good and bad, re: the Advanced Perl
>Programming book?
>I'm considering purchasing it, but don't know much about it.
>
>Thanks!
>
>Allen
>

I thought it covered many aspects of perl programming very well, but
fell short in some areas.  It introduced a perl concept, and then tried
to use example code to illustrate its usefulness, but there was no
continuous case study, which I thought would have been useful.  Also,
the author seemed more interested in "selling" his modules that he wrote
to tackle a problem instead of presenting a more general description.

That was true of the persistence section, the networking section and the
perltk section -- the three parts I was most interested in.  I think
a book on each of these topics is in order :-)  In any event, the book
presents the intorduction to every aspect it claims to, it just falls
short on the follow through in these three areas (again, only because of
the author's approach -- demo-ing his own modules instead of teaching in
general terms).  I would still like to see such books use the case study
method to implement and tie in the various sections since that makes it
easier for boneheads like me to get it.

I give it two thumbs up with a twist, despite the very minor gripe ;)

Cheers,

-- 

"Until we extend the circle of our compassion to all living 
things, we will not ourselves find peace" -Albert Schweitzer

Richard G. Roberto



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

Date: Tue, 23 Dec 1997 22:02:34 -0700
From: tph@rmi.net (Tom "Tom" Harrington)
Subject: Re: Bidirectional IPC with long strings
Message-Id: <1d1qi3q.8m2bldyygp3nN@[166.93.24.67]>

RHS Linux User <tex@spambitesmynads.habit.com> wrote:

>       Please try the relatively new Expect module. It is available via CPAN
> in Austin Schutz's (me) directory. Expect was written as a more portable
> and more Tcl-Expect-like successor to Comm.pl.

Somehow I missed this.  It doesn't seem to be listed on the main CPAN
page, and I guess I didn't dig in the right places.

>       Expect also uses ptys, though I haven't run in to any sort of return
> limit. It's possible to set one should you wish to keep the amount of
> output scanned to a minimum (and thus run faster during complex regex
> matching).

Actually I mis-stated my problem.   It's not getting long strings out
of the pty that's the problem.  It's putting long strings into it.  That
is, if I attempt to print a string longer than 256 chars to the pty
handle, the pty hangs.  It's just like if I try to enter >256 chars 
at my Unix command-line prompt.  I'm currently working around it by
using a subroutine that attempts to intelligently wrap the lines, 
inserting "\" at the end of intermediate lines.

>       If you do end up using it, please feel free to send any comments you
> have.

I'll check it out and let you know what happens.  At this point it may
be a week or more before I have a chance, but I'll definitely take it
for a test drive.


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

Date: Tue, 23 Dec 1997 17:57:39 -0800
From: Satish Goverdhan <satishg@qualcomm.com>
Subject: Built Tk with multi-threaded Perl5.004_55?
Message-Id: <34A06C13.1907BBD0@qualcomm.com>

Hi,
  I am trying to build Tk402.003 with Perl 5.004_55(the multi-threaded
version which has still not been released officially), but compilation
fails. Here's the excerpt from the Tk make output:
% make
 ....
 ....
/usr/local/packages/SUNWspro4.2/bin/cc -c -I/pkg/X11r6/include
-D_REENTRANT -DUSE_THREADS -DDEBUGGING -g    -DVERSION=\"402.003\"
-DXS_VERSION=\"402.003\" -KPIC
-I/usr2/satishg/perl/perl/lib/sun4-solaris-thread/5.00455/CORE
-DBASEEXT=\"Tk\"  tkGlue.c
"tkGlue.c", line 716: undefined symbol: thr
"tkGlue.c", line 716: left operand of "->" must be pointer to
struct/union
"tkGlue.c", line 716: left operand of "->" must be pointer to
struct/union
"tkGlue.c", line 716: left operand of "->" must be pointer to
struct/union


When I removed the -DUSE_THREADS option from all the Tk Makefiles, the
compilation was just fine. But I got a core dump when I ran a Perl/Tk
script with the new build. (The same script works with perl5.004_04 and
TK402.003).

To build the multi-threaded perl, I used (on Solaris 2.5.1):
 ./Configure -Dusethreads -Doptimize=-g -ders 
-Dprefix=/usr2/satishg/perl/perl -Uusemymalloc
-Dcc=/usr/local/packages/SUNWspro4.2/bin/cc

make
make install

To build Tk I used:
perl Makefile.PL INSTALLDIRS=perl X11=/pkg/X11r6
make
make install

Same problems with gcc.
Any suggestions?
Thanks,
Satish


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

Date: Tue, 23 Dec 1997 16:58:32 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: bidyut@yahoo.com
Subject: Re: Changing the file name dynamically when the user saves the file
Message-Id: <Pine.GSO.3.96.971223163736.1238X-100000@user2.teleport.com>

On Tue, 23 Dec 1997 bidyut@yahoo.com wrote:

> I want to do something like this. When an user uploads the file
> (original_name.doc), the system generates a serial number and saves the
> file in the serial no. i.e. serial_no.doc. Both the file name and the
> corresponding serial number is saved in the database.
> 
> When the user tries to download the particual file(serial_no.doc, i want
> the file to be saved as original_name.doc, not as serial_no.doc.

I think you should write one or more perl scripts to do this. If you get
stuck on a Perl problem, could you let us know where the problem is?  Of
course, if it's a general CGI problem, or one about your server or
hardware, you may need to ask in a newsgroup about that. Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Tue, 23 Dec 1997 16:30:53 -0700
From: "Mark S. Reibert" <reibert@mystech.com>
Subject: Re: Correct syntax for length function?
Message-Id: <34A049AD.EE3F3240@mystech.com>

FeckMan wrote:

> Hello!
>
> I'm trying to evaluate the length of a scalar variable and conditionally go
> to a subroutine based on the result.  I'm not sure, however, if my syntax is
> correct.  The Camel book doesn't give an example of the usage.   Any help
> would be greatly appreciated.  Here's a snip from the code:
>
> sub check_form
> {
> if (length($firstname) == 0) {&incomplete1};
> if (length($lastname) == 0) {&incomplete2};
> }
>
> or
>
> sub check_form
> {
> if (length($firstname) eq 0) {&incomplete1};
> if (length($lastname) eq 0) {&incomplete2};
> }

Not to pick, but it seems it would have taken less time to simply try your
options that to post the message! :-) length() returns the length in bytes - a
number, so go with the ==. (Actually, however, either will work since, when
interpreted as a string 0 becomes "0", which is false according to the rules on
page 21 of the Camel.)

HTH
-----------------------------
   Mark S. Reibert, Ph.D.

  Mystech Associates, Inc.
  3233 East Brookwood Court
   Phoenix, Arizona 85044

    Tel: (602) 732-3752
    Fax: (602) 706-5120
 E-mail: reibert@mystech.com
-----------------------------




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

Date: Wed, 24 Dec 1997 03:15:43 GMT
From: "tlowery" <tlowery@MCIONE.com>
Subject: Re: Don't want to offend
Message-Id: <z7%n.2087$pq1.326809@news.internetMCI.com>


brian d foy wrote in message ...
>In article <349F1863.5F39@canadamail.com>, palobo@canadamail.com wrote:
>
>>I am a bookseller that offers excellent deals on Perl books as well as
>>other programming books and I would like to drop a note in the
>>comp.lang.perl.misc newsgroup from time to time but do not want to
>>offend anyone. Would this be appropriate for this newsgroup or is it
>>solely devoted to coding issues?
>
>this would not be the appropriate place, but the newsgroup is not
>solely devoted to coding issues.  discussions of books often take
>place, but blatant or thinly disguised advertising has not often
>been well received.
>


IMHO

(My previous message didn't post ... )

This is the place for such information as long as it's done in good taste,
and openness.
Everyone has equal ability to read or not read messages based on the Subject
lines.
There are a number of Perl related authors, developers, and support people
who advertise
their wares.  In fact, my last attempt to hire a perl consultant was based
on information
from the this news group.





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

Date: Wed, 24 Dec 1997 02:19:51 +0000
From: Mark Worsdall <shadowweb@worsdall.demon.co.uk>
Subject: Re: getting directory size
Message-Id: <wh+xYHAHFHo0Ew9O@worsdall.demon.co.uk>

In article <349ea7f8.563325679@woody.wcnet.org>, "Jeremy D. Zawodny"
<jzawodn@wcnet.org> writes
[snip]
>
>The combination of stat() and File::Find ought to do what you need.

The script below will work when called from an html, which will give you
a live directory listing with size count. If called from a crontab it
will generate an html/stm file.

Butcher and enjoy!

#!/usr/local/bin/perl -w
use File::Find;
#
# This is the location of your homepages on the server
$startloc = '/usr/www/foobar';
$homestart = '/usr/home/foobar';

# This variable will contain the webpage that called 
# it or by default crontab
$referer = 'crontab';
$sitesize = 0;
$referer = $ENV{'HTTP_REFERER'} if $ENV{'HTTP_REFERER'};


if (index($referer, 'http://www.shadow.org.uk/developer/') == 0) {
        print "Content-type: text/html\n\n";
} else {
        # Path and name of actual sitemap.html generated by this script
        $sitemap = '/usr/www/foobar/path/sitemap.stm';
        open(MAP,">$sitemap") or die "Error opening $sitemap: $!";
        select(MAP);
}

print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n" .
      "<html>\n" .
      "<head>\n" .
      "<title>MArk's or Marks or Marks': Site Map</title>\n" .
# Help me out here Rhodri:-)
      "</head>\n\n" .
      "<body background=\"/images/bg-wallpaper.gif\">\n";

print "<p>\n";
print "<center>\n";
print "<H2><font color=#0000f0>Site Map</font></H2>\n";
print "</center>\n";
print "<HR SIZE=6>\n";
print "</p>\n";

print "This was generated by/from: $referer\n<br><br><hr>\n";

print "<H3>WWW directory</H3>\n";
print "<UL>\n";
find (\&tell_time, $startloc);  # Call tell_time for every file under 
                                # current directory
print "</UL>\n\n<br><br>\n\n";

if (index($referer, 'crontab') == 0) {
        print "<H3>HOME directory</H3>\n";
        print "<UL>\n";
        find (\&tell_time, $homestart); 
        # Call tell_time for every file under 
        print "</UL>\n";
        }

print "Total Used: $sitesize\n";

print "</BODY>\n</HTML>\n";

if (index($referer, 'URL/path/') == 0) {
        close (MAP);
        }

sub tell_time {
        return if (-d $_);      # Not if it is a directory
        return if (-l $_);      # Not if it is a symbolic link
        return if (-z $_);      # Not if it is a zero length file


        # Now Subtract our start path to give us the full URL minus
        # the http part ofcourse
        $urlpath = substr($File::Find::name, length($startloc)+1,
(length($File::Find::name) - length($startloc))-1);

        print "    <li><a href=\"/" . $urlpath . "\">$urlpath</a> ", (-s
$_) , " bytes\n";
        $sitesize = $sitesize + (-s $_);

}


-- 
Mark Worsdall (Webmaster) - WEB site:- http://www.shadow.org.uk
Shadow:- webmaster@shadow.org.uk    
Home  :- shadowweb@worsdall.demon.co.uk
Any opinion given is my own personal belief...


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

Date: Tue, 23 Dec 1997 19:46:03 -0500
From: ushere@ibm.net
Subject: Re: help newbie at wit's end (almost)
Message-Id: <34A05B4B.55F4@ibm.net>

Dan Greenblatt wrote:
> 
> In article <34A0152A.25B9@ibm.net>, ushere@ibm.net wrote:
[snip]


> 
> > Apache is running ok as a local, htm's get returned.
> > Perl is running ok and the script executes, so what does
> > that leave me with, a server config problem?  The error
> > message suggests maybe a script problem regardless???
> >
> > test.htm is a one-line file:
> > <!--#include virtual="/cgi-bin/test.pl" -->
> >
> [snip]
> > entering the URL:    http://127.0.0.1/test.htm
> > gives: [an error occurred while processing this directive]
> > httpd.error_log says:
> > -exec of /usr/local/httpd/cgi-bin/test.pl failed, errno is 2
> > -access to /usr/local/httpd/cgi-bin/test.pl failed for localhost,
> >  reason: Premature end of script headers
> > -unable to include /cgi-bin/test.pl
> >  in parsed file /usr/local/httpd/htdocs/test.htm
> [snip]
> You appear to be missing the proper AddHandler directive 
[snip]
> ... Add .pl to the AddHandler for
> cgi-script, or create a new one for .pl , and see if that does any good.

did that,  both as 

AddHandler cgi-script .cgi  .pl
and as
AddHandler cgi-script .pl

 ... but to no avail

thanks

-- 



       -|-   Who, has loved us more?   -|-


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

Date: Tue, 23 Dec 1997 20:01:15 -0500
From: ushere@ibm.net
Subject: Re: help newbie at wit's end (almost)
Message-Id: <34A05EDB.4D07@ibm.net>

Mark S. Reibert wrote:
> 
> ushere@ibm.net wrote:
[snip] 
> Remove the semicolon on the previous line and place it after the print command:
> 
> print<<xhtm;
> <html><head><title>perl-practice</title></head>
> .
> .
> .
> xhtm   # no ; at the end of this line or on the next line!
> 

thanks, I've found out the hard way that the only place for 
it is alone and on the line right after xhtm {or whatever}. 

what spooks me is that I've had such scripts running before
with the same netscape elf for linux but under SlakWar with
almost identical apache configs.  That would leave just the
SuSE setup ... were it not for the error message.  I've 
already cleaned out everything I can think of {such as damm
cr's courtesy of warp's e.exe}.  Nor can I run any pl's in
this fashion so this 'particular' script may not be the real
gremlin.  


-- 



       -|-   Who, has loved us more?   -|-


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

Date: Tue, 23 Dec 1997 20:59:44 -0500
From: ushere@ibm.net
Subject: Re: help newbie at wit's end (almost)
Message-Id: <34A06C90.4E70@ibm.net>

ushere@ibm.net wrote:
[snip]
> ---------------------------------------
> entering the URL:    http://127.0.0.1/test.htm
> gives: [an error occurred while processing this directive]
> httpd.error_log says:
> -exec of /usr/local/httpd/cgi-bin/test.pl failed, errno is 2
> -access to /usr/local/httpd/cgi-bin/test.pl failed for localhost,
>  reason: Premature end of script headers
> -unable to include /cgi-bin/test.pl
>  in parsed file /usr/local/httpd/htdocs/test.htm
[snip]


anybody know a good place to hide?  

I was looking for the perl link I had placed @ 
usr/local/bin/  so as not to have to modify 
my scripts just for local testing.  I couldn't
see it because I was @  /root/usr/local/bin....
but a voice said 'come back here and check this 
out later'.  So I went to /usr/local/bin and
sure enough there it was ... NO link... a brand
new installation. The link I 'had' placed would
not migrate by itself after a format |:-(  |;-)


I'll take it:  "another newbie with more fingers 
                than {arguably} places to stickem"


-- 



       -|-   Who, has loved us more?   -|-


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

Date: Wed, 24 Dec 1997 00:44:00 +0000
From: Mark Worsdall <shadowweb@worsdall.demon.co.uk>
Subject: Re: How to check files exists and if it does then?
Message-Id: <fTLaECAQrFo0Ewaq@worsdall.demon.co.uk>

In article <47fcbd0fa4rhodri@wildebst.demon.co.uk>, Rhodri James
<rhodri@wildebst.demon.co.uk> writes
[snip]

I thankyou for that Rhodri. You will be glad to know that it has been
implemented.

Will move onto the next job.:-)
-- 
Mark Worsdall (Webmaster) - WEB site:- http://www.shadow.org.uk
Shadow:- webmaster@shadow.org.uk    
Home  :- shadowweb@worsdall.demon.co.uk
Any opinion given is my own personal belief...


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

Date: Tue, 23 Dec 1997 19:32:50 -0800
From: Patience <feng@haas.berkeley.edu>
Subject: Is there a perl function eq to cut in bash?
Message-Id: <34A08261.BBA30404@haas.berkeley.edu>

Hi guys,

I would like to have the ability to cut columns in Perl.  Is this
possible or do I have to use the command "cut" in bash?  Is it possible
then to call bash shell while in Perl script?

Thanks a bunch in advance! : )

--
     Patience (Pei-shen)
           feng@haas.berkeley.edu  OR  psf@usa.net





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

Date: Wed, 24 Dec 1997 03:52:37 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Is there a perl function eq to cut in bash?
Message-Id: <ebohlmanELoDFp.KMB@netcom.com>

Patience <feng@haas.berkeley.edu> wrote:
: Hi guys,

: I would like to have the ability to cut columns in Perl.  Is this
: possible or do I have to use the command "cut" in bash?  Is it possible
: then to call bash shell while in Perl script?

You can certainly use substr() or unpack() to cut columns within a Perl
script; this is more portable and less resource-intensive than spawning a
separate process to do it. 



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

Date: Tue, 23 Dec 1997 00:07:20 GMT
From: mccarthy@marshall.edu (Mike McCarthy)
Subject: Opening a telnet process as a filehandle?
Message-Id: <349f0083.4716279@news.marshall.edu>

I'm writing a script to take advantage of our new alphanumeric pagers
by POSTing a message to our paging service's WWW server.  I can
manually telnet to that server on port 80 and enter the message
successfully.  When running through the perl script, however, the
commands which I assumed would print to the telnet process filehandle
don't seem to be working.

Manually at the command prompt I can do this:

	]$ telnet paging.server.com 80
		(server responds with successful connection)
	POST _vti_bin/shtml.dll/index.htm HTTP/1.0
	Content-length:39

	VTI-GROUP=0&PagerID=555-1111&Message=OK

and the sever will respond with raw HTML code and then successfully
send the page.

When I execute this script (abbreviated), though:

	#!/usr/bin/perl
	open (PAGEME, "| telnet paging.server.com 80");
	sleep 5;   # allow time to connect to the server
	print PAGEME "POST _vti_bin/shtml.dll/index.htm HTTP/1.0\n";
	print PAGEME "Content-length:39\n\n";
	print PAGEME "VTI-GROUP=0&PagerID=555-1111&Message=OK\n";
	close (PAGEME);

the telnet process connects successfully, and the script sleeps for 5,
but then the connection closes.  I realize that I probably shouldn't
see my printed messages, but I don't get any HTML response from the
server and I don't receive the page, either.  The entire response is:

	Trying 199.1.2.3...
	Connected to paging.server.com.
	Escape character is '^]'.
		(script pauses because of sleep command)
	Connection closed by foreign host.

and I am returned to the command prompt.

Any suggestions?

--
Mike McCarthy, Asst. Dean
Information Technology & Medical Informatics
Marshall Univ. School of Medicine
mccarthy@marshall.edu


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

Date: Wed, 24 Dec 1997 01:35:09 GMT
From: wjin@cs.uh.edu (Woody Jin)
Subject: Re: Perl editor needed
Message-Id: <67pplr$t02$1@Masala.CC.UH.EDU>

In article <67mgu3$cs5$3@mainsrv.main.nc.us>, scott@softbase.com wrote:
>Perl editors under Windows ... 

Elvis 2.1
 1) First, it is a vi.  I can't live without it
 2) Nice syntax coloring.

available ftp://ftp.cs.pdx.edu/pub/elvis

--
Woody


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

Date: 23 Dec 1997 23:13:02 GMT
From: thospel@mail.dma.be
Subject: Re: perl4 -> perl5 operation
Message-Id: <67pghu$6lh$1@quasar.lunix.org>

In article <Pine.GSO.3.96.971215184636.24265G-100000@user2.teleport.com>,
        Tom Phoenix <rootbeer@teleport.com> writes:
> On Mon, 15 Dec 1997, Jerry Pendergraft wrote:
>
>> In perl 4[.036] one could write:
>>
>> $Count = 1;
>> s/foo/foo_${Count++)/g
>
> Could one? :-)  I think you meant something a little different...
>
>> And each occurance of "foo" would be replaced with foo_1 foo_2 foo_3
>> foo_n
>> no matter how many times foo appeared on each line.
>
>    s/foo/ 'foo_' . $Count++ /ge;
>
> Does that do it? Hope this helps!  
>

Or (very simular, but without e):
  perl -e '$a="abababab"; $a=~ s/a/@{[$count++]}/g; print "$a\n";'
gives:
  0b1b2b3b

Is the second part of an s/// GUARENTEED to be evaluated each time through the
match ?
--
Microsoft: Where do you want to go today?
Linux: Been there, done that.


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

Date: Tue, 23 Dec 1997 23:41:25 -0600
From: craig@cgi-perl.com (Craig Patchett)
To: craig@cgi-perl.com
Subject: Re: Review of CGI/Perl book
Message-Id: <882920705.230031371@dejanews.com>

brian d foy wrote:

In article <66o7rp$7ju@tekka.wwa.com>, scribble@tekka.wwa.com (Tushar
Samant) wrote:

  >It's incredible how
  >everyone is recommending this extraordinary book for the fulfilment
  >of one's web dreams. It has arrived. Every hacker born in this
  >decade will grow up with an instinctive feel for the CGI/Perl
  >cookbook, or he will be no hacker.

(I know this thread is old but I just ran across it)

Hmmm...I wrote the book (half the scripts and all the text) and would
never claim that a love of the book is a hacker prerequisite. In fact,
from the beginning of the project I knew that the book would end up
garnering the scorn of the Perl elite based on several choices I made
early on, especially the choice to have all the scripts run under Perl
4.x (a nice way of saying that we don't cover Perl 5). Yet even though
Randal strongly opposed this choice from the beginning, he still stated
for the record that the book "should definitely be on your shelf for
ready-to-run programs and inspiration for your own custom programs." His
comment captures the intent of the book.

The bottom line is that the CGI/Perl Cookbook is not targeted at Perl
experts (we state as much in the book), although there's certainly some
code in it worth borrowing if you're in a rush to get something done. Its
primary purpose is to allow a relatively straightforward and
comprehensive entry point into CGI programming with Perl through a
learn-by-example approach. As such both Matt and I both went out of our
way to make the code easy to understand rather instead of worrying about
making it technically perfect from a language standpoint. I expect and
hope that once people get their feet wet with the book's code that many
of them will go on to explore more advanced aspects of the language and
either apply them to the book's scripts or branch off on their own. Our
goal is to make the process of getting their feet wet enjoyable enough
that they will want to explore further. In fact, there are many places
throughout the book where we refer people to the Camel (and Llama) and
recommend that purchase a copy if they don't already have one.

While I realize many of you may disagree, I believe it is this approach
that has made the book so popular so quickly. It may not be a perfect
book (I'll be the first to point out its shortcomings) but at least it
realizes that there are plenty of people out there who have a strong
interest in Perl but who either aren't coming from a strong programming
background or who haven't spent much time with Perl. (Or who simply don't
have the time to build something from scratch.)

So, in conclusion let me state once again that the CGI/Perl Cookbook is
definitely  NOT a prerequisite for hackerdom (I have yet to see a CGI
book that is, although frankly I think that a combination of the Camel
and the Owls, a little common programming sense, and some creative
problem-solving skills are the recipe for a true CGI hacker), and whoever
suggested it was in the first place is now on my A-list :-) It's a good
book, however, for anyone who just wants to get some decent CGI scripts
up and running and who would like to make it easier to develop some of
their own in the process (think of it as the difference between someone
who enjoys watching Star Trek and a Trekkie).

Craig

--------------------------------------------------------------------
Craig Patchett                           email : craig@cgi-perl.com
The CGI/Perl Cookbook                      www : http://cgi-perl.com
--------------------------------------------------------------------

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Tue, 23 Dec 1997 19:11:41 -0500
From: Barbara Riviezzo <sflower@cyberportal.net>
Subject: server misconfig
Message-Id: <34A0533C.D491B140@cyberportal.net>

Hello!  I am trying to get a PERL script to run, and it works fine on
the server, at the command prompt.  However, when I try to run it
through a web browser, it tells me:

Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your
request.

Please contact the server administrator, webmaster@phatboys.com and
inform them of the time the
error occurred, and anything you might have done that may have caused
the error.

I know that this is a common message, but I've been working on this for
about four hours now, and my brain is fried.  The script is at
http://www.phatboys.com/private-cgi/vcenter.cgi and I'll put the source
for it at vcenter.txt in the same directory.  It requires a config.cgi.
I made this called config.txt.  If anyone can help me out, could you
please reply to my address, mikec@cyberportal.net, if possible.  I am
reall frustrated and would GREATLY appreciate any possibly ideas.
Thanks in advance.

mike cross



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

Date: Tue, 23 Dec 1997 18:17:52 -0500
From: TechMaster Pinyan <jefpin@bergen.org>
Subject: Teen Perl Programmers Mailing List
Message-Id: <Pine.SGI.3.95.971223180252.3040A-100000@vangogh.bergen.org>

Ok... I am sure many of you are teenagers programming (I hope), like
myself.  I think that a teen programmer mailing list should be started, or
even a newsgroup.  I would like to host the mailing list... if you are
interested, please email me at techie@continuum.eu.org.

Programming is a growing field, and more and more programmers are needed
in today's industry; check out this article:
http://www.washingtonpost.com/wp-srv/business/longterm/tech/techjob1.htm

This is what my sister and brother-in-law had to say:
	>Second, I just read a really good 2 part story on the incredible
	>need for comp sci people, both nationally and in the DC area.
	>Also mentions Va. Tech program (high ratings).

The mailing list would let teens have a Perl forum, talk about prospective
CompSci colleges, and share code.

Let me know if you're interested... please use the Replt-To: email
address.

Thanks for your time.

----------------
| "I am just so full of it!"
| 	- Josh Ludzki
----------------
Jeff Pinyan | http://users.bergen.org/~jefpin | jefpin@bergen.org
webXS - the new eZine for WebProgrammers! TechMaster@bergen.org
Visit us @ http://users.bergen.org/~jefpin/webXS
*NEW* techmaster@mindless.com | jpinyan@sdf.lonestar.org *NEW*
** I can be found on #perl on irc.ais.net as jpinyan **

- geek code -
GCS/IT d- s>+: a--- C+>++ UAIS+>$ P+++$>++++ L E--->---- W++$
N++ !o K--? w>+ !O M>- V-- PS PE+ !Y !PGP t+ !5 X+ R tv+ b>+
DI+++ D+>++ G>++ e- h- r y? 



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

Date: Wed, 24 Dec 1997 00:21:59 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Teen Perl Programmers Mailing List
Message-Id: <comdog-ya02408000R2412970021590001@news.panix.com>
Keywords: from just another new york perl hacker

In article <Pine.SGI.3.95.971223180252.3040A-100000@vangogh.bergen.org>, techie@continuum.eu.org wrote:


>The mailing list would let teens have a Perl forum, talk about prospective
>CompSci colleges, and share code.

i didn't realize the newsgroup had an age limit - no one carded me
when i first came in... :)

-- 
brian d foy                                  <comdog@computerdog.com>
Meta Meta FAQ <URL:http://computerdog.com/Meta_MetaFAQ.html>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 24 Dec 1997 00:34:01 GMT
From: thospel@mail.dma.be (Ton Hospel)
Subject: Re: What kind of machine wouldn't support FLOCK?
Message-Id: <67pl9p$8g9$1@newspost.lunix.private>

In article <comdog-ya02408000R1812970021100001@news.panix.com>,
	comdog@computerdog.com (brian d foy) writes:
> In article <34999ae1.9261423@news.ais.net>, syarbrou@ais.net (Steve) wrote:
> 
>>I have done extensive testing of flock on unix systems anyways and
>>several systems have it, but only Linux truely seems to support it.
>>All the other flavors of UNIX accept the command but do not work.
> 
> perhaps you can share your test script?
> 

mayb he got hit by something like what happend to me yesterday, code like:

sub lock {
    local(*LOCK);

    open(LOCK, .....
    flock(LOCK.....
    # Here I have the lock
}

lock();
# Whatever I thought, here I don't have the lock anymore

It seems perl sees the LOCK go out of scope,
and closes the file for me, a behaviour I would have expected for a
FileHandle or IO::File object, but hit my by surprise for a glob.

How long has this behaviour been in there ? (I assume that the deeper
cause has to do with the attempts to make filehandles really IO::Handle
thingies, so is this since 5.004 ?)

-- 
Microsoft: Where do you want to go today?
Linux: Been there, done that.


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

Date: Tue, 23 Dec 1997 13:35:50 -0700
From: Joel <joel@microworld.com>
Subject: Works from Telnet, not SSI #Exec...
Message-Id: <34A020A5.549A0427@microworld.com>

I have a script that I've written for banner advertising.  The script
reads a data file, writes to STDOUT, then writes to a log file.  It
works under Windows 95 from the command line.  It also works from the
server if I telnet in and run it from the command line.  If I run it
from a <!--#exec--> metatag, however, it will read the data file, output
to STDOUT, but will not output to a log file...   Any ideas?  The
directory I'm trying to write to exists, and supposidly has world read
and write access.

Please CC your answer to joel@microworld.com .

Joel



This article was posted from <A HREF="http://www.slurp.net/">Slurp Net</A>.


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

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

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