[6631] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 256 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 8 15:17:29 1997

Date: Tue, 8 Apr 97 12:00:23 -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           Tue, 8 Apr 1997     Volume: 8 Number: 256

Today's topics:
     AUTOLOAD and SUPER class (Honza Pazdziora)
     exec "exit" (nicholas david pesce)
     Re: exec "exit" (Bennett Todd)
     Re: exec, fork, wait ... <seay@absyss.fr>
     Help Configuring to run a perl program (MS0)
     Re: HELP!  With MacPerl (Chris Nandor)
     Re: How can I get the weekday of first day of some mont (Mike Brudenell)
     if statement doesn't work! <josephw@tamu.edu>
     Re: Newbie Question about Llama Book <brinthl@ch.etn.com>
     Re: OO programming question (Nathan V. Patwardhan)
     Re: OO-Perl corrupts parameters! <psrc@exmachina.com>
     Re: Ousterhout and Tcl lost the plot with latest paper (Daniel Wang)
     Re: Ousterhout and Tcl lost the plot with latest paper (Rainer Joswig)
     Re: Pattern matching (Regexp) (ALASTAIR AITKEN CLMS)
     Re: Perl and Netscape Navigator (Nathan V. Patwardhan)
     Re: Perl and NT <bmehling@uci.edu>
     Question Of Leading \n From Join Function. (Rhadji P)
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and <Smi@4mate.hr>
     Re: Unix and ease of use  (WAS: Who makes more ...) (Peter Seebach)
     using gmake to make Alpha makefile (Dan Ascheman)
     Re: Wanted, a currency converter? Automatic file downlo <daveh@dhcs.demon.co.uk>
     Win32 System() help (Jeff Lawrence)
     Re: Win95 opendir() (Mike Stok)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 8 Apr 1997 15:23:38 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: AUTOLOAD and SUPER class
Message-Id: <adelton.860513018@aisa.fi.muni.cz>


Hallo,

I am having two classes, Parent and Child. I have AUTOLOAD function in
Parent and I have one in Child. From Child, I try to call function,
that will call AUTOLOAD in Child's class. I would like to forward the
call into Parent's AUTOLOAD and I need to avoid recursion in Child's
AUTOLOAD method.

Here is my piece of code:

----
package Parent;
sub new
        {
        my $class = shift;
        bless [ ], $class;
        }
sub AUTOLOAD
        {
        my $self = shift;
        my $function = $AUTOLOAD;
        print STDERR "Function $function in $self (Parent::AUTOLOAD)\n";
        }

package Child;
@ISA = qw( Parent );
sub mcall
        {
        my $self = shift;
        print STDERR "Function mcall in $self (Child::mcall)\n";
        $self->SUPER::alpha();
        }
sub call
        {
        my $self = shift;
        print STDERR "Function call in $self (Child::call)\n";
        my $func = 'SUPER::alpha';
        $self->$func();
        }
sub AUTOLOAD
        {
        my $self = shift;
        my $function = $AUTOLOAD;
        print STDERR "Function $function in $self (Child::AUTOLOAD)\n";
        $function =~ s/^.*:://;
        $function = 'SUPER::'. $function;
        $self->$function();
        }

package main;
my $object = new Child();
$object->mcall();
$object->call();
$object->xcall();
__END__

The result that I get is

Function mcall in Child=ARRAY(0x1001b26c) (Child::mcall)
Function Child::SUPER::alpha in Child=ARRAY(0x1001b26c) (Parent::AUTOLOAD)
Function call in Child=ARRAY(0x1001b26c) (Child::call)
Function Child::SUPER::ISA in Child=ARRAY(0x1001b26c) (Parent::AUTOLOAD)
Function Child::xcall in Child=ARRAY(0x1001b26c) (Child::AUTOLOAD)
Function Child::SUPER::ISA in Child=ARRAY(0x1001b26c) (Parent::AUTOLOAD)
Function Child::DESTROY in Child=ARRAY(0x1001b26c) (Child::AUTOLOAD)
Function Child::SUPER::ISA in Child=ARRAY(0x1001b26c) (Parent::AUTOLOAD)

>From $object->call(); I try to call SUPER::alpha but I get
Child::SUPER::ISA in the Parent's AUTOLOAD. The same in
Child::AUTOLOAD. Why do I loose the call, xcall and get that ISA?
It works however, when I change

$function = 'SUPER::'. $function; to $function = 'Parent::'. $function;

