[10056] in Perl-Users-Digest
Perl-Users Digest, Issue: 3649 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep  6 21:06:57 1998
Date: Sun, 6 Sep 98 18:00:19 -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           Sun, 6 Sep 1998     Volume: 8 Number: 3649
Today's topics:
        a better read()? <samwang@freewwweb.com>
    Re: a better read()? (Martien Verbruggen)
    Re: Beginner need help with sendmail-t <sugalskd@netserve.ous.edu>
        cgi question <samwang@freewwweb.com>
    Re: cgi question <samwang@freewwweb.com>
    Re: Error message.....Perl.exe did not produce a valid  (Martien Verbruggen)
    Re: History of Perl - round 1 <eashton@bbnplanet.com>
        I need Perl 5.004 for Windows 98 joshi@ee.tamu.edu
    Re: I need Perl 5.004 for Windows 98 <nguyend7@msu.edu>
        IO::File Permissions - Revisited <sneaker@sneex.fccj.org>
        matching -what the hell? bug? <arranp@datamail.co.nz>
    Re: matching -what the hell? bug? (Martien Verbruggen)
    Re: no form feed in format? (Martien Verbruggen)
    Re: Password checking? (Eric Weiss)
    Re: Perl & Java - differences and uses <bjohnsto_usa_net@dejanews.com>
    Re: Perl beautifier <tchrist@mox.perl.com>
    Re: Perl gurus opinion needed. <sneaker@sneex.fccj.org>
    Re: Perl gurus opinion needed. <jwb79@mail.idt.net>
    Re: Perl gurus opinion needed. <garry@america.net>
    Re: Perl gurus opinion needed. (Michael Wang)
    Re: Question regarding perl-script as suid <joreb@algonet.se>
    Re: Question regarding perl-script as suid <rra@stanford.edu>
    Re: Question regarding perl-script as suid <joreb@algonet.se>
        structures and references (Darwin O.V. Alonso)
    Re: structures and references (Sean McAfee)
    Re: writing/retrieving complex data structures (Martien Verbruggen)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 06 Sep 1998 18:28:43 -0500
From: Sam Wang <samwang@freewwweb.com>
Subject: a better read()?
Message-Id: <35F31AAB.EFEEC3B1@freewwweb.com>
i think it kinda sucks how you have to specify how big the buffer is for
read(). if you specify it too big, perl'll quit with an out of memory
error, too little and it might not be enough. is there a way around
this?
------------------------------
Date: Mon, 07 Sep 1998 00:48:08 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: a better read()?
Message-Id: <c3GI1.529$XR2.109546@nsw.nnrp.telstra.net>
In article <35F31AAB.EFEEC3B1@freewwweb.com>,
	Sam Wang <samwang@freewwweb.com> writes:
> i think it kinda sucks how you have to specify how big the buffer is for
> read(). if you specify it too big, perl'll quit with an out of memory
> error, too little and it might not be enough. is there a way around
> this?
Err...
# perldoc -f read
=item read FILEHANDLE,SCALAR,LENGTH,OFFSET
=item read FILEHANDLE,SCALAR,LENGTH
Attempts to read LENGTH bytes of data into variable SCALAR from the
specified FILEHANDLE.  Returns the number of bytes actually read, or
undef if there was an error.  SCALAR will be grown or shrunk to the
length actually read.  An OFFSET may be specified to place the read
data at some other place than the beginning of the string.  This call
is actually implemented in terms of stdio's fread call.  To get a true
read system call, see sysread().
How do you specify the size of the buffer? Where does it say that you
have to? This actually seems to imply that you don't have to set the
size. I certainly never have.
Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd.       | reflects this.
NSW, Australia                      | 
------------------------------
Date: 6 Sep 1998 21:10:43 GMT
From: Dan Sugalski <sugalskd@netserve.ous.edu>
Subject: Re: Beginner need help with sendmail-t
Message-Id: <6sutoj$i1j$1@news.NERO.NET>
Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at> wrote:
: Re: Beginner need help with sendmail-t, j
: <mocat@best.com> said:
: j> the -t extracts information from the header of the mail
: j> to send it to the correct recipient, cc's, subjects, and
: j> um i'm sure you can do attachments with it.  but i've
: j> never tried.
: Of course, "man sendmail" is the *correct* answer as you
: pointed out.
Not necessarily. It's only correct on Unix machines that have sendmail
installed (which the poster is unlikely to be on--if they were, why ask
in the first place?). It won't do you much good on systems that don't.
"Consult the Bat Book" is a more portable (though still useless) answer.
				Dan
