[7439] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1064 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 23 13:17:16 1997

Date: Tue, 23 Sep 97 10:00:26 -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, 23 Sep 1997     Volume: 8 Number: 1064

Today's topics:
     Re: ^Z and file input problem (Terry Michael Fletcher - PCD ~)
     Re: cgi data <rootbeer@teleport.com>
     Re: Client-server example in Perl5 on NT4 SP3? (Trudno zhit' v derevne bez nagana.)
     Re: comp.lang.perl doesn't exist (was: Re: Memory leak? <merlyn@stonehenge.com>
     Re: Exponential Calculation Problems <slone3@llnl.gov>
     File name changing under NT <Andrew@here.com>
     Re: File name changing under NT (Mike Stok)
     Re: Foolish Question About Saving Gifs (Jonathan Feinberg)
     Re: help for new man <rootbeer@teleport.com>
     Re: help for new man <kevinm@tiac.net>
     Re: help for new man (Jeremy D. Zawodny)
     help for user authentication <wangyj@sro.cig.mcel.mot.com>
     Is Perl Year2000 compliant? <gilles@tls-cats.sps.mot.com>
     Re: Is Perl Year2000 compliant? (Jeremy D. Zawodny)
     Re: Need help with pesky warning... (Ken Gaugler)
     pack question (Trudno zhit' v derevne bez nagana.)
     PERL courses in Atlanta?? <NOSPAMandreas.dieberger@acm.org>
     Re: PERL courses in Atlanta?? (Stewart Harrison)
     Re: Perl Database (Which is better) <sjn@pvv.ntnu.no>
     perl oracle <webadmin@prestel.net>
     Re: Perl to Java Compiler? (Jonathan Thornburg)
     Re: Perl to Java Compiler? (Eric Arnold)
     perl under win95 problem <felixng@china.com>
     Perl5.004 and Solaris 2.6 <jdishaw@aftac.gov>
     Re: Printing lines that remain after a search result (Tad McClellan)
     Re: regex matching HTML comments (Tad McClellan)
     Re: setsockopt (solving 'address already in use' error) (Trudno zhit' v derevne bez nagana.)
     Re: setsockopt (solving 'address already in use' error) <seay@absyss.fr>
     Re: Statistics for comp.lang.perl.misc (Jahwan Kim)
     Re: Statistics for comp.lang.perl.misc <usenet-tag@qz.little-neck.ny.us>
     Re: symbolic dereferencing of my() variables -- can it  <rootbeer@teleport.com>
     Re: UserName Info <jdishaw@aftac.gov>
     Re: Using Perl to access pages for Java applet (Trudno zhit' v derevne bez nagana.)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 23 Sep 1997 15:56:37 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: ^Z and file input problem
Message-Id: <608orl$m8a$1@news.fm.intel.com>

Andrew M. Langmead (aml@world.std.com) so eloquently and verbosely pontificated:
> tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~) writes:
> 
> > also, does binmode make a difference?  it
> >shouldnt since i dont think you would get chars above ASCII 127.
> 
> On NT, binmode() doesn't change the input or output operators handling
> of the high bit.  It performs the following functions:
> 
>    prevents the removal of "\r" characters in the input stream.
> 
>    prepends a "\r" to the output stream any place it finds a "\n"
> 
>    prevents the input operators from returning EOF when a control-Z is
>    encountered.

ahhhh.  thankyou.  that is *very* nice to know.  ill be needing that in
the future.  that also explains a few things that i had to make
(incorrect) assumptions for.

-- 
               "Give me ambiguity or give me something else."
 ______                       ______ _               _               
(_) |                        (_) |  | |             | |              
    | _   ,_    ,_              _|_ | |  _ _|_  __  | |     _   ,_   
  _ ||/  /  |  /  |  |   |     / | ||/  |/  |  /    |/ \   |/  /  |  
 (_/ |__/   |_/   |_/ \_/|/   (_/   |__/|__/|_/\___/|   |_/|__/   |_/
*+*+*+*+*+*+*+*+*+*+*+* /| *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+* 
                        \|    tfletche@pcocd2.intel.com
*+*+*+*+*+ Views expressed...not INTeL's...yadda yadda yadda.... *+*+*+*+*+*





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

Date: Tue, 23 Sep 1997 08:10:17 -0700
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: cgi data
Message-Id: <Pine.GSO.3.96.970923080548.1200L-100000@usertest.teleport.com>

On Mon, 22 Sep 1997, asmr wrote:

> From: asmr <asmr@antispam.edu>

Why do you put this into your headers and a different address into your
 .sig? If the other address is valid, the spammers will see it there, so
why not put it into the headers where it belongs? 

> Under normal circumstances I would take the time to learn how to do this
> myself, but unfortunately time constraints have forced me to get a
> project done as quickly as possible.  

If you want to get an answer as quickly as possible, use the docs and
FAQs. If you want to get one more slowly, post to Usenet. If you want to
get one even more slowly, don't put your address into the headers. :-)

> I'm creating a perl script that will allow users to access information,
> as long as the identification number entered is valid.  I have a list of
> the valid id numbers in a file, and the data is structured as follows:
> 
> 123456789
> 234567891
> 098765432
> 
> and so on for a list of aprox. 200 numbers.  I need to check the user
> input of their ID and see if it appears in the data file.  

So far, so good. I don't see any problem.

> If anyone could crank out the few lines of code I need it would save me
> a considerable amount of time. 

You've left out an important bit of information: How much are you willing
to pay? I and other programmers are glad to do your job for you, but we
like to get paid for it. :-)

But I couldn't charge you too much for telling you about the exists() 
function, documented in the perlfunc(1) manpage. Good luck with your
project! 

-- 
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: 23 Sep 1997 15:25:23 GMT
From: alex@kawo2.rwth-aachen.de (Trudno zhit' v derevne bez nagana.)
Subject: Re: Client-server example in Perl5 on NT4 SP3?
Message-Id: <608n13$pp8$4@news.rwth-aachen.de>

In article <34198D4D.4E7E6A8E@dcbc.com>, gilbert@dcbc.com says...
>I tried the (UNIX) example, and "fork" is not supported.  I'm trying to
>write a simple
>client piece to submit two lines to port 25.  The socket, bind,
>connect portions all worked.  However, without the fork, I can
>either do the read only or the write only but not both.  Any
>work-arounds?

Gilbert,

i think fork is not necessary for being able to read/write.
You probably should use select() for reading. It reports
you if there is something to read from connected sockets.
And then you could write to them.

/Alex

-- 
russkaya literatura v ------ http://www.simplex.ru/lit.html
internete http://www.friends-partners.org/~afarber/lit.html
java preferans ------------ http://www.simplex.ru/pref.html
besplatnye kommercheskie ob'yavleniya http://www.simplex.ru



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

Date: 23 Sep 1997 09:39:14 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: comp.lang.perl doesn't exist (was: Re: Memory leak?)
Message-Id: <8cyb4ogf2l.fsf@gadget.cscaper.com>

>>>>> "Tom" == Tom Phoenix <rootbeer@teleport.com> writes:

Tom> [...] Kibo doesn't read it anymore. [...]

ROFL!

That's definitely a vote for it not existing!

Thanks Tom!

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

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


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

Date: Tue, 23 Sep 1997 09:27:48 -0700
From: Dale Slone <slone3@llnl.gov>
Subject: Re: Exponential Calculation Problems
Message-Id: <3427EE03.41C6@llnl.gov>

Rod Moore wrote:
> 
> I am trying to figure out how to calculate a number with an exponent.
> 
> For example, in BASIC, printing 2^2 gives you 4, 5^2 = 25.  

Use **

5**2 = 25
5^2  = 7   <-- ^ is the XOR operator

Dale


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

Date: 23 Sep 1997 15:18:22 GMT
From: "Andrew" <Andrew@here.com>
Subject: File name changing under NT
Message-Id: <01bcc834$513e6730$7ddc78c1@electrichead>

Hi,

I am another of the 'new to Perl' people, and I have the following query - 

I am writing a program to convert from one file format to another.  The
perl program is invoked by another program, which just passes it the input
filename on the command line.

I want to take the input filename, strip off the extension, and then put a
new one on.  I've included my solution below.  It works, but I want to know
how I could have done it better.

Thanks,
Andrew


#! /usr/bin/perl
# Usage: generic.perl <input_file>
$input = $ARGV[0];
$output = $input;		# Get input filename from command line
while ($strip ne ".")		# Keep removing characters from the end of the
filename until
    {				# the file extension is gone
    $strip = chop($output);
    }
$output = ">" . $output . ".txt";


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

Date: 23 Sep 1997 15:52:18 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: File name changing under NT
Message-Id: <608oji$b25@news-central.tiac.net>

In article <01bcc834$513e6730$7ddc78c1@electrichead>,
Andrew <Andrew@here.com> wrote:
>Hi,
>
>I am another of the 'new to Perl' people, and I have the following query - 
>
>I am writing a program to convert from one file format to another.  The
>perl program is invoked by another program, which just passes it the input
>filename on the command line.
>
>I want to take the input filename, strip off the extension, and then put a
>new one on.  I've included my solution below.  It works, but I want to know
>how I could have done it better.
>

It depenmds  on how lazy you are :-)

There is a module, File::Basename which comes with perlith perl 5 which
lets you do stuff like this:

NAME
     Basename - parse file specifications

     fileparse - split a pathname into pieces

     basename - extract just the filename from a path

     dirname - extract just the directory from a path

SYNOPSIS
         use File::Basename;

         ($name,$path,$suffix) = fileparse($fullname,@suffixlist)
         fileparse_set_fstype($os_string);
         $basename = basename($fullname,@suffixlist);
         $dirname = dirname($fullname);

         ($name,$path,$suffix) = fileparse("lib/File/Basename.pm","\.pm");
         fileparse_set_fstype("VMS");
         $basename = basename("lib/File/Basename.pm",".pm");
         $dirname = dirname("lib/File/Basename.pm");

so you can say

  ($name, $path, $suffix) = fileparse ($input, '\..*');

or you can say something like

  ($output = $input) =~ s/(\.[^.]*)?$/.txt/;

which is a rough and regex to replace an extension with .txt or add .txt
(but be aware of what it does to things like . and .. :-)

As it's perl there's more than one way to do it, and some of the ways may
be more thorough than others (and some may have odd boundary cases which
may or may not matter.)   So whether any of the suggestions above are
"better" depends on your priorities and preferences.

Hope this helps,

Mike

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


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

Date: 23 Sep 1997 15:30:03 GMT
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Foolish Question About Saving Gifs
Message-Id: <608n9r$rjo$1@gte2.gte.net>

annerose@geocities.com said...
> So far, everything I've tried has resulted in a screenful of misc.
> characters accompanied by endless repetitions of the alert
> sound on my Mac.

It would help if you could be more precise in you description of
exactly what it is you've done that "result[s] in a screenful of
misc. characters."  Do you mean when you run a perl program in 
MacPerl?  Do you mean when you attempt to view the output of the
program using a graphics viewer?

Are you saving the GIF info to a file, or are you simply printing
it to STDOUT?  If you're saving it to a file, have you used the
binmode builtin to make sure that you're creating a binary file?

-- 
Jonathan Feinberg    jdf@pobox.com    Sunny Manhattan, NY


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

Date: Tue, 23 Sep 1997 08:05:18 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: David <mysun@mbox2.singnet.com.sg>
Subject: Re: help for new man
Message-Id: <Pine.GSO.3.96.970923080353.1200K-100000@usertest.teleport.com>

On 23 Sep 1997, David wrote:

> Subject: help for new man

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> Can't find string terminator "END_1" anywhere befor EOF as
> ScriptFileName,pl line 1.

When Perl gives the error message that it can't find the string
terminator of a here-document, almost always that means that you have
some (invisible) characters before or after the termination line, which
should contain nothing but that string and its trailing newline. Make
sure that there aren't any spaces, tabs, return characters, or anything
else before or after the tag. If you've moved the file from machine to
machine without converting line endings properly, that's likely to be
the problem. Hope this helps!

-- 
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 Sep 1997 12:23:09 -0400
From: "Kevin P. Micalizzi" <kevinm@tiac.net>
Subject: Re: help for new man
Message-Id: <608qan$c80@news-central.tiac.net>

 David-

You may want to just try removing the double quotes at the start:

>print <<END_1;

instead of
>print <<"END_1";


HTH

-kevin
Kevin P. Micalizzi
Web Master, Sybase, Inc.
Email: kevinmic@sybase.com/Tel: 508-287-1905


David wrote in article <01bcc7f8$0de8aae0$371c09a8@WeiXiao.income.com.sg>...

>Hi, all there,
>
>I am a new man in perl programming, I have a simple problem as follows:
>
>(ScriptFileName.pl)
>
>print <<"END_1";
>Content-type: text/html
>
><HTML>
> <HEAD>
> <TITLE>Hello World</TITLE>
> </HEAD>
> <BODY>
> H1>Greetings,World!<H1>
> </BODY>
></HTML>
>END_1
>
>When I execute this perl script (at dos command prompt, execute perl
>ScriptFileName,pl) a error message appears:
>
>Can't find string terminator "END_1" anywhere befor EOF as
>ScriptFileName,pl line 1.
>
>I use perl for win32 Build 310 under windows95.
>
>Any suggestion and comment will be approciated. Thanks
>




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

Date: Tue, 23 Sep 1997 16:46:54 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: help for new man
Message-Id: <3427f250.89972183@igate.hst.moc.com>

[cc'd automagically to original author]

On Tue, 23 Sep 1997 12:23:09 -0400, "Kevin P. Micalizzi"
<kevinm@tiac.net> wrote:

> David-
>
>You may want to just try removing the double quotes at the start:
>
>>print <<END_1;
>
>instead of
>>print <<"END_1";

Please see

  http://www.stonehenge.com/merlyn/UnixReview/col12.html

for an explanation as to why what you've suggested is no different
from the original problem.

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Tue, 23 Sep 1997 20:58:45 +0800
From: Mike Wang <wangyj@sro.cig.mcel.mot.com>
Subject: help for user authentication
Message-Id: <3427BD05.717BBFFB@sro.cig.mcel.mot.com>

First, I hope I hadn't posted this in a wrong place. If so, I am sorry. 

I need help in such a case:
I want to make the browser to pop user's authenticaton window when my
perl cgi program is called. Please don't tell me to use ".htaccess" or
some thing like that. I only want to know if there is any solution to do
the same within cgi program. 

Any hints will be highly appreciated. Please give me a email copy if you
reply it. 

Thanks a lot.


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

Date: Tue, 23 Sep 1997 16:41:09 +0200
From: "Fridiric GILLES" <gilles@tls-cats.sps.mot.com>
To: larry@wall.org
Subject: Is Perl Year2000 compliant?
Message-Id: <3427D504.BE7AE4DB@tls-cats.sps.mot.com>

Everybody heard about the Year2000 problem (this problem when the 2
digits-coded year passes from 99 to 00). We can ask a question :

               Are Perl and all its modules Year2000 compliant?

Does someone work on this problem?
What are the tests to prove the compliance?
If they are not compliant, when will the compliant version be released?

Regards,
Frederic GILLES (gilles@tls-cats.sps.mot.com)



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

Date: Tue, 23 Sep 1997 15:13:28 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Is Perl Year2000 compliant?
Message-Id: <3427dc15.84280999@igate.hst.moc.com>

[cc'd automagically to original author]

On Tue, 23 Sep 1997 16:41:09 +0200, "Fridiric GILLES"
<gilles@tls-cats.sps.mot.com> wrote:

>Everybody heard about the Year2000 problem (this problem when the 2
>digits-coded year passes from 99 to 00). We can ask a question :
>
>               Are Perl and all its modules Year2000 compliant?
>
>Does someone work on this problem?
>What are the tests to prove the compliance?
>If they are not compliant, when will the compliant version be released?

This is answered in the FAQ.

http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#Does_Perl_have_a_year_20_probl

Searching for '2000' would have produced:

---snip---
Does Perl have a year 2000 problem? 

Not unless you use Perl to create one. The date and time functions
supplied with perl (gmtime and localtime) supply adequate information
to determine the year well beyond 2000 (2038 is when trouble strikes).
The year returned by these functions when used in an array context is
the year minus 1900. For years between 1910 and 1999 this happens to
be a 2-digit decimal number. To avoid the year 2000 problem simply do
not treat the year as a 2-digit number. It isn't. 

When gmtime and localtime are used in a scalar context they return a
timestamp string that contains a fully-expanded year. For example,
$timestamp = gmtime sets $timestamp to ``Tue Nov 13 01:00:00 2001''.
There's no year 2000 problem here. 
---snip---

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Tue, 23 Sep 1997 15:02:10 GMT
From: keng@nospam.hybrid.com (Ken Gaugler)
Subject: Re: Need help with pesky warning...
Message-Id: <3428d9c6.88825711@dracula.hybrid.com>

Hmmm, I get
"Read on closed filehandle <FP1> at testprog.pl line 5."

What exactly are you trying to do?


On Tue, 23 Sep 1997 00:34:35 GMT, "David S. Patterson"
<david.s.patterson@boeing.com> wrote:

>#!/usr/local/bin/perl_5.003 -w
>
>open (FP1, "mydata.txt");
>
>while (<FP1>)
>{
>  chop;
>
>  m/^(\w+ +\w+) +(\w{10})(\w{10})?(\w{10})?/;
>
>  print "[$1] [$2] [$3] [$4]\n";
>}

---
To reply to this post, remove the 'nospam.' from my address.
Ken Gaugler  N6OSK  Systems Engineer, Hybrid Networks, Inc.
(personal: keng @wco.com  URL: http://www.wco.com/~keng)


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

Date: 23 Sep 1997 14:47:02 GMT
From: alex@kawo2.rwth-aachen.de (Trudno zhit' v derevne bez nagana.)
Subject: pack question
Message-Id: <608kp6$pp8$1@news.rwth-aachen.de>

Hi,

i am writing a Perl program which should send a Unicode string 
over socket to a Java program, but have a problem understanding
pack. What i'd like to do is to send following byte sequence:
6, 0, 'A', 0, 'B', 0, 'C'

(6 is the length of following byte sequence, the 0s are because of 
Unicode). It works fine, when i use: pack 'CxCxCxC', 6, 65, 66, 67;

But when i try a subroutine:

sub byte_seq 
{ 
    $length = length($_[0]); 		# length of 1st argument
    pack ('C' . ('xC' x $length)), (2 * $length), (split //, $_[0]);
}

i see, that the first byte is '6' and not 6. Why?

BTW can i use: print CLIENT byte_seq('ABC');
or should i:   print CLIENT &byte_seq('ABC');

Thanks a lot for your help!
/Alex

-- 
russkaya literatura v ------ http://www.simplex.ru/lit.html
internete http://www.friends-partners.org/~afarber/lit.html
java preferans ------------ http://www.simplex.ru/pref.html
besplatnye kommercheskie ob'yavleniya http://www.simplex.ru



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

Date: 23 Sep 1997 14:57:31 GMT
From: Andreas Dieberger <NOSPAMandreas.dieberger@acm.org>
Subject: PERL courses in Atlanta??
Message-Id: <608lcr$ho0@lendl.cc.emory.edu>

Hi.

Does anybody have an idea where it is possible to attend Perl classes in
Atlanta? Can be a continuing education type class, or whatever. 

Thanks,

Andreas


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

Date: 23 Sep 1997 15:31:32 GMT
From: stewarth@arches.uga.edu (Stewart Harrison)
Subject: Re: PERL courses in Atlanta??
Message-Id: <608nck$qmq$1@cronkite.cc.uga.edu>


UGA Continuing Ed Dept in Athens is holding one this fall.  I attended the
first offering of this class in the Summer and found it very helpful.  The
instructor is Greg Whitlock, a member the Work Station Support Group for
UGA's University Computing & Networking Services.  He is very knowledgable
on the subject, as well as a friend of mine so I may be partisaned.  The
URL for more info and an online sign-up for is
http://www.gactr.uga.edu/CEP/fall.html
Hope this helps.

Stewart Harrison

Andreas Dieberger (NOSPAMandreas.dieberger@acm.org) wrote:
: Hi.
: 
: Does anybody have an idea where it is possible to attend Perl classes in
: Atlanta? Can be a continuing education type class, or whatever. 
: 
: Thanks,
: 
: Andreas

-- 


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

Date: 23 Sep 1997 16:17:39 GMT
From: Salve J Nilsen <sjn@pvv.ntnu.no>
Subject: Re: Perl Database (Which is better)
Message-Id: <608q33$dl6$1@due.unit.no>

In comp.lang.perl.misc Howard Yen <howard.yen@mci2000.com> wrote:
> I need to develop a site that will have hundreds of thousands
> of users. Currently the site is done using Perl.

[deletia questionare]

I'm also working om a project where I'll need a decent DB system in
the background (and I'm quite new to this). Is there a
site/FAQ/whatever where I can look for "pros and cons" of different
database systems? (I didn't find any om news.answers :( )

And to get thread on-topic again: What perl DB-interfaces are stable?
fast? (for use in a 'dynamic web pages' service for instance)

I've had a look at MySQL, and liked what I saw - but how is it
compared to more 'professional' systems like Oracle, Sybase et. al.?

(my first impression of Oracle is that it's a huge and cumbersome
system 2:^)

Anyone? :)


-- Salve J Nilsen (with a somewhat unsatisfactory .sig)

-- 
#!/store/bin/perl
#@(#)RELEASE VERSION .sig V1.02 by Salve J. Nilsen - Hacker, Student, Magician
($_='$ZNVYGB+$FWA?$CII:$BET;')?y:;ZA-Y\:?+${':\nm-za-l.@\:\0:?print:'}.':'.$';


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

Date: Tue, 23 Sep 1997 17:35:18 +0100
From: webadmin <webadmin@prestel.net>
Subject: perl oracle
Message-Id: <3427EFC6.5520EDE9@prestel.net>

Hi

I am currentl yrunning mSQL as a db on unix with perl.

I need to stop this DB and move to oracle. Is it as straightforward as
mSQL and wher do I get the perl module.

Basically what do i need to set up perl to intergrate with oracle and
where do I get it from

Iqbal


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

Date: 23 Sep 1997 07:56:31 -0700
From: bkis@nanaimo.island.net (Jonathan Thornburg)
Subject: Re: Perl to Java Compiler?
Message-Id: <608lav$cih$1@nanaimo.island.net>
Keywords: Perl Java virtual machine portable source code hidden

In article <605mbl$9sv$2@mainsrv.main.nc.us>,
Scott McMahan <scott@lighthouse.softbase.com> wrote:
>The only case I can see where the Perl to Java compiler would be useful
>is if you wanted to distribute platform- independent code in non-source
>format. A lot of people apparently want this.

Yuk!


We should realise, though, that p2j would have one significant
benefit -- allowing Perl programs to run on platforms which have
Java installed but don't have Perl installed.  To the extent that
Java takes off, this might be a lot of platforms.

On the other
hand, there is the issue of all the regexp and other run-time
support Perl needs -- p2j's output would seem either to have to
include a statically linked copy of this (==> it would be *big*),
or to dynamically link to it (==> fails on platforms where the
support library isn't pre-installed).

One can try to fudge the run-time support library issue, eg by
auto-downloading the code, but that (a) fails for standalone platforms,
(b) is slow for platforms with slow network links, (c) poses some
tricky security risks, and (d) overall looks to be less than ideally
reliable.

It's not an easy problem: Perl is a much richer language than Java,
and p2j would have to somehow bridge that gap.

- Jonathan Thornburg <bkis@island.net> (personal E-mail)
  U of British Columbia / Physics Dept / <thornbur@theory.physics.ubc.ca>
  "Washing one's hands of the conflict between the powerful and the powerless
   means to side with the powerful, not to be neutral." - Freire / OXFAM


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

Date: 23 Sep 97 00:48:40 GMT
From: eric.arnold@sun.com (Eric Arnold)
Subject: Re: Perl to Java Compiler?
Message-Id: <ERIC.97Sep23004840@m-e-ir1.sun.com>


I wonder if it would be kosher to suggest to the Java folks to add a
Perl5 style regexp package into the Java core?  I have no idea whether
they would even be interested, but it brings up a general question:
what's the process for using Perl code fragments in commercial
products?  Is there one, or is it prohibited completely by the
copyright?

All the other Perl "core" functions could be mapped to existing Java
functions (i.e.  list, hash, strings, etc.), excluding all the system
level calls that might or might not be supportable in applets.  What
"other things" are you thinking of?

I'm also curious as to how "eval" would work (how could we live without
"eval"?).  Doesn't that imply that the compiler will also have to be
rewritten in Java?  Heck, why bother spitting out Java byte code, just
rewrite the whole thing in Java.  Since Java will soon have just in
time compiler and/or chip support everywhere (thus running as fast as 
C ;-), then the resulting Perl in Java will run only a little slower than
it does today (another semi- ;-).

The next partly related question I was wondering:  what would be the
percentage reduction of the perl executable if you were to strip out
all but the essentials (i.e. system dependent stuff)?

-Eric

  In article <Pine.GSO.3.96.970919160054.21537K-100000@julie.teleport.com>
	  Tom Phoenix <rootbeer@teleport.com> writes:
  >On Fri, 19 Sep 1997, Piet Barber wrote:
  >
  >> Tell me if I read this correctly:  I will be able to write a perl program
  >> (yes, I can do this :-) ).  Run it through a Larry Wall compiler, and then
  >> I've got a .class file which I could (in theory) use in an applet or a
  >> java application? 
  >
  >Yes, basically, this may happen someday. That is, Perl may compile to java
  >bytecode (which is not the same as java sourcecode). You could then get
  >Perl to "run" on the Java Virtual Machine. I put that word in quotes
  >because there are some serious performance issues WRT regular expressions
  >and other things, which will have to be much slower than they are in
  >"true" Perl. 
  >
  >But Larry Wall has said that the JVM is a platform to which Perl could be
  >ported.
  >
  >> Does this mean I won't have to learn that silly JAVA language that
  >> everybody's howling about?
  >
  >No. You never had to learn that language in the first place. :-)
  >
  >-- 
  >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: Wed, 24 Sep 1997 00:05:26 +0800
From: Felix Ng <felixng@china.com>
Subject: perl under win95 problem
Message-Id: <3427E8C5.D8486F99@china.com>

I had a script like this under Win95.

$x = `dir`;        # any other program had the same problem
print $x;

Everytime i run (perl my.pl) the program will seek my floppy drive first
before giving me the result.... why and how to solve ?

Many thanks
Felix



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

Date: Tue, 23 Sep 1997 12:07:14 -0400
From: James Dishaw <jdishaw@aftac.gov>
Subject: Perl5.004 and Solaris 2.6
Message-Id: <3427E932.31F5@aftac.gov>

I'm trying to get Perl5.004 to compile on a sparc machine running
Solaris 2.6. I'm using the GCC 2.7.2.3 compiler on that machine
(I don't want to install the SunSoft C compiler on that machine).
Anyway, I'm getting a nifty little error message:

make: Warning: Both `makefile' and `Makefile' exist
`sh  cflags libperl.a miniperlmain.o`  miniperlmain.c
          CCCMD =  gcc -DPERL_CORE -c -I/usr/local/include -O   
In file included from perl.h:223,
                 from miniperlmain.c:10:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2.3/include/sys/param.h:187:
warning: `NBBY' redefined
/usr/include/sys/select.h:45: warning: this is the location of the
previous definition
In file included from /usr/include/sys/stream.h:26,
                 from /usr/include/netinet/in.h:38,
                 from perl.h:361,
                 from miniperlmain.c:10:
/usr/include/sys/model.h:32: #error "No DATAMODEL_NATIVE specified"

The first error (NBBY redefined) is irrelevant, they both set it to 8.
The other one has me a bit puzzled. In Solaris < 2.6 there is no
sys/model.h and it is expecting the symbol _LP64 or _ILP32 to be
defined. The question is who is supposed to set the symbols? The
compiler - in which case the "bug" is in GCC; a previous header file -
in which case Sun is to blame; or in the Perl source. My guess, is
the compiler is supposed to set the symbol. 

Anyway, I set the symbol to _ILP32 (that seemed right for a Sparc5)
and tried again. and then I got this:

make: Warning: Both `makefile' and `Makefile' exist
`sh  cflags libperl.a miniperlmain.o`  miniperlmain.c
          CCCMD =  gcc -DPERL_CORE -c -I/usr/local/include -D_ILP32 -O   
In file included from perl.h:223,
                 from miniperlmain.c:10:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.7.2.3/include/sys/param.h:187:
warning: `NBBY' redefined
/usr/include/sys/select.h:45: warning: this is the location of the
previous definition
In file included from /usr/include/sys/stream.h:21,
                 from /usr/include/netinet/in.h:38,
                 from perl.h:361,
                 from miniperlmain.c:10:
/usr/include/sys/vnode.h:155: parse error before `u_offset_t'
/usr/include/sys/vnode.h:155: warning: no semicolon at end of struct or
union
/usr/include/sys/vnode.h:163: parse error before `}'
/usr/include/sys/vnode.h:163: warning: data definition has no type or
storage class
/usr/include/sys/vnode.h:271: parse error before `intptr_t'
/usr/include/sys/vnode.h:324: parse error before `u_offset_t'
In file included from perl.h:361,
                 from miniperlmain.c:10:
/usr/include/netinet/in.h:156: parse error before `uint32_t'
/usr/include/netinet/in.h:156: warning: no semicolon at end of struct or
union
/usr/include/netinet/in.h:156: warning: no semicolon at end of struct or
union
/usr/include/netinet/in.h:160: warning: data definition has no type or
storage class
/usr/include/netinet/in.h:167: parse error before `}'
/usr/include/netinet/in.h:226: field `sin_addr' has incomplete type
/usr/include/netinet/in.h:286: field `imr_multiaddr' has incomplete type
/usr/include/netinet/in.h:287: field `imr_interface' has incomplete type
*** Error code 1
make: Fatal error: Command failed for target `miniperlmain.o'

Now this is bizzare. Ok some of the data type names have changed
in Solaris 2.6, but I can't see anything wrong with sys/vnode.h.
Anyway, so retried it with _LP64 defined instead of _ILP32
and that did not work either (same error). I find it hard to believe
that Sun shipped Solaris 2.6 with a broken sys/vnode.h file, so 
I must be in error somewhere. Any suggestions? If anybody responds,
could you also send a CC to my e-mail. Thanks.

-jd


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

Date: Tue, 23 Sep 1997 09:57:21 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Printing lines that remain after a search result
Message-Id: <hcl806.l71.ln@localhost>

Bob Maillet (bobm@tiac.net) wrote:
: I am trying to get the remaining lines of a file to print after a search
: has been created..I have been able to create the search and find to
: print the string using :

: foreach $line (@file)
: {
:      $_ = $line;
:      if (/$rif/){
:           @ok = split(/ /, $line);
:           print "$ok[0] $ok[1] $ok[2]\n";
:      }
: }

: but am stumped on the rest..I was using the print to test this, but
: would actually like to print all the lines that remain in the file after
: the search request is completed.  Any suggestions or assistance would be
: appreciated.


Putting it in $line, only to then always copy it to $_ is wasted effort:

(UNTESTED)


$done=0;
foreach (@file)  # defaults to putting each element into $_
{
   if ($done) {
      print;
      next;
   }

   if (/$rif/){     # here you may want: /\b$rif\b/  or /\b\Q$rif\E\b/
     @ok = split(/ /);
     print "$ok[0] $ok[1] $ok[2]\n";
     $done = 1;
   }
}


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Tue, 23 Sep 1997 09:47:33 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: regex matching HTML comments
Message-Id: <5qk806.v61.ln@localhost>

Tom Grydeland (Tom.Grydeland@phys.uit.no) wrote:

: Yes, I'm perfectly aware that to do this in the general case, you'll
: need a proper HTML::Parser, but for simple cases when there are no
: +<!--;s in strings or other tags anywhere, this substitution should
: strip all legal comments from a scalar containing an entire HTML
: document:

: $html =~ s {
:   <!		# Start of SGML entity
    ^^                     ^^^^^^^^^^^

The SGML term for that char sequence is "Markup Declaration Open (MDO)".


:     (?:		# begin a new group (no whitespace before first comment)
:       --	# begin comment
: 	.*?	# comment text (as little as possible)
:       --	# end of comment
:       \s*?	# whitespace (as little as possible)
           ^
           ^
Greedy should be OK here...


:     )+		# as many comments as possible, at least one
:   >		# end of SGML entity
    ^
    ^

 ... and "Markup Declaration Close (MDC)"


: }{}gsx;		# Delete it all


: (It passes Randal's browserkiller test)

: Comments from the SGML wizards out there?


Looks pretty good to me...


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 23 Sep 1997 14:54:58 GMT
From: alex@kawo2.rwth-aachen.de (Trudno zhit' v derevne bez nagana.)
Subject: Re: setsockopt (solving 'address already in use' error)
Message-Id: <608l82$pp8$2@news.rwth-aachen.de>

In article <607s0l$nev@cascade.cs.ubc.ca>, cubranic@cs.ubc.ca says...
>setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))
>which finally seemed to work.
>
>place, and b) why did I have to pack the value in perl4 and was able to
>use plain scalar in perl5 (I wasn't able to find any mention in docs about
>this one)?

Oh yes, i would like to know it too.

And what is the difference between PF_INET and AF_INET,
they are all 2 at my Linux-PC. Why was PF_INET introduced?

Greetings
Alex

-- 
russkaya literatura v ------ http://www.simplex.ru/lit.html
internete http://www.friends-partners.org/~afarber/lit.html
java preferans ------------ http://www.simplex.ru/pref.html
besplatnye kommercheskie ob'yavleniya http://www.simplex.ru



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

Date: Tue, 23 Sep 1997 18:02:22 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: setsockopt (solving 'address already in use' error)
Message-Id: <3427E80E.17A6FBE3@absyss.fr>

Trudno zhit' v derevne bez nagana. wrote:
> 
> And what is the difference between PF_INET and AF_INET,
> they are all 2 at my Linux-PC. Why was PF_INET introduced?

PF_ stands for Protocol Family
AF_ stands for Address Family

They are defined in /usr/include/linux/socket.h if you want a bit more
info (but not too much).  I think the idea was to allow one type of
protocol using a different type of addressing, but since that doesn't
sound too useful, I'm not surprised it never became popular.

- doug


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

Date: 23 Sep 1997 15:32:58 GMT
From: jahwan@supernova.math.lsa.umich.edu (Jahwan Kim)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <slrn62fo99.ac8.jahwan@supernova.math.lsa.umich.edu>

On Mon, 22 Sep 1997 19:17:26 -0500, Tad McClellan <tadmc@flash.net> wrote:
> Michael A. Watson (fishrman@shell.wco.com) wrote:
> : You left out the total users that were told to read the FAQ or "get a good 
> : PERL book" instead of giving them useful help.
[snip]
> If you feel that such a statistic would be of wide interest to the
> Perl community, then you have an opportunity to contribute by 
> developing an automated algorithm for counting them. 
> 
> Maybe Greg will include it.

    Instead, what about including the number of questions which are either
FAQ and/or which can be easily answered by RTFM?  

    Sorry I can't think of an algorithm...
 
Jahwan


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

Date: 23 Sep 1997 16:29:34 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <eli$9709231226@qz.little-neck.ny.us>

Michael A. Watson <fishrman@shell.wco.com> wrote:
> You left out the total users that were told to read the FAQ or "get a good 
> PERL book" instead of giving them useful help.

He also left out the total number of people who has stopped posting
here out of frustration from seeing the same FAQs and inappropriate
posts appear every day.

People do not write FAQs to keep themselves busy.

Elijah
------
wondering where the comp.lang.perl.* reorg proposal has gone to


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

Date: Tue, 23 Sep 1997 08:00:19 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Rahul Dhesi <c.c.eiftj@78.usenet.us.com>
Subject: Re: symbolic dereferencing of my() variables -- can it be done?
Message-Id: <Pine.GSO.3.96.970923075321.1200J-100000@usertest.teleport.com>

On 22 Sep 1997, Rahul Dhesi wrote:

> I sometimes like to do something like this:
> 
>    use strict;
>    @::variables = qw( a b c x y z );

If this works, you must have used that variable somewhere before, since
you have 'strict' turned on. 

>    for (@::variables) {
>       no strict 'refs';
>       $$_ = &something($_);	# $a = &something('a') and so on
>    }

In other words, you're using a soft reference to access items in the
symbol table. 

> But I also want to be able to do the same thing with my() variables,

My variables aren't in symbol tables, so you can't use a soft reference to
get at them.

> I am forced to use eval instead: 
> 
>    use strict;
>    my @variables = qw( a b c x y z );
>    for (@variables) {
>       eval "\$$_ = &something('$_')";
>    }

How can you be sure that you're accessing my() variables there? :-) This
is just one of the many evils of eval and of not using 'strict'.

> This is ugly.  

Agreed!

> Is there a better way of doing this?

Rethink the way you're attacking the problem, and use (perhaps) a hash or
another technique instead. Every programming problem can be solved without
using eval STRING and without using soft references. Hope this helps!

-- 
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 Sep 1997 11:21:32 -0400
From: James Dishaw <jdishaw@aftac.gov>
Subject: Re: UserName Info
Message-Id: <3427DE7C.897@aftac.gov>

John Ratzan wrote:
> 
> Hello,
> 
> I am trying to access $ENV{'REMOTE_USER'}.
> 
> I am showing a blank variable.

The only way I've been able to get the REMOTE_USER variable set is
to set access protection on the pages so that user has to type in
a username/password.

-jd


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

Date: 23 Sep 1997 15:15:17 GMT
From: alex@kawo2.rwth-aachen.de (Trudno zhit' v derevne bez nagana.)
Subject: Re: Using Perl to access pages for Java applet
Message-Id: <608me5$pp8$3@news.rwth-aachen.de>

In article <01bcbfa3$c0537280$db0fdec2@irsoft.demon.co.uk>, >the grabpage 
script will be run, and the applet will read in the data that
>the script outputs. 

You could probably use lynx -d

/Alex

-- 
russkaya literatura v ------ http://www.simplex.ru/lit.html
internete http://www.friends-partners.org/~afarber/lit.html
java preferans ------------ http://www.simplex.ru/pref.html
besplatnye kommercheskie ob'yavleniya http://www.simplex.ru



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

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

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