but that doesn't seem to be portable -- parent might change. Is there
any better way to do it?

Thanks for your time.

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 8 Apr 1997 13:05:39 -0400
From: pesce@ballet.cis.ohio-state.edu (nicholas david pesce)
Subject: exec "exit"
Message-Id: <5idtt3INNehd@ballet.cis.ohio-state.edu>


I seem to be having a problem using the exec command.  I want to exit
my perl script and then exit my login on a particular machine...thus I want
to execute a line in my script that says:

exec "exit" || die "command failed";
or
exec ("exit") || die " command failed";

when I try it with () I get the die error, and when I try without
() the program gives me no error, but doesn't logoff the xterm, or particular
machine...

Help is appreciated.

Sincerely

-Nick


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

Date: 8 Apr 1997 17:36:11 GMT
From: bet@rahul.net (Bennett Todd)
Subject: Re: exec "exit"
Message-Id: <slrn5kl0gb.5cb.bet@waltz.rahul.net>

On 8 Apr 1997 13:05:39 -0400, nicholas david pesce <pesce@ballet.cis.ohio-state.edu> wrote:
>I seem to be having a problem using the exec command.  I want to exit
>my perl script and then exit my login on a particular machine...thus I want
>to execute a line in my script that says:
>
>exec "exit" || die "command failed";

Sorry, no can do. The problem is not in the perl code; it's in the fundamental
logic of the task.

When you run your script in Unix, here's what happens:

- The shell, which is an executing program, calls fork(2). [That notation
  means "fork, which is documented in section 2 of the Unix Programmer's
  Manual"; type "man 2 fork" to read that manual page.] So anyway, fork(2)
  creates a child process. The parent process then waits for that child to
  exit, and prompts for a new command.

- Meanwhile, the child calls execve(2) to run the program; that replaces its
  executing image with the new one --- in this case, a perl interpreter. This
  runs the script and then exits, which is what the parent is waiting for.

When you run something in the background by ending the command with "&", the
only difference is that the shell doesn't wait for the child to exit.

So where does all this get us? You can't ``exit'' the parent process. All you
can do is kill it. To do precisely that, you can use

	kill 9, getppid;

If you want to kill all processes in your login session, you might be able to
do it with

	kill 9, -getpgrp;

For ordinary process killing, it's kinder to start off with a gentler signal,
and only escalate to a more vicious one if the gentle one is ignored --- this
lets well-written programs clean up after themselves. But shells deliberately
ignore just about all the signals they can. The very nicest way to code this
would be to send a TERM (15), and if that doesn't do the job (after waiting a
few seconds) follow up with a KILL (9). But if you know that your parent is
the shell, there's no point. And if you're killing the whole process group,
don't forget to arrange to ignore the TERM, or else you won't be around to
follow up with a KILL. E.g.

	$SIG{'TERM'} = 'IGNORE'; # I can't HEAR you....
	kill 15, -getpgrp;
	sleep 5; # how long might a program need to clean up?
	kill 9, -getpgrp; # Good bye

-Bennett


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

Date: Tue, 08 Apr 1997 19:04:40 +0100
From: Douglas Seay <seay@absyss.fr>
To: Eric Debes <edebes@igd.fhg.de>
Subject: Re: exec, fork, wait ...
Message-Id: <334A88B8.2525@absyss.fr>

Eric Debes wrote:
> 
> Hi everybody !
> 
> I have trouble executing a compiled C++ - program (called progname)
> that gets information from different fiels, sends some other
> datas to other files (for example : swbres.dat) and print out
> some information (usually to STDOUT, but redirected to a file :
> outfile.dat). A piece of my perl script looks like :
> ---------------------------------------------------------------------
> 
> open(OUTDATEI," > outfile.dat");
> unless (fork) {
>     exec("./progname > OUTDATEI");
> }
> wait;
> close(OUTDATEI);

this isn't doing what you want.  try

	system("./progname > outfile.dat");

it will launch ./progname and the shell will redirect all the STDOUT to
the file outfile.dat, which is what I think you were trying to do. 
system() will not return until ./progname is done.

note: when you call exec() with a scalar with meta characters like you
did, it is passed to the shell so the shell can do all the ugly stuff. 
the bit about "> OUTDATEI" will just cause the shell to create a file
called OUTDATEI in the current directory.  you need to look at file
duping under "open" in the man page or the camel.  also, why did you
open OUTDATEI in the parent when the parent never uses it?  that isn't
bad (ie-causes a bug) but it isn't useful either.
	