------------------------------
Date: Sun, 06 Sep 1998 16:15:29 -0500
From: Sam Wang <samwang@freewwweb.com>
Subject: cgi question
Message-Id: <35F2FB70.507FFE5A@freewwweb.com>
anybody know how to access the header information that is given thru
POST?
------------------------------
Date: Sun, 06 Sep 1998 18:25:58 -0500
From: Sam Wang <samwang@freewwweb.com>
Subject: Re: cgi question
Message-Id: <35F31A06.83C2F60C@freewwweb.com>
never mind figured it out.
Sam Wang wrote:
> anybody know how to access the header information that is given thru
> POST?
>
------------------------------
Date: Sun, 06 Sep 1998 23:58:09 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Error message.....Perl.exe did not produce a valid header
Message-Id: <lkFI1.43$XR2.109546@nsw.nnrp.telstra.net>
In article <35F017A3.595BE499@fmr.com>,
	Art vanMeeteren <Art.vanMeeteren@fmr.com> writes:
Your HTML isn't valid, but that's not really important.
> #!/Perl/5.00502/bin/MSWin32-x86-object/perl
> ####################################################
> require("library2.pl");
> So when I run this in DOS... it works fine. But when I run it from the
> Netscape 3.51 server.... it spits out:
> 
> [04/Sep/1998:10:07:12] failure: for host 172.22.13.190 trying to GET
> /shell/Entrance.pl, cgi-parse-output reports: the CGI program
> C:\Perl\5.00502\bin\MSWin32-x86-object\Perl.exe did not produce a valid
> header (program terminated without a valid CGI header (check for core
> dump or other abnormal termination)
Very likely it can't find or read the library2.pl file. You cgi script
might not be executed in the same directory that the source is in.
There might be permission problems. There might be other problems.
Make sure the user that executes the CGI stuff can find and read the
library2.pl file. Check the file permissions, as well as the directory
permissions. Try adding a 
use lib '/path/to/directory/that/has/your/library/file';
in your code.
Many web servers change directory before executing your script, or a
copy of your script. That might be the cause. To find out if your web
server is one of those, check the documentation, or ask on a newsgroup
that talks about it.
Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | We are born naked, wet and hungry. Then
Commercial Dynamics Pty. Ltd.       | things get worse.
NSW, Australia                      | 
------------------------------
Date: Sun, 06 Sep 1998 19:16:58 GMT
From: "Elaine -HappyFunBall- Ashton" <eashton@bbnplanet.com>
Subject: Re: History of Perl - round 1
Message-Id: <KcBI1.8$qx3.716475@burlma1-snr1.gtei.net>
>Capitals, proper punctuation, spelling, and grammar makes text easier
>to read. But, if you want to limit your audience, don't bother with those.
catty, darling, catty. however, this has been an interesting sociological
experiment. indulge me a digression for a moment if you will. many years ago
i lurked as a girl on a bbs, the moment i piped up i got flamed. the next
day i signed up in the guise of a man, asked the same question, and it was
answered with all the usual geek politeness. indeed, the same thing has
happened years later in c.l.m.p. only in reverse. i lurked here and posted
occasionally as a guy, same style, never flamed. in one weeks time, as my
female self, i have been flamed no less than 3 times for my lack of
punctuation. now, i draw my own conclusions, you can draw yours.
bite me.
now, those of you still reading this thread, the topic is the history of
perl. we are serious about this and we would like the input of the community
at large.
e.
------------------------------
Date: Sun, 06 Sep 1998 21:43:13 GMT
From: joshi@ee.tamu.edu
Subject: I need Perl 5.004 for Windows 98
Message-Id: <6suvlh$mo8$1@nnrp1.dejanews.com>
Hi experts,  I want to try out CGI scripts in Perl and I think I have a Perl
5 interprter here on my Win 98 machine. WHere do I get the 5.004 version?
COuld you please point out the EXACT location/URL as it is hard to look
around if only a general URL is given. I dont think Perl 5 supports CGI.pm,
right?
Thanks
Sanjay
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum
------------------------------
Date: 6 Sep 1998 22:03:16 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: I need Perl 5.004 for Windows 98
Message-Id: <6sv0r4$6ol$1@msunews.cl.msu.edu>
joshi@ee.tamu.edu wrote:
: [snip] I think I have a Perl 5 interprter here on my Win 98 machine.
If you think you have the Perl interpreter on your system, use it.
: Where do I get the 5.004 version?
Try http://www.perl.com
: Could you please point out the EXACT location/URL as it is hard to look
: around if only a general URL is given.
Learn to surf the web, and read.
: I dont think Perl 5 supports CGI.pm, right?
Why wouldn't it.  It's part of the standard distribution.
: -----== Posted via Deja News, The Leader in Internet Discussion ==-----
: http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum
Deja News is nice tool for people who don't have access to a news
server, but most people you use it don't know how to use it
correctly.  Deja News lets you search previous posts, so you should
use it to find the answer to your question.  And don't say that there
are too many arcticles to go through.  You should learn how to make
better queries.
You should also read some of the posts or the FAQ for the newsgroups
to see what is kosher.
-dan
-- 
           Dan Nguyen            | There is only one happiness in
        nguyend7@msu.edu         |   life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 |                   -George Sand
------------------------------
Date: Sun, 06 Sep 1998 19:00:39 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: IO::File Permissions - Revisited
Message-Id: <35F31417.77103552@sneex.fccj.org>
Perl IO::File Bug?
I do this:
#!/usr/bin/perl -w
use strict;
use diagnostics;
use IO;
# Get the date in the format of 'Sun Sep  6 18:04:46 1998'
my $ltDate = localtime;
# Now get the Serialized Date, and string'em back together...
my ($seconds, $minutes, $hour, $monthDate, $month, 
$year, $weekDay, $yearDate, $daylightSavings) = localtime;
my $ltSerial =
"$seconds$minutes$hour$monthDate$month$year$weekDay$yearDate$daylightSavings";
my $file = "test.File";
my $fh = new IO::File $file, "a", "0600";
if (defined $fh) {
   print $fh "$ltSerial|$ltDate\n";
   undef $fh;
} else { print "Oops! $!"; }
autoflush STDOUT 1;
But the test.File is still created 0644.
What am I missing?
Any ideas,
-Sneex- 
__________________________________________________________________
Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
__________________________________________________________________
It is common sense to take a method and try it.  If it fails,
admit it frankly and try another.  But above all, try something.
                -- Franklin D. Roosevelt
------------------------------
Date: Mon, 07 Sep 1998 10:43:24 +1200
From: Arran Price <arranp@datamail.co.nz>
Subject: matching -what the hell? bug?
Message-Id: <35F3100C.E94@datamail.co.nz>
Hi all,
I've attached the code and the output because its just too weird for me
to explain without it (also so you can give it a go if you wish). Im
sorry its such a long post.
the WHAT THE HELL comment line shows where its going wrong.
short version of the story is im doing a check for the string "-DOTS"
but it wont work without having another
check in front which dosent actually do anything interesting.
perl -v
This is perl, version 5.004_01
I have read thru the FAQS my training course notes and the camel book.
#!/usr/local/bin/perl
#Arran Price 2/9/98
#Script changes values in migrated cobol programs to correct values
EBCIDIC to ASCII hex values in special cases
#Uses split and an array to do so
#uncomment the print commands for debugging 
#pass it the directory with the testfile in as the argument <-------
#transfer.txt is a comma delimited translation table
#This section puts it into an array so we can do some easy substituting
later
$COUNT=0;
open(VALUEFILE,"transfer.txt") || warn "had a problem opening the
transfer.txt file\n";
while (<VALUEFILE>)
{
   
   @myvalues=split(/\,/);
   #print"values =@values\n";
   $VALCOUNT=0;
   while ($VALCOUNT<16)
   {
      @tablelist[$COUNT]=@myvalues[$VALCOUNT];
      ++$COUNT;
      ++$VALCOUNT;
   }
}
open(TWENTYREP,">twenty.report");
open(TWENTYREP,">>twenty.report");
open(FIND,"find @ARGV[0] -name '*' -print|")||die;
while ($filename=<FIND>)
{
   chomp($filename);
   $INFILE=$filename;
   $OUTFILE="$filename.mod";
   open(FILEIN,"$INFILE");
   open(FILEOUT,">$OUTFILE");
   open(FILEOUT,">>$OUTFILE");
   while(<FILEIN>)
   {
      $SKIP=0;
      if (m/-FONT/g)
      {
         $SKIP=2;
      }
      if(m/X'..'/g && $SKIP !=2)
      {
            #WHAT THE HELL does this if have to be here for??? If its
removed it stops working
            #print;
            if (m/FROG/g)
            {
              
            }
            #print"\nin the main loops\n";
            #print;
            #print"checking for -DOTS\n";
            if (m/-DOTS/g)
            {
               #print"found -DOTS and doing substitution\n";
               s/X'CC'/X'93'/;
               s/X'9C'/X'92'/;
               s/X'AE'/X'91'/;
               s/X'8C'/X'90'/;
               print;
               $SKIP=1;
            }
            if ($SKIP==0)
            {
               $CHECKLINE=$_;
               $MYSTARTPOS=index($CHECKLINE,"'");
               $MYENDPOS=rindex($CHECKLINE,"'");
               $MYOFFSET=$MYENDPOS-$MYSTARTPOS+1;
               $MYNUMBER=substr($CHECKLINE,$MYSTARTPOS+1,$MYOFFSET-2);
               $MYNUMBER=hex($MYNUMBER);		
               $MYNUMBER=@tablelist[$MYNUMBER];
               $CHECKLINE=substr($CHECKLINE,$MYSTARTPOS,$MYOFFSET);
               s/$CHECKLINE/'$MYNUMBER'/;
               if ($MYNUMBER<20)
               {
                  print TWENTYREP "$filename has this entry: $_\n";
               }		
            }
      }
   print FILEOUT;
   }
#system(`mv $OUTFILE $filename`);
}
more testfile (before mangle)
           03  FIFTY-DOTS          PIC X(1) VALUE
X'CC'.                        
           03  TEN-DOTS            PIC X(1) VALUE
X'9C'.                        
           03  FIVE-DOTS           PIC X(1) VALUE
X'AE'.                        
           03  ONE-DOTS            PIC X(1) VALUE X'8C'.
           IF F01-NAME1(1:1) =
X'00'                                            
           INSPECT F01-NAME (1:1) REPLACING X'00' BY
X'F0'                                                                     
                X'37'                      DELIMITED BY
SIZE                    
                X'37'                      DELIMITED BY SIZE   
more testfile (without FROGS check)this is not what should happen
          03  FIFTY-DOTS          PIC X(1) VALUE
X'13'.                        
           03  TEN-DOTS            PIC X(1) VALUE
X'12'.                        
           03  FIVE-DOTS           PIC X(1) VALUE
X'11'.                        
           03  ONE-DOTS            PIC X(1) VALUE X'10'.
           IF F01-NAME1(1:1) =
X'00'                                            
           INSPECT F01-NAME (1:1) REPLACING
X'00'                                                                     
                X'D3'                      DELIMITED BY
SIZE                    
                X'D3'                      DELIMITED BY SIZE  
 
                 
more testfile(with FROGS check) this is what should happen
           03  FIFTY-DOTS          PIC X(1) VALUE
X'93'.                        
           03  TEN-DOTS            PIC X(1) VALUE
X'92'.                        
           03  FIVE-DOTS           PIC X(1) VALUE
X'91'.                        
           03  ONE-DOTS            PIC X(1) VALUE X'90'.
           IF F01-NAME1(1:1) =
X'00'                                            
           INSPECT F01-NAME (1:1) REPLACING
X'00'                                                                     
                X'D3'                      DELIMITED BY
SIZE                    
                X'D3'                      DELIMITED BY SIZE   
transfer.txt is as follows
00,20,20,20,20,20,20,20,20,20,20,FF,FE,FD,FC,FB,
FA,F9,F8,F7,F6,F5,F4,F3,F2,F1,F0,EF,EE,ED,EC,EB,
EA,E9,E8,E7,E6,E5,E4,E3,E2,E1,E0,DF,DE,DD,DC,DB,
DA,D9,D8,D7,D6,D5,D4,D3,D2,D1,D0,CF,CE,CD,CC,CB,
20,CA,C9,C8,C7,C6,C5,C4,C3,C2,60,2E,3C,28,2B,1B,
26,C1,C0,BF,BE,BD,BC,BB,BA,B9,21,24,2A,29,3B,1D,
2D,2F,B8,B7,B6,B5,B4,B3,B2,B1,5E,2C,25,5F,3E,3F,
B0,AF,AE,AD,AC,AB,19,18,AA,60,3A,23,40,27,3D,22,
1E,61,62,63,64,65,66,67,68,69,A9,1A,10,8A,8B,94,
1F,6A,6B,6C,6D,6E,6F,70,71,72,90,1C,12,8D,7C,93,
8C,7B,73,74,75,76,77,78,79,7A,91,7D,7E,5B,11,92,
80,81,82,83,84,85,86,87,88,89,A8,17,7F,5D,95,16,
1A,41,42,43,44,45,46,47,48,49,A7,A6,13,A5,14,A4,
1C,4A,4B,4C,4D,4E,4F,50,51,52,A3,A2,8F,8E,A1,A0,
5C,9F,53,54,55,56,57,58,59,5A,9E,9D,15,9C,9B,9A,
30,31,32,33,34,35,36,37,38,39,1B,99,98,97,96,20
Im also having problems changing more than one X'number' on one line.
any suggestions appreciated but its just bugging the hell out of me that
I cant understand why it needs the if (m/FROG/) statement
------------------------------
Date: Mon, 07 Sep 1998 00:43:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: matching -what the hell? bug?
Message-Id: <f%FI1.402$XR2.109546@nsw.nnrp.telstra.net>
In article <35F3100C.E94@datamail.co.nz>,
	Arran Price <arranp@datamail.co.nz> writes:
> $COUNT=0;
> open(VALUEFILE,"transfer.txt") || warn "had a problem opening the
> transfer.txt file\n";
This should probably die on failure, since the rest will not work
correctly if you ignore the error like this.
> while (<VALUEFILE>)
>       @tablelist[$COUNT]=@myvalues[$VALCOUNT];
Hmm. Is this really what you want?
> open(TWENTYREP,">twenty.report");
> open(TWENTYREP,">>twenty.report");
Why are you opening this file twice? Once clobbering it, and then
appending to it? And you're not even checking return values.
open(TWENTYREP, ">twenty.report") || 
	die "Couldn't open report for writing: $!"
> open(FIND,"find @ARGV[0] -name '*' -print|")||die;
You know perl has a module that does this for you, internally?
# perldoc File::Find
> while ($filename=<FIND>)
> {
>    chomp($filename);
>    $INFILE=$filename;
>    $OUTFILE="$filename.mod";
>    open(FILEIN,"$INFILE");
>    open(FILEOUT,">$OUTFILE");
>    open(FILEOUT,">>$OUTFILE");
Again: You should really check the return values of open. You should
also check to see whether $filename is a directory or a file.
>             #WHAT THE HELL does this if have to be here for??? If its
> removed it stops working
>             #print;
>             if (m/FROG/g)
>             {
>               
>             }
Read the perlop man page, the section on 'Regexp Quote-Like
Operators', the entry 'm/PATTERN/cgimosx', and the explanation of the
g modifier.
# perldoc perlop
[SNIP]
                 g   Match globally, i.e., find all occurrences.
[SNIP]
             In a scalar context, m//g iterates through the
             string, returning TRUE each time it matches, and
             FALSE when it eventually runs out of matches.  (In
             other words, it remembers where it left off last
             time and restarts the search at that point.
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd.       | selective about it's friends.
NSW, Australia                      | 
------------------------------
Date: Mon, 07 Sep 1998 00:16:25 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: no form feed in format?
Message-Id: <tBFI1.53$XR2.109546@nsw.nnrp.telstra.net>
In article <6splcl$ijs$1@news.ml.com>,
	"Thomas Wong" <twong@exchange.ml.com> writes:
> Hi,
> How can one avoid the form feed/page break when using a format statement?  I
> just want the $FORMAT_TOP_NAME ($^) variable appears once on the top of the
> page and the rest of the output should be written out continuously through
> the bottom of the page. Any help would be greatly appreciated.
Have a read of the perlform man page, especially the section on
'Format Variables'.
# perldoc perlform
> begin 666 Thomas Wong.vcf
> M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..E=O;F<[5&AO;6%S#0I&3CI4
It just keeps getting worse, hmm? People sending v-card crap, and now
even encoding it. Please, just don't do it. There is absolutely no
reason at all to send a 20 line encoded piece of oddness with a 5 line
message.
Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 
------------------------------
Date: Sun, 06 Sep 1998 18:50:27 GMT
From: eweiss@winchendon.com (Eric Weiss)
Subject: Re: Password checking?
Message-Id: <35f2d8fa.195060594@news.dgsys.com>
On Sun, 06 Sep 1998 10:02:04 -0400, Ketan Patel
<ketanp@NOSPAMxwebdesign.com> wrote:
>Anyone know how I would go about checking the password on a website? 
>For example, if given a URL, a login, and a password, how can I check if
>they are valid?  Can I use some module to attempt to retrieve the page
>at that URL using the given L/P (using http://login:pass@www.test.com)?
>
>Thanks
You have to have access to some database that connects the login name
and the password.  I've got lots of login names on different web sites
and different passwords.  Then it is a relatively simple matter to
retrieve the password, decrypt it, and make the comparison.
A lot depends on how secure you need to make your web site.
Eric
------------------------------
Date: 6 Sep 1998 23:17:17 GMT
From: "bjohnsto_usa_net" <bjohnsto_usa_net@dejanews.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <01bdd923$64cd49a0$4516b3d1@lhodgkiss>
Jim,
A number of people have replied to you with the differences between the
perl language and the Java Language.  This is somewhat interesting, but
another, in my view far more important aspect of the issue is the what is
the environment for the language.
On the web you have a web server, a web browser (client), and possibly a
database.
On the Web server.
On the web server you can execute a Perl script, or a Java Sevlet (There
are plenty of nonstandard solutions: if you use AOL server you could use a
TCL script and with Microsoft's IIS you could use an ASP page).
These scripts could do some processing like putting an order into a
database, then generate a page to show the results.
Perl is better than Java at manipulating text.
So Perl is mostly better for this job.
To help get around Java's weakness with Text Sun has introduced jhtml pages
which help somewhat.
Perl has much less need for help here.
On the Browser
On the web browser Java has a full built-in graphical environment in a
secure sand box.
Java's competition here is JavaScript, an unrelated language which fits
into the HTML environment rather than having its own GUI.
Perl is not wide spread enough amongst clients to be useful.
In the Database
Java is being added to the existing proprietary programming languages
available for storing logic to run inside databases.
Java's competitors include PL/SQL, TransactSQL and other proprietary
languages.
In the database Perl is again not supported here.
Perl elsewhere can generate SQL very well to run in the database, but
databases vendors have no plans to add perl procedures inside the database.
The question is not really the syntax related factors but the support
environment that makes the difference.
Brendan
Jim <-> wrote in article <35ed3a22.0@news.netcom.co.uk>...
> As a young(17) and budding internet page designer I have often been told
> "forget the rest, learn Java" when asking about programming for the net,
> this is also the message Internet magazines tend to give. However having
> recently been learning Perl(and loving it) I am curious as to the power
Java
> has over Perl, what the main uses are and the main differences are, will
> Perl eventually be replaced by Java?
> 
> If anybody has some helpful links I would be grateful.
> 
> Jim
> 
> 
> 
------------------------------
Date: 6 Sep 1998 21:02:04 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl beautifier
Message-Id: <6sut8c$gl8$1@csnews.cs.colorado.edu>
 [courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Andre' Doles <surf@trader.net> writes:
:Has anyone seen a program that can logically format perl source? 
I've seen many try.  None succeed with my code.  
:We have
:some programmers that start *everything* from the left hand side of the
:screen and work their way over. There is no structure (indentations etc.)
Then by all means fire them.  That kind of thing just isn't acceptable.
--tom
-- 
"All things are possible, but not all expedient."  (in life, UNIX, and perl) -me
------------------------------
Date: Sun, 06 Sep 1998 17:03:13 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: Perl gurus opinion needed.
Message-Id: <35F2F891.61F11B31@sneex.fccj.org>
Ronald J Kimball wrote:
> 
> Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:
> 
> > > What is _wrong_ with Perl guy? (Note my e-mail address :-)
> >
> > nothing...just lacks a certain je nais sais qois...besides...not _all_
> > of us are guys :) at least not the last time i checked....
> 
> Aren't you from the Midwest?  I grew up in the Midwest, and we used
> 'guys' to refer to males and females.  :-)
> 
> --
>  _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
> ( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
>     /                                  http://www.ziplink.net/~rjk/
>         "It's funny 'cause it's true ... and vice versa."
Especially yooos guyz from up nawth :]
-- 
__________________________________________________________________
Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
__________________________________________________________________
It is common sense to take a method and try it.  If it fails,
admit it frankly and try another.  But above all, try something.
                -- Franklin D. Roosevelt
------------------------------
Date: 6 Sep 1998 21:15:12 GMT
From: "Jim Babbington" <jwb79@mail.idt.net>
Subject: Re: Perl gurus opinion needed.
Message-Id: <01bdd9db$92066600$6488fdc7@dixon>
: > What is _wrong_ with Perl guy? (Note my e-mail address :-)
: 
: nothing...just lacks a certain je nais sais qois...besides...not _all_
: of us are guys :) at least not the last time i checked....
You've inspired my new sig:
perl -e "$_ = 'Guy';m/([G|g])(uy|al)/;print qq(Just another perl ${1}${2})" 
--
Jim
:-)
------------------------------
Date: Sun, 06 Sep 1998 22:20:23 GMT
From: Garry Williams <garry@america.net>
Subject: Re: Perl gurus opinion needed.
Message-Id: <35F30AEE.3D65A719@america.net>
Well, I get the idea, but my shell wants to have a whack at those
variables: 
$ perl -e "$_ = 'Guy';m/([G|g])(uy|al)/;print qq(Just another perl
${1}${2})"
Can't modify constant item in scalar assignment at -e line 1, near
"'Guy';"
Execution of -e aborted due to compilation errors.
If I switch the single quotes for double quotes and vice versa, my shell
leaves things alone: 
$ perl -e '$_ = "Guy";m/([G|g])(uy|al)/;print qq(Just another perl
${1}${2})'
Just another perl Guy$
:-)  
-Garry Williams
Jim Babbington wrote:
> 
> : > What is _wrong_ with Perl guy? (Note my e-mail address :-)
> :
> : nothing...just lacks a certain je nais sais qois...besides...not _all_
> : of us are guys :) at least not the last time i checked....
> 
> You've inspired my new sig:
> 
> perl -e "$_ = 'Guy';m/([G|g])(uy|al)/;print qq(Just another perl ${1}${2})"
> --
> Jim
> :-)
------------------------------
Date: 6 Sep 1998 23:18:30 GMT
From: mwang@tech.cicg.ml.com (Michael Wang)
Subject: Re: Perl gurus opinion needed.
Message-Id: <6sv586$45t$1@news.ml.com>
Jim Babbington <jwb79@_DELETE_ME_mail.idt.net> wrote:
>You've inspired my new sig:
>perl -e "$_ = 'Guy';m/([G|g])(uy|al)/;print qq(Just another perl ${1}${2})" 
I do not know why you want your new signature to be:
Can't modify constant item in scalar assignment at -e line 1, near "'Guy';"
Execution of -e aborted due to compilation errors.
-- 
unix programs: niftp (non-interactive recursive ftp), hide (hide command args), 
submit (replace nohup), etc from ftp://ftp.mindspring.com/users/mwang/unix-prog
Michael Wang, mwang@ml.com, Merrill Lynch, World Financial Center, 212-449-4414
------------------------------
Date: Sun, 6 Sep 1998 21:03:54 +0200
From: "Ekenberg" <joreb@algonet.se>
Subject: Re: Question regarding perl-script as suid
Message-Id: <6sumbu$ed$1@cubacola.tninet.se>
>Are you sure that the system on which you're running this script supports
>secure setuid scripts?
Well, I assumed so since the affore mentioned document at
http://www.w3.org/Security/Faq/wwwsf5.html#Q50   says:
"However, many Unix systems contain a hole that allows suid scripts to be
subverted. This hole affects only scripts, not compiled programs. On such
systems, an attempt to execute a Perl script with the suid bits set will
result in a nasty error message from Perl itself.
You have two options on such systems:
You can apply a patch to the kernel that disables the suid bits for scripts.
Perl will detect these bits nevertheless and do the suid function safely.
"...etc.
This led me to believe that either I will get a "nasty error message" or it
will work, since "Perl will detect these bits nevertheless and do the suid
function safely".
Am I wrong in assuming this?
It's a regular Linux 2.xx system.
Thanks again for helping me out!
/Johan Ekenberg
------------------------------
Date: 06 Sep 1998 12:13:58 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Question regarding perl-script as suid
Message-Id: <yllnnxawax.fsf@windlord.stanford.edu>
Ekenberg <joreb@algonet.se> writes:
> This led me to believe that either I will get a "nasty error message" or
> it will work, since "Perl will detect these bits nevertheless and do the
> suid function safely".  Am I wrong in assuming this?  It's a regular
> Linux 2.xx system.
It depends on how Perl was compiled on your system, but Linux definitely
does not have secure scripts.  Perl would have to be compiled with the
separate setuid Perl binary to do setuid script emulation, and it's
possible that your installation doesn't have that or that something is
preventing it from working.
If someone compiled Perl with setuid emulation support and then didn't
install the setuid Perl binary or removed its permissions, I'd expect to
get behavior similar to what you're describing.
-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Sun, 6 Sep 1998 22:08:54 +0200
From: "Ekenberg" <joreb@algonet.se>
Subject: Re: Question regarding perl-script as suid
Message-Id: <6suq4l$kbg$1@zingo.tninet.se>
>It depends on how Perl was compiled on your system, but Linux definitely
>does not have secure scripts.  Perl would have to be compiled with the
>separate setuid Perl binary to do setuid script emulation, and it's
>possible that your installation doesn't have that or that something is
>preventing it from working.
>
>If someone compiled Perl with setuid emulation support and then didn't
>install the setuid Perl binary or removed its permissions, I'd expect to
>get behavior similar to what you're describing.
>
Ah!
At this stage I'll have to talk to the system administrator.
I thank you infinitely for your help!
/Johan Ekenberg
------------------------------
Date: 6 Sep 1998 18:57:33 GMT
From: dalonso@u.washington.edu (Darwin O.V. Alonso)
Subject: structures and references
Message-Id: <6sulut$1cfa$1@nntp6.u.washington.edu>
RE: structures and refs.
I recall that this is covered pretty well in Programming Perl,
but a grad student took off with my copy ( really! :-) ).
I am using a structure of the following form: 
  $donor[$inum]{atom} = "H";
  $donor[$inum]{xcoord} = 10.2;
  $donor[$inum]{ycoord} = 11.2;
  $donor[$inum]{zcoord} = 12.2;