> # I'd like the program to wait untill "Contrast_sol is finished
> # so that I can read datas from the files (in which Contrast_sol
> # has writen) like this, in the same perl script :
> 
> open(DISTDATEI,"./swbres.dat");
> $dist = <DISTDATEI>;
> close(DISTDATEI);

this just opens ./swbres.dat and reads the first line.  since you don't
check any return values, it could fail and you'd never know it.  if you
really want to synchronize file I/O, you need file locking.  you can
find this in old Usenet articles (deja news). There is also a FAQ item
on this at CPAN/doc/manual/html/pod/perlfaq5/How_can_I_lock_a_file_.html
(or look at www.perl.org under documentation).


> ---------------------------------------------------------------------
> 
> But this doesn't seem to work well.
> The program Contrast_sol doesn't seem to write neither in outfile.dat
> nor in swbres.dat.
> However, when I execute the line
> ./Contrast_sol > OUTDATEI
> in a UNIX-Shell, then it works...
> 
> Do you have an idea about this problem ?
> Thanks in advance for your time and your help.
> 
>                         Eric


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

Date: Tue, 08 Apr 1997 17:00:09 +0100
From: "James D.C Savage (MS0)" <jdcs100@york.ac.uk>
Subject: Help Configuring to run a perl program
Message-Id: <334A6B89.794B@no_spamyork.ac.uk>

This is the first time I have tried to use perl.  I have obtained a set
of perl programs writen by someone else and have changed my Unix Profile
so that my path includes the directories where I think perl should be:

path=($path /bin/perl /usr/bin/perl /usr/sbin/perl /usr/lib/perl
/usr/share/catman/u_m)


We have perl, version 4.0 installed:

$RCSfile: perl.c,v $$Revision: 1.1 $$Date: 1993/05/14 18:36:10 $
Patch level: 36

The perl program starts with the following line
#!/usr/local/bin/perl -w
I assume that this tells unix shell what interpreter to use.

When I try and execute the perl program by typing "main_prg" it fails
and gives a message as follows:

main_prg: No such file or directory

When I type "perl main_prg" the program runs but then fails when when
perl encounters system calls.  eg  system(sub_prg.... fails with error
msg "sub_prg: Cannot execute"

Has anyone any idea what is wrong with my setup ?


-- 
James


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

Date: Tue, 08 Apr 1997 11:24:08 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: HELP!  With MacPerl
Message-Id: <pudge-ya02408000R0804971124080001@nntp.noc.netcom.com>

In article <5ic77f$7j9@eyrie.org>, bbrown@eyrie.org (Ben Brown) wrote:

#Thanks for responding to my earlier question.  that was extremely
#helpful. so far I only have one (probably incredibly stupid) question about
#the perl port for the mac.  Since "\n" has a different ascii value, can I
#still us it in output to indicate a new line (I'm not real familiar with my
#ASCII) or do I need some workaround?

When outputting to a local host (as in to local files), "\n" is sufficient,
and probably desired.  But when outputting network stuff, the CRLF pair
"\015\012" is best.  This is true for all platforms, Mac, Unix and Windows
included.

#================================================================
Sorry, my mind was wandering.  One time my mind went all the way
to Venus on mail order and I couldn't pay for it.

   --Steven Wright

Chris Nandor                                      pudge@pobox.com
PGP Key 1024/B76E72AD                           http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6


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

Date: Tue, 08 Apr 1997 16:57:32 +0100
From: pmb1@york.ac.uk (Mike Brudenell)
Subject: Re: How can I get the weekday of first day of some month in perl ?
Message-Id: <pmb1-ya023680000804971657320001@news.york.ac.uk>

In article <3348B3A4.985@ccl.itri.org.tw>, Fu-Chin <fliu@ccl.itri.org.tw> wrote:

> As subject above.

If you are using Perl 5 look at using the Time::Local module (standard with
Perl 5) to convert a time/day/month/year set of arguments into the "seconds
from a base date number" akin to that returned by the time() function.

[See perldoc Time::Local for more information on its use.]

Next feed this number to the localtime() function to break it back down
into its components, which will now include the day-of-the-week number
(0=Sunday, 1=Monday, etc)

Alternatively there are various auxilliary modules you can ftp and install
from the CPAN archives, such as Date::DateCalc and Date::Manip which may
allow you to get the information in one step.

Cheers,

--
Mike Brudenell                                         <pmb1@york.ac.uk>
------------------------------------------------------------------------
The Computing Service, University of York, Heslington, York, YO1 5DD, UK
Tel: +44-1904-433811  FAX: +44-1904-433740  http://www.york.ac.uk/~pmb1/


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

Date: Tue, 08 Apr 1997 12:13:37 -0700
From: Joe Weinman <josephw@tamu.edu>
Subject: if statement doesn't work!
Message-Id: <334A98E1.6A62@tamu.edu>

Howdy...

I am having problems with the following perl script.  Basically, what I
am trying to do is use a shell script "listconn" to list current
connections to my database server.  Then I want to check this list
against the UNIX "ps" command to see if the connection really has an
active process.  If not, I can clear the process by "./listconn $line"
where $line is the line number produced by ./listconn without an
argument.

Sample "./listconn" output is:
0       20723            tamu
1       20694           notis   AG03,AGA2,AG79,AG9A
2       20728            tamu
3       20409           notis   AG9A
4       20288           notis   AG9A
5       20732            tamu

I have the following perl script (output follows):

#!/public/bin/perl
system("/usr/infoshare/sproot/bin/listconn >/sproot/bin/userlist.txt");
open (LIST, "/sproot/bin/userlist.txt");        # open LIST for reading
while (<LIST>)
        { @line[$i++] = $_; }
close (LIST);

open (PROC, "/usr/bin/ps -ef | grep dbserver|");
@howmany=<PROC>;

open (TEST, ">output");
print TEST "There are $howmany lines of output from the greps\n";
print TEST @howmany;

foreach (@line)
        {
        print TEST;
        ($linenum, $twomuch, $database) = split (/\t/, $_);
                                        # linenum = line number
                                        # twomuch = processid and
username
                                        # database = databases
        ($processid, $username) = split (/ /, $twomuch);
                                        # split twomuch into process and
user
        print TEST "$linenum $processid\n";
        while (<PROC>)
                {
                if (!/$processid/)
                   { system("/sproot/bin/listconn $linenum") } # end IF
                }                               # end WHILE
        };              # end FOREACH
close (TEST);

-----------OUTPUT-------------
There are  lines of output from the greps
    boss 17838     1  0 15:16:20 ?        0:00 ./dbserver -m
    boss 20694 17838  0 11:37:52 ?        0:02 ./dbserver -m
    boss 20732 17838  0 11:47:33 ?        0:01 ./dbserver -m
    boss 20767 20766  0 11:59:20 pts/2    0:00 grep dbserver
    boss 20766 20763  0 11:59:20 pts/2    0:00 sh -c /usr/bin/ps -ef |
grep dbse
rver
    boss 20723 17838  0 11:44:29 ?        0:02 ./dbserver -m
    boss 20728 17838  0 11:46:13 ?        0:01 ./dbserver -m
0       20723            tamu
0 20723
1       20694           notis   AG03,AGA2,AG79,AG9A
1 20694
2       20728            tamu
2 20728
3       20409           notis   AG9A
3 20409
4       20288           notis   AG9A
4 20288
5       20732            tamu
5 20732


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

As you can see, the $linenum and $processid variables are getting set to
what they need to be because they print out on a separate line by
themselves.

What I can't figure out is why my if statement doesn't execute!  I used
to have the form:

if (/$processid/)
      { next }
else
      { system("/sproot/bin/listconn $linenum") } # end IF

but this didn't work either.  Any ideas?  Please email privately at
email address below.

Joseph Weinman
josephw@tamu.edu


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

Date: 8 Apr 1997 16:26:15 GMT
From: "Lee Brinton" <brinthl@ch.etn.com>
Subject: Re: Newbie Question about Llama Book
Message-Id: <01bc443a$59f128a0$971063a6@brinthl.bid.ch.etn.com>

$d is a scalar and @fred is a n array when ($d,@fred) is assigned the list
($a, $b, $c) perl takes the items from the list one at a time from left to
right and trys to do the assign the values to the variables on the left
hand side of the '=' operator from left to right.  Since $d is a scalar it
can only hold one item from the list; it gets $a.  Since @fred is an array
it can hold any number of items and it sucks up the rest of the list; it
gets $b and $c.

($,@fred) = @fred; is similar; but this time instead of a list on the right
hand side of the = operator we have the array @fred.  However this works
the same way because the array @fred is used in a 'list context' which
means that perl will treat the values stored in the @fred array as a list.

I hope this is of some help to you.
-- 
H. Lee Brinton
brinthl@ch.etn.com
6xtippet@b4futures.net
I do not speak for Cutler-Hammer

> ($d,@fred) = ($a,$b,$c); # give $a to $d, and ($b,$c) to @fred
> ($e,@fred) = @fred; # remove the first element of @fred to $e
> # this makes @fred = ($c) and $e =$b
> 
> Would someone be so kind to explain this to me.  Perhaps I am rather 
> "thick" but it doesn't seem to make sense to me.



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

Date: 8 Apr 1997 15:44:13 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: OO programming question
Message-Id: <5idp4d$5dp@fridge-nf0.shore.net>

James A. Robinson (jimr@aubrey.stanford.edu) wrote:

: I've got a 2-part question on OO programming something in perl.  What
: I would like to do is create a Layer.pm class that that wrap() and
: unwrap() data from specific applications (uuncode, gzip, base64, etc.).

There are already modules on CPAN for uuencoding/decoding called
Covert::UU.  There are already MIME modules for base64.  If you
want to develop a module (for distribution) for gzipping files, I'd
strongly suggest taking a look at CPAN.html and following the directions
about submitting modules that you've developed; it's possible that you
can expand on an existing namespace, like Convert::GZIP.

In terms of using other functions, if I understand your problem
correctly, I think you're looking to EXPORT the functions from a
module, which means you should RTFM about exporting.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Tue, 08 Apr 1997 13:15:41 -0400
From: Paul S R Chisholm <psrc@exmachina.com>
To: ceklof@vt.edu
Subject: Re: OO-Perl corrupts parameters!
Message-Id: <334A7D3D.2533@exmachina.com>

Carl wrote:
> I am adding/converting some of my perl code to be immplement the OOP
> extentions....
> All of the routines that I've made into object methods no longer receive
> their parameters correctly! For single '$' parameters, everything has
> been shifted up one in the array of parameters

> package foo;
> sub test{
>         $firstVar = $_[0];
>         print $firstVar;
> }
> is now:
> sub test{
>         $firstVar = $_[1];
>         print $firstVar;
> }

$_[0] is "self"; try shifting it off first, then processing your other
arguments. For example, see the "display" function on p. 294 of Blue
Camel. You'll find this to be true for all instance functions. (Class
functions, such as constructors ("new"), have the class as the first
argument instead.)