but I would like to reference xcoord, ycoord, and zcoord in a loop as coord[$i]
I've tried variations on the following without success:
   $donor[$inum]{coord[0]} = 10.2;
Does anyone have any suggestions about how to do this?
Is this where one should use an anonymous array reference?
Thanks,
Darwin
------------------------------
Date: Sun, 06 Sep 1998 19:44:22 GMT
From: mcafee@tempest.rs.itd.umich.edu (Sean McAfee)
Subject: Re: structures and references
Message-Id: <qCBI1.1225$F7.5717875@news.itd.umich.edu>
In article <6sulut$1cfa$1@nntp6.u.washington.edu>,
Darwin O.V. Alonso <dalonso@u.washington.edu> wrote:
>I am using a structure of the following form: 
>  $donor[$inum]{atom} = "H";
>  $donor[$inum]{xcoord} = 10.2;
>  $donor[$inum]{ycoord} = 11.2;
>  $donor[$inum]{zcoord} = 12.2;
>but I would like to reference xcoord, ycoord, and zcoord in a loop as coord[$i]
>I've tried variations on the following without success:
>   $donor[$inum]{coord[0]} = 10.2;
>Does anyone have any suggestions about how to do this?
To get the coordinates into an array, you could do this:
@coord = @{$donor[$inum]}{xcoord, ycoord, zcoord};
This would give you copies of the original coordinates; to be able to
manipulate the original coordinate values, you'd have to use references:
@coord = \( @{$donor[$inum]{xcoord, ycoord, zcoord} );
${$coord[0]} = 5;  # changes x-coordinate in original object
>Is this where one should use an anonymous array reference?
Almost certainly, yes.  Try this instead;
$donor[$inum]{atom} = "H";
$donor[$inum]{coords} = [ 10.2, 11.2, 12.2 ];
$donor[$inum]{coords}[1] = 0.0;
# or...
$coords = $donor[$inum]{coords};
$coords->[1] = 0.0;
-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu
------------------------------
Date: Mon, 07 Sep 1998 00:25:46 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: writing/retrieving complex data structures
Message-Id: <eKFI1.57$XR2.109546@nsw.nnrp.telstra.net>
In article <6srrqb$g9a$1@news.fsu.edu>,
	bismuti@dirac.scri.fsu.edu (Peter Bismuti) writes:
> My question is, is there an easy way of dumping this data structure
> to a file and then recovering it easily?  It used to be that in a FORTRAN77 
> extension you could simple say:
use Data::Dumper
# perldoc Data::Dumper
Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd.       | clothes.
NSW, Australia                      | 
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 
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 3649
**************************************