> AND THEN, MY HASHES ARE REVERSED, KEY->VALUE, VALUE->KEY!!!

Same symptom. (You're passing them by value, right? Then just saying,
after some other argument processing, my(%hash)=@_;)

> I have:
>         Perl for Win32 Build 110
>         Built Aug 13 1996@08:18:50

Thanks; not relevant in this case, but always polite to include this
information.
--
Paul S. R. Chisholm, AirMedia, Inc. (formerly Ex Machina)
mailto:psrc@exmachina.com  http://www.exmachina.com/~psrc
I'm not speaking for the company, I'm just speaking my mind


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

Date: 08 Apr 1997 10:59:31 -0400
From: danwang@salomon.CS.Princeton.EDU (Daniel Wang)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <r8tg1x1a7cb.fsf@salomon.CS.Princeton.EDU>


After thinking about J. O's paper it looks like what he's really talking
about is domain specific versus general purpose langauges.

Where "scripting language" = Domain Specific 
and "systems language" = General Purpose.

When he talks about "gluing" I think he's really ought to say putting
together primitives designed by someone else that are at the right level of
abstraction. Read with this perspective some of what he says sounds a bit
more resonable.



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

Date: Tue, 08 Apr 1997 06:32:34 +0200
From: joswig@lavielle.com (Rainer Joswig)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <joswig-ya023180000804970632340001@news.lavielle.com>

In article <5ic0qc$ene@psychotix.cs.uoregon.edu>, jhobbs@cs.uoregon.edu
(Jeffrey Hobbs) wrote:

> In article <5ibl1p$5et$2@csnews.cs.colorado.edu>,
> Tom Christiansen  <tchrist@mox.perl.com> wrote:
> >    fellowsd@cs.man.ac.uk (Donal K. Fellows) writes:
> >:  toplevel .t
> >:  button .t.b -text Hi! -font {Times 16} -command {puts "Pressed at
(%x,%y)"}
> >:  pack .t.b -fill both -expand 1
> 
> >:How much extra Lisp would be needed to achieve this?

This depends on the GUI toolkit you would use and has nothing
to do with Lisp.

> Yes and no.  Some of the discussion has wandered off the main thrust of JO's
> paper, but Donal's point here is LOC (or perhaps more generally syntactic
> simplicity).  The use of Tk here proves a point because Tk has been grafted
> onto so many other languages.  The example above is written most "plainly"
> (concisely / fewest chars with greatest clarity / ...) when written in Tcl.

Is "fewer chars" is a meaningful criteria for software quality?
I'd rather prefer readability and fewer implicit assumptions.
I'd also prefer layout in declarative formats. etc. etc.

-- 
http://www.lavielle.com/~joswig/


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

Date: 8 Apr 1997 09:46:46 GMT
From: zpalastair@unl.ac.uk (ALASTAIR AITKEN CLMS)
Subject: Re: Pattern matching (Regexp)
Message-Id: <5id466$15i@epsilon.qmw.ac.uk>

In article <5ib5ef$44m@cronkite.ocis.temple.edu>, david@temss2.main.temple.edu (David Tucker) writes:
>
>	# A date in the form MM/DD/YY where @_ holds the date
>	if ( ! /[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9]/ ) { die "blah...";}
>
Try:

if (!m#\d\d/d\d/d\d#) {die ...};
or
if (!/\d\d\/\d\d\/\d\d/) {die ...};

Alastair.


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

Date: 8 Apr 1997 15:32:13 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl and Netscape Navigator
Message-Id: <5idodt$5dp@fridge-nf0.shore.net>

Bill Bailey (Bill.Bailey@biznetz.com) wrote:
: We are developers of web sites, and are using Perl to create a response
: form that sends e-mail to an address over the net.  The form asks for
: information to be filled in via a form, then sends it via e-mail.  We are
: NOT using the Navigator "MAILTO" function in order to be compatible across

Great scott (who Scott is and why he's great is another story)!  Looks
like *another* CGI and/or webserver question has unfortunately found its 
way into comp.lang.perl.misc.

This is definitely not a Perl question; this question regards your
webserver, and how it executes CGI scripts.  

The one piece of advice I will offer is that HTML documents have the
Content-type: text/html, and I think you should check your headers.
I would hope web developers would be aware of this.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Tue, 08 Apr 1997 09:11:28 -0700
From: Ben Mehling <bmehling@uci.edu>
To: Matthew Knight <matt@geenite.demon.co.uk>
Subject: Re: Perl and NT
Message-Id: <334A6E30.55AF@uci.edu>

Matthew Knight wrote:
> 
> I use Perl on a UNiX box at the moment, but I've been asked to develop a
> site which will sit on an NT server.
> 
> What is the easiest way of getting Perl for an NT machine, is a case of
> getting an NT Perl port, sticking it on the server, and then
> referenceing it in the the usual way...

Same situation here.  We just moved our Unix stuff to NT (blech), but I
went through and compiled some resources I used for this move.  You can
find them here: http://www.gsm.uci.edu/~bmehling/perl/#win32
Hope this helps.

Ben
http://www.gsm.uci.edu/~bmehling/nt/


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

Date: Mon, 07 Apr 1997 22:27:44 GMT
From: dharma@msys.net (Rhadji P)
Subject: Question Of Leading \n From Join Function.
Message-Id: <5ibso5$3kl@lois.zippo.com>

I've noticed the following sequence:

@list ='';
push(@list,val1,val2,val3,...valn);
$array{key} = join("\n",@list);

Results in:

$array{key} = \nval1\nval2\nval3\n...\nvaln

What is generating the leading \n?

Ron Picker






DharmaSystems
dharma@msys.net
Druid Hollow
French Creek, WV.



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

Date: Tue, 08 Apr 1997 17:32:31 +0200
From: Smiljan Grmek <Smi@4mate.hr>
To: Paul Wilson <wilson@cs.utexas.edu>
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <334A650F.4D63@4mate.hr>

2 bits worth by a recalcitrant programmer who declines going into sales,
consultancy or CS, and likes crafting precision software.

---

Discussing the merits of a language by contrasting it to all others is
unfair because a better one is easily found for any specific aspect.
This would imply that we should have a sort of 'language tournament' -
one on one - and probably no clear winner would emerge from that.

It should be remembered that Tcl was modelled after *shells* (remember
the surprise by authors of Unix that quite large shell programs were
being written and deployed - finaly catered to by 'shell compilers'). It
is a textual interpreter, like all the shells, a number of BASICs of
yore and a few 456Gen DB languages of today. This means: useful, slow,
wonderful for 5-liners, loose syntax, self-modifying, cryptic.

But the name is constant: Tool control langugage - glue code for
medium-sized application chunks, invoked either as procedures or
programs (vide Expect). To this day this purpose was faithfully served -
regression testing packages, net control systems, GIS applications, DB
interfaces ... all of these were produced by coordinating extant modules
using Tcl glue.

Let us not forget the proven practicality and usefulnes of Tcl - and no
amount of practicality of other languages can detract from it.

Tcl is an ugly duckling, to be sure - but all real-world langugages of
any impact are: COBOL, FORTRAN, C, C++, (awk, perl ... and the
unmentionable VB) with possible exceptions of PASCAL and ADA. For
contrast we can look at the elegant ones: Algol, LISP, Smalltalk, Scheme
(and here I refuse to name the recent ones, studies having shown that
most of the people earning their bread by programming are incapable of
understanding and using them). They are orthogonal, concise, clear - but
used mostly by the academe and as test-beds for extensions - and in
practice producing systems like MACSYMA with 1E9 lines of LISP code
(shudder ...).

Is it possible that languages with bumps and rough surfaces are somehow
easier to remember and decode when reading than quicksilver smooth
theoretical ones? Is it perhaps easier to interpret an ad-hoc construct
than to reconstruct semantics from first principles?

Tcl is for writing *programs* not *algorithms*. Think of it more as a
tool to get things done then a vehicle for expressing ideas.

My experience with Tcl is satisfactory. Having to write a system which
would control a number of weighing scales in an industrial application
the first step was choosing the implementation language. First decision:
C or other was influenced by the 'other' part - there had to be event
queuing, there had to be socket communications, there had to be Oracle
interface, there had to be text analysis (for a small application
language was envisioned). Tcl popped up as just the right tool. Two
months and 5000 lines of code later the system was delivered and had
only one problem - the scales sent leading zeroes with integer data and
these were interpreted as octal. And the application language was
implemented by converting it to Tcl and directly executing - did not
even have to write an expression evaluator!!!

The speed problem (later proven imaginary) was solved by investing in a
more powerful CPU. If I consider what would have to be done to code the
thing in C (even though I am vastly more familiar with C/C++ than Tcl) I
must conclude that the development would take much more time and effort.

Tcl downloads easily, compiles with no warnings - quite rare with
freeware - has ample documentation, sample programs (a Web browser had
approx 2000 lines - remarkable), and anybody who ever did any shell
scripting can use it immediately. Apparently Prof. Ousterhout is firmly
in control and resists all but the most useful additions or changes to
the language.

Tcl is not panacea, but it is a far better card up your sleeve than ...
(will not name names - you can fill this blank quite easily). In fact it
can only be compared to Perl.

After version 8.0, Tcl has a bytecode compiler/interpreter - really hard
to do when the text interpreter behavior must be preserved. If the
bytecode can be maped to the Java VM, then with the advent of hardware
Java VM processors Tcl will become a JIT - hilarious.


Smiljan Grmek
smi@4mate.hr


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

Date: 8 Apr 1997 10:48:15 -0500
From: seebs@solutions.solon.com (Peter Seebach)
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <5idpbv$kdf@solutions.solon.com>

In article <01bc43a7$0c0cdbe0$87ee6fce@timpent.a-sis.com>,
Tim Behrendsen <tim@a-sis.com> wrote:
>Everyone gets performance reviews, whether they are from bosses,
>customers, or yourself.

This is a good point... I will state my preference for getting performance
reviews from people competent to comprehend my performance, but hey... can't
have everything.

>Good programmers program for 1) Fun, and 2) Money, and the latter
>inevitably produces better quality over the long haul (obviously
>there can be momentary "blips" here and there).

This is an assertion you have made frequently, but it contradicts the best
information we have about himan motivation.

In fact, while most people would rather get ten dollars of cash than a ten
dollar discount, if you build an employee incentive scheme which gives
out vacations, discounts, and other things, it produces more of an improvement
in output than a cash incentive scheme worth the same amount of money per
accomplishment.

(Someone just did some fairly heavy research on this...)

Why?  Dunno.  It seems to have to do with the difference between analytic
evaluation and warm fuzzies.

For $N, I'll do $N worth of work.  Beyond that, I may start feeling that the
company ought to hire more programmers if they need so much work done.  I
won't stay very late for money, and I tend to assume that the $n/hour rate
implies that that's all my time is worth.  Since I can typically earn $3n/hour
on the side, this means I *analyze* the value or cost of the work.

When a coworker thanks me for getting something ready, I am *happy*.  I will
stay later to get things done for a coworker I like than I will for overtime
pay.

Important clue:  People are not entirely rational.  The thing that killed
behaviorism is that we have more internal and intangible motivations than we
do external or tangible ones.

This is why large companies can produce solid products, but almost never
*brilliant* products.  Look at where the brilliance and innovation comes in...
It's small companies with visionaries.  Visionaries don't do well in large
companies *even when they run them*, because the company shackles them too
much in our current design.  Even then, when they *do* make a brilliant
product, it's because they were interested in it, not because of the money.

>BTW, no offense, but *why* do people post PGP signatures?  Is it just
>me, or is it completely ridiculous?

Well, think about it.

If Scott Nudds used PGP signatures, we'd be able to *prove* that this is just
some idiot trying to damage his good name.

-s
-- 
Copyright 1997 Peter Seebach - seebs at solon.com - C/Unix Wizard
I am not actually gladys@nancynet.com but junk mail is accepted there.
The *other* C FAQ, the hacker FAQ, et al.  http://www.solon.com/~seebs
Unsolicited email (junk mail and ads) is unwelcome, and will be billed for.


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

Date: 8 Apr 1997 17:09:54 GMT
From: asched1@medtronic.COM (Dan Ascheman)
Subject: using gmake to make Alpha makefile
Message-Id: <5idu52$pu4$1@gazette.corp.medtronic.com>

Using perl5.00393 and Alpha compiler a-3, I get the follwoing error while
using gmake to make the makefile created from makefile.pl.

SYS0003:  The system cannot find the path specified.
gmake: *** [blib/arch/auto/B/BOC.dll]


My question is - Where do I obtain this BOC.dll from - why is it looking
for it?  I thought it just needed a Bootstrap for B ().  i.e. I thought
I just needed an object of B in order to run perl -Iblib/arch -MO=c test.pl

Any help is appreciated,
dan

--
Dan Ascheman
@medtronic.com
instruments  phone: x4880  Mail Stop: T426


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

Date: Tue, 08 Apr 97 17:11:34 GMT
From: Dave Hodgkinson <daveh@dhcs.demon.co.uk>
Subject: Re: Wanted, a currency converter? Automatic file download?
Message-Id: <860519494snz@dhcs.demon.co.uk>

In article <E81wow.9n6@nonexistent.com> abigail@ny.fnx.com "Abigail" writes:

> Download every night? What if the rate changes in the morning? You 
> want to lose money? What you should do is hook up to a Reuters live
> feed, and replicate the rates around the world. ;)

Talking of which, has anyone had a stab at a Triarch (ssl) interface
to Perl? If not...

Dave



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

Date: Tue, 08 Apr 97 15:12:45 GMT
From: jeffl@plaza.ds.adp.com (Jeff Lawrence)
Subject: Win32 System() help
Message-Id: <5idn8c$c58@myst.plaza.ds.adp.com>

I have read the FAQ and couldn't find anything to answer
or address my specific problem.

I am trying to use the System() function to execute:

net use v:  \\server\share

by doing:

$status=system('net use v: \\server\share');

I realize the backquotes are probably giving me the
problem.  How do I escape them or make this statement
do what I want?

Please send via email as well as posting to:

jeffl@plaza.ds.adp.com

TIA


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

Date: 8 Apr 1997 17:07:38 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Win95 opendir()
Message-Id: <5idu0q$mc@news-central.tiac.net>

In article <5idh3g$s4q@fridge-nf0.shore.net>,
Nathan V. Patwardhan <nvp@shore.net> wrote:

>$varname = "C:\\text\\foo\\";
>
>How about:
>
>$varname = "C:\\nate\\eek\\";
>
>Doesn't it make you think of:
>
>$varname = "First line\nSecond line\nThird line\n";
>
>You should reconsider your implementation, because (with variables like the
>above) you've ended up using \t and \n!

This seems completely stupid and spurious - the sequence \\ allows you to
put a literal \ in a string and it's a legal character.  Perl doesn't
mysteriously check the string again whenever you use it so once the
sequence "...\\n..." has been interpolated into a string during compile
time (as long as the first \ isn't itself escaped) it won't be
accidentally re-interpolated to a newline character later.  \ and / both
work as path separators in MS-DOS.

I would agree that "C:\\nate\\eek\\" has the two characher sequences \n
and \e in it, but what's wrong with that?

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: 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 256
*************************************

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