[7463] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1088 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 27 08:18:15 1997

Date: Sat, 27 Sep 97 05:00:50 -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           Sat, 27 Sep 1997     Volume: 8 Number: 1088

Today's topics:
     Re: ??? TiffInfo or TiffHandle in PERL (Bart Lateur)
     Re: call from IMG tag <tlawallANTISPAM@concentric.net>
     CD width CPAN ? (Juan)
     Counter not Incrementing Past 254? <VikR@aol.com>
     Re: Counter not Incrementing Past 254? (Abigail)
     Directly Access to wtmp file <bruni@micso.it>
     Error in perl used for guestbook. (Thomas Larsson)
     Exec Unix command inPerl <ianoh@welleslian.com>
     Re: Help.Where do Perl users look for a job? <ptrainor@aura.title14.com>
     Re: How can I tell which modules are installed ? <bholzman@mail.earthlink.net>
     Re: How Does a Script Know If a Module is Installed? twod@not.valid
     Many CGI/PERL forms don't work with Lynx? (Patrick Kellum)
     Re: Nearest Neighbor routine (Abigail)
     Re: Newbie URL Redirection Question (Abigail)
     nombre de champs de donnies lpcote@iq.ca
     Re: Pause or delay in perl? (Mike Stok)
     Re: Pause or delay in perl? (Abigail)
     Re: perl lib version vs. executable <dankogai@dan.co.jp>
     Perl sockets (Davor Cubranic)
     Re: Perl to Java Compiler? (Bart Lateur)
     PerlShop Help! <lisab@eyeonworld.com>
     Re: printing variables... <r.goeggel@atos-group.de>
     Re: Regular expression (Tad McClellan)
     Repeated Execution of a Script (Burt Lewis)
     Re: Reverse Engineer Time strings <godfrey@hnashe.com>
     Sendmail Attach Document using Perl (Harold J. Fennell)
     sysread() question (Trudno zhit' v derevne bez nagana.)
     Re: Tab Delimiter character -- Unix to Mac <dankogai@dan.co.jp>
     Re: WHILE LOOP LOGIC <yash@teczar.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 27 Sep 1997 11:28:38 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: ??? TiffInfo or TiffHandle in PERL
Message-Id: <342fead6.11706275@news.tornado.be>

Tom Phoenix <rootbeer@teleport.com> wrote:

>On Fri, 26 Sep 1997, zizi zhao wrote:
>
>> Is there any PERL utility to get TiffInfo from an
>> image.tiff to return information of tiff images files

>Maybe you want a module like Image::Size, which you can find on CPAN.

Image::Size doesn' work with TIFF files.

However, I have written a little Perl script that extracts pixel size
and resolution in both directions. It's not very mature, but it works,
basically.

Is this what you're looking for, or do you need even more info? TIFF can
contain all sorts of fields...

	Bart.


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

Date: Fri, 26 Sep 1997 23:57:13 -0600
From: "T. LaWall" <tlawallANTISPAM@concentric.net>
Subject: Re: call from IMG tag
Message-Id: <342CA039.660@concentric.net>

Abigail wrote:
> 
> "I got not get this to work at all."
> 
> You think that's a valid question? He doesn't even tell us what he
> did! He doesn't tell us what he wants! He doesn't tell what errors
> he gets! He doesn't even tell us what server or OS he's using!
> He doesn't tell us *anything*.
> 
You're right, he didn't tell us anything, but did you begin posting to 
newsgroups with every detail of your problems?  I don't know his 
background, nor do I know yours, but last time I checked, the 
newsgroups were for anyone who needs an answer, not just the 
technical-upper-crust.

> ++ Correct me if I'm wrong, but isn't that the purpose of the "misc"
> ++ on the comp.lang.perl.misc?
> 
> No. As you can see, the group spells "comp.lang.perl.misc". See
> the 3 words in front of misc? FYI, it doesn't mean this group
> is about computers and language and perl and miscellanous all
> combined. No sir. It's about miscellanous perl topics.
> 
> HTTP servers are discussed in different groups.

Miscellaneous, adj. 1. Composed of various and DIVERSE things or
elements; mixed; 2. Possesing DIVERSE qualities or capabilities.

Regards,
Todd
-- 
  -------------------------------------------------
  T. LaWall
  To reply, remove ANTISPAM from my address
  -------------------------------------------------
  Where do I want to go today? 
  With Linux, Anywhere I want, TOLL FREE!
  -------------------------------------------------


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

Date: Sat, 27 Sep 1997 01:10:24 GMT
From: juan@tres.com (Juan)
Subject: CD width CPAN ?
Message-Id: <342c5cc0.16659959@noticias.ibernet.es>

Please, where can I purchase a CD width the CPAN?

Thanks.
Juan Palacio
juan@tres.com



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

Date: Fri, 26 Sep 1997 19:03:52 -0800
From: Vik Rubenfeld <VikR@aol.com>
Subject: Counter not Incrementing Past 254?
Message-Id: <342C7798.BC6C2712@aol.com>

My PERL script includes the following code:
    
    # open counter
    $counter = 0;
    if (-e $cntfilename)
    {
    	open(COUNTER,"+<$cntfilename") || die("Can't open file \"$cntfilename\" : $!\n");
    	read(COUNTER, $counter, 20);
    	truncate(COUNTER,0);
    	close COUNTER;
    }
    
    open(COUNTER,">>$cntfilename") || die("Can't open file \"$cntfilename\" : $!\n");
    
    print COUNTER ++$counter;
    close COUNTER;
    
When I run it, it works fine up until counter = 254. Then this happens:

      252
      253
      254 
      254    
      254255  <== notice that this is 254 & 255
      254256  <== and this is 254 & 256.. counter incrementing normally again
      254257
      
How can I fix this?

Thanks very much in advance to all for any info.

- Vik


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

Date: 27 Sep 1997 02:44:09 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Counter not Incrementing Past 254?
Message-Id: <slrn62osrq.235.abigail@betelgeuse.rel.fnx.com>

Vik Rubenfeld (VikR@aol.com) wrote on 1488 September 1993 in
<URL: news:342C7798.BC6C2712@aol.com>:
++ My PERL script includes the following code:
++     
++     # open counter
++     $counter = 0;
++     if (-e $cntfilename)
++     {
++     	open(COUNTER,"+<$cntfilename") || die("Can't open file \"$cntfilename\" : $!\n");
++     	read(COUNTER, $counter, 20);
++     	truncate(COUNTER,0);
++     	close COUNTER;
++     }
++     
++     open(COUNTER,">>$cntfilename") || die("Can't open file \"$cntfilename\" : $!\n");
++     
++     print COUNTER ++$counter;
++     close COUNTER;
++     
++ When I run it, it works fine up until counter = 254. Then this happens:
++ 
++       252
++       253
++       254 
++       254    
++       254255  <== notice that this is 254 & 255
++       254256  <== and this is 254 & 256.. counter incrementing normally again
++       254257
++       
++ How can I fix this?


By tossing it all out of the window, and do something else.

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

use strict;
use Carp;

use FileHandle;

my $file = "...";

if (-e $file) {
    my $fh = new FileHandle $file, "rw" or croak "Failed to open $file: $!";
    flock $fh, 2;
    chomp (my $number = $fh -> getline);
    $fh -> seek (0, 0);   # No need for truncate, unless you use roman numbers.
    $fh -> print (++ $number, "\n");
    $fh -> close;
}


Abigail



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

Date: Thu, 25 Sep 1997 14:42:38 +0200
From: Emiliano Bruni <bruni@micso.it>
Subject: Directly Access to wtmp file
Message-Id: <342A5C3E.C61C0AC0@micso.it>

Someone know if (and how) it's possible to access to wtmp Digital and
Linux file from a perl script without, obviously, using an external
shell program (like lastlog) and read loggind data in it.

Thanks for Every kind of info.

------------------------------------------------------------
+               Bruni Emiliano - nick "Emi_B"              +
------------------------------------------------------------
+Software developer          +Software developer           +
+             &              +              &              +
+          internet assistant+        network administrator+
+                            +                             +
+Istituto zoo----profilattico+ -- --     ____  ____   ____ +
+sperimentale ///"G.Caporale"+|  |  | | |     |      | S. |+
+dell'abruzzo/// e del molise+|     | | |      ----  | r. |+
+  64100    ----    TERAMO   +|     | | |____  ____| |_l._|+
+                            +                             +
+http://www.izs.it/~ebruni/  + http://www.micso.it/bruni   +
+e-mail: ebruni@izs.it       + e-mail: bruni@micso.it      +
+----------------------------------------------------------+


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

Date: Fri, 26 Sep 1997 17:56:22 GMT
From: thomas.larsson@vpress.se (Thomas Larsson)
Subject: Error in perl used for guestbook.
Message-Id: <342bf5ff.7790392@news.multi.se>

Hello

Does anyone know what the following error means?

"Can't call method "_" without a package or object reference at
gbook.pl at line 65"

This is the part is the program surrounding line 65, starting with
line 63.

for ($i=0;$i<=SIZE;$i++) {
        $_=$LINES[$i];
        if (/<!--begin-->/) {    <------- HERE's the line
		if ($entry_order eq '1') {
			print GUEST "<!--begin-->\n";
		}

If anyone knows what I could do to fix this I would be happy to have
an e-mail.

Thank,
	
		/Thomas


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

Date: Sat, 27 Sep 1997 02:22:50 -0400
From: "Ian OH" <ianoh@welleslian.com>
Subject: Exec Unix command inPerl
Message-Id: <60i8rr$e5c$1@client3.news.psi.net>

 Can anybody help me this two problem?

1. How to execute a unix command like:

$mv file1.txt  file2.txt

in perl?

2. Transfer a posted "form" data to an other server -->a user fill out some
data
to a perl program that will transfer the data again to an other server.

Get http://server/cgi-bin/transfer.pl?field1=data1&field2=data2
- transfer.pl will contain a command that will transfer
"field1=data&field2=data2"
to POST http://otherserver/cgi-bin/other.pl?field1=data1&field2=data2

Thankyou






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

Date: Fri, 26 Sep 1997 23:49:01 -0400
From: Pat Trainor <ptrainor@aura.title14.com>
Subject: Re: Help.Where do Perl users look for a job?
Message-Id: <Pine.LNX.3.95.970926234804.21856Q-100000@aura>

On 26 Sep 1997, Scott McMahan wrote:

> Date: 26 Sep 1997 12:36:43 GMT
> From: Scott McMahan <scott@lighthouse.softbase.com>
> Newsgroups: comp.lang.perl.misc
> Subject: Re: Help.Where do Perl users look for a job?
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	...same place as the programmers?

pat 	
:)
  	
#        ptrainor@aura.title14.com (PT46) ptrainor@bbnplanet.net
#  Perl, PHP/FI, *NIX, HTML, CGI, SQL, RDBMS, NT*, Security, Admin, ... 
# "I've got LOTS of experience doing practically nothing!" -Heffer Wolfe



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

Date: Sat, 27 Sep 1997 02:49:47 -0400
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: Steve Abatangle <sabat@us.oracle.com>
Subject: Re: How can I tell which modules are installed ?
Message-Id: <342CAC8B.B3B75317@mail.earthlink.net>

[posted & mailed]

Steve Abatangle wrote:
> 
> Tom Phoenix (rootbeer@teleport.com) wrote:
> 
> : > Is there an easy way to find exactly which module are already installed?
> :
> : Yes: Ask the sysadmin. :-)  But if the sysadmin won't let you run Perl,
> : IMHO you should install a new one. :-)
> 
> This is a bogus answer. What if -- as in my case -- you need a
> program to be aware of whether or not a module is installed?
> 

eval('use Foo');
if ($@ =~ /^Can't locate/) {
  # Foo not installed.
} elsif ($@) {
  die $@;
} else {
  # Foo installed & loaded.
}

> 
> : But it wouldn't be hard to write a program to run on a web server which
> : would report the names of installed modules. Is that the kind of server
> 
> It would? If you know of a way to find out what modules are installed,
> do tell. I've searched the FAQ and Camel book to no avail.
> 

I believe this has been discussed within the last week or two.  Did you
check Dejanews?  In any event, this should do the trick:

perl -e '$,="\n";print @INC' | xargs -n1 -i find {} -name "*.pm" -print

Hope this helps,

Benjamin Holzman

> --
> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>  sabat <sabat@oracle.com>  .
>    http://www.area51.org   .    " You have no right to despise
> purveyors of modern myth   .      the present. " -- Baudelaire


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

Date: 27 Sep 1997 04:05:40 GMT
From: twod@not.valid
Subject: Re: How Does a Script Know If a Module is Installed?
Message-Id: <60i0mk$fl7$1@vnetnews.value.net>

: If the user's system doesn't have DBI, and doesn't realize
: that you need it, I'd like to TELL him he needs it -- rather
: than just having the installer script just bug out.

print "Checking for DBI ... ";
eval { require DBI; };
print "not found\n" if ($@);
print "found\n" if (!$@);

IAP

--
In an attempt to reduce junk email I use an invalid 'From' address.
My correct email address can be determined by replacing 'not.valid' with 
'value.net'


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

Date: 27 Sep 1997 11:50:01 GMT
From: patrick@syix.com (Patrick Kellum)
Subject: Many CGI/PERL forms don't work with Lynx?
Message-Id: <60irt9$2hi$1@neko.syix.com>

I've noticed for a while that quite a few PERL scripts have trouble with
Forms and Lynx.  Most of the BBS scripts for example.  If I enter the info
into a form and submit it the script tells me I forgot something.  I don't
have this prob when using other browsers and many CGI programs do seem to
work (PowerForum for example, although it has its own bugs).  Has anyone
else had this prob?  Does anyone know of a fix?  I want to use a few
scripts (WebBBS mainly) on my pages but I want to make sure everybody can
access them.

[ please email a copy of any responses, my newsserver is not the best ]

Thanks,

Patrick
---

A Title For This Page  --  http://www.syix.com/patrick/
Bow Wow Wow Fan Page   --  http://www.syix.com/patrick/bowwowwow/

"Pity there are no Martians to witness the spectacle of a kind of 15-foot
 beach ball suddenly falling out of the sky and bouncing all about."

   - Description of the Mars Pathfinder landing on Mars.
     From a New York Times News Service story by John Noble Wilford


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

Date: 27 Sep 1997 01:46:08 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Nearest Neighbor routine
Message-Id: <slrn62opf1.235.abigail@betelgeuse.rel.fnx.com>

Joe Allen (joeallen@gizmo.usc.edu) wrote on 1487 September 1993 in
<URL: news:342C1C21.183CD1C0@gizmo.usc.edu>:
++ Hi, 
++ 
++ I use the following snippet to determine the euclidean distance
++ between a set of target vectors and a set of vectors output by a
++ neural net.  It opens a file of target vectors and a file of output
++ vectors and returns, for each output vector, the name of the target
++ vector that is closest to it in euclidean distance (the so called
++ nearest neighbor).
++ 
++ Its a pretty pedestrian approach and it takes a subjectively long time
++ when the files are large (2-300 elements per vector, 1000 line files).
++ Can anyone suggest a general solution that might be faster? Actually
++ any comments appreciated. The vectors are of arbitrary length, have a
++ name in the first column, and are made up of floats, e.g.:
++ 

++ [ Quadratic algorithm ]

The problem with your approach is an inefficient algorithm. You can
make small optimizations, but the nested loops will give you an
Omega (N^2 d) algorithm. What you need is a better algorithm.

I don't have any algorithm handy, but the following might give you
some leads:

Edelsbrunner [Ed 87, pp 329] writes:

  Exercise 13.9:  Let S be a set of n sites in E^d.
    (a) Prove that each site is a closest neighbor of at most
        six other sites of S, if d = 2, and show that this
        bound is tight.
    (b) Prove that each site is a closest neighbor of at most
        12 other sites of S, if d = 3, and show that this bound
        is tight.
    (c) Prove that each site is the closest neighbor of at most
        3^d - 1 other sites, for d >= 1.
    (d) Give an algorithm that determines the nearest neighbors
        for each site in S in a total time O (n log n).
        (Hint: use an algorithm that maintains a collection of
        non-overlapping hypercubes that contain the points, and
        for each hypercube b maintain the list of other hypercubes
        that possibly contain closest neighbors of points in b;
        in a general step, the algorithm splits the hypercube with
        largest measure to its smallest possible size; for the
        analysis of this approach use the packing result of (c)
        above and the fact that a tree with bounded rank has an
        overall charge of O (n log n) if each node is charged the
        number of leaves below it minus the largest number of
        leaves below any child.)

[(a) and (c) are ranked 3 points, (b) and (d) 4, just one step under
 "open" problem]

Edelsbrunner [Ed 87, pp 332] again:

  A proof of Exercise 13.9 (a) can be found in Day, Edelsbrunner (1984);
  they reduce the problem to finding so-called Hadwiger numbers of
  congruent discs. The results of Hadwiger numbers for congruent balls
  (see Schuette (1953)) and for general d-dimensional convex objects
  (see Groemer (1961)) imply solutions to Exercises 13.9 (b) and (c).
  An algorithm that finds the closest neighbors of each site in a
  given set of size n in time O (n log n) can be found in Vaidya (1986);
  this solves Exercise 13.9 (d). He exploits the results of Exercise 
  13.9 (c).


Be aware though that those guys consider the dimension a constant,
and they happily sweep a factor of 2^d under the carpet - if your
vectors are in E^300, that's an issue. However, the hint suggest
to me there is a polynomial in d disappearing in the constant, at
most likely it's linear in d.


References:

Day, W.H.E. and Edelsbrunner, H.: "Efficient algorithms for agglomerative
     hierarchical clustering methods". J Classification, Vol 1 (1984),
     pp 7 - 24.
Edelsbrunner, H.: "Algorithms in Combinatorial Geometry". In "EATCS
     Monographs on Theoretical Computer Science". Springer-Verlag
     (1987).
Groemer, H.: "Abschaetzungen fuer die Anzahl der konvexen Koerper, die
     einen konvexen Koerper beruehren". Monatsh. Math. Vol 65 (1961),
     pp 74 - 81.
Schuette, K.: "Das Problem der dreizehn Kugeln". Math. Ann. Vol 125.
     (1953), 325 - 334.
Vaidya, P.M.: "An optimal algorithm for the all-nearest-neighbors
     problem". In "Proc. 27th Ann. IEEE Sympos. Found. Comput. Sci.
     1986", pp 117 - 122.



Considering you post from an edu account, you probably have access
to a (hopefully well stocked) math/CS library. The symposium Vaidya
published in is an important one, no doubt the library has the pro-
ceedings. I wouldn't mind a copy of the article though....


I'm afraid it might be a bitch to implement in Perl. CPAN lacks
geometry/datastructure modules, so you'll need to work your way
up. You might want to look at C and use one of geometry packages.
Or perhaps you want Mathematica.


Abigail


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

Date: 27 Sep 1997 01:52:59 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Newbie URL Redirection Question
Message-Id: <slrn62oprt.235.abigail@betelgeuse.rel.fnx.com>

lmain@ti.com (lmain@ti.com) wrote on 1487 September 1993 in
<URL: news:342BFCCE.7CB6@ti.com>:
++ Greetings!!  I am brand new to Perl (2 days) and I am working on a CGI
++ for my company.  I am trying to find a way to send the user to a
++ particular site.  Unfortunately, my Perl 5 book and all my searching on
++ the web has left me clueless.  I don't want to spout html out, just send
++ them to another page (for now).

Well, if your perl book didn't tell you about the print function,
you better buy a new book. If you don't know what to print, your
boss might want you to trade in for someone who knows where to
research. Questions about the HTTP protocol don't belong in a 
perl groups. 


Abigail
-- 
Reading any of the HTTP RFCs, how hard could that be?


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

Date: Sat, 27 Sep 1997 03:52:33 GMT
From: lpcote@iq.ca
Subject: nombre de champs de donnies
Message-Id: <60i04c$a4$1@news1.tor.acc.ca>

Est-ce vrai qu'on ne peut pas mettre plus de 40 champs de donnies (ex.
formulaires) dans un site Perl ?

Louis-Pierre Ctti



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

Date: 27 Sep 1997 00:55:20 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Pause or delay in perl?
Message-Id: <60hlho$5rp@news-central.tiac.net>

In article <60hkmo$d76$1@bashir.ici.net>, Burt Lewis <burt@ici.net> wrote:

>I'm doing some processing in a while loop and at the end of the last 
>statement, I want to pause about 10 seconds then continue with the while 
>loop.

Would

  sleep 10;

help?

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: 27 Sep 1997 02:45:52 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Pause or delay in perl?
Message-Id: <slrn62osv2.235.abigail@betelgeuse.rel.fnx.com>

Burt Lewis (burt@ici.net) wrote on 1488 September 1993 in
<URL: news:60hkmo$d76$1@bashir.ici.net>:
++ Hi,
++ 
++ I'm doing some processing in a while loop and at the end of the last 
++ statement, I want to pause about 10 seconds then continue with the while 
++ loop.


perldoc -f sleep


Abigail


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

Date: Sat, 27 Sep 1997 16:20:40 +0900
From: Dan Kogai <dankogai@dan.co.jp>
To: "Anthony R. Whyte" <taurus@frontiernet.net>
Subject: Re: perl lib version vs. executable
Message-Id: <342CB3C7.5A27@dan.co.jp>

Anthony R. Whyte wrote:
> I  built the latest perl into  a local area on my system
> (-Dprefix=/home/me)
> When I invoke perl it says perl library version (5.001) does not match
> executable version (5.004). How does one make perl look in
> "/home/ME/lib"
> instead of /usr/local/lib for example.  I tried tweeking $PERL5LIB but
> that doesnt seem to do it.

  HOW do you invoke your script?  Did you say

#!/home/me/bin/perl

  instead of

#!/usr/local/bin/perl

  ?
 When in question, you can profile what's going w/ one-liner below;

/home/me/bin/perl -e 'print join("¥n", @INC), "¥n";'

  Use absolute path to explictly use YOUR perl.

Dan the Camel Abuser


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

Date: 26 Sep 1997 23:26:12 -0700
From: cubranic@cs.ubc.ca (Davor Cubranic)
Subject: Perl sockets
Message-Id: <60i8u4$nue@cascade.cs.ubc.ca>

I have a server program that accepts input from multiple clients via TCP
sockets. The thing is that clients remain connected until all clients have
contacted the server and server replied to all of them. To do that I have
something like:
while(...) {
    accept(NS, S); # S is the dummy socket
[...]
    push(@sockets, NS);
}

However, I get the following situation: first client connects fine, second
connects fine, but at that moment the first client's connection is dropped!
Why? Would anybody be so kind to give me a logical explanation why I can't
reuse the NS variable without automatically closing its file descriptor
if I save its contents in an array?

Thanks,

Davor Cubranic


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

Date: Sat, 27 Sep 1997 11:28:34 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Perl to Java Compiler?
Message-Id: <342de16b.9295342@news.tornado.be>

eric.arnold@sun.com (Eric Arnold) wrote:

>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?

AFAIK Perl borrowed it's regular expression engine from another package
("V8" or something)

>I'm also curious as to how "eval" would work (how could we live without
>"eval"?)

I prefer to live without eval. I at all I can avoid it, I will. That is
just how I feel about it. :-) 

	Bart.


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

Date: Sat, 27 Sep 1997 01:13:11 -0400
From: "Lisa Bruno" <lisab@eyeonworld.com>
Subject: PerlShop Help!
Message-Id: <60i50b$p0n$1@news.icanect.net>

 Hi-

Since I am by no means a Perl programmer, I was hoping someone here could
help. I am trying to implement Perlshop on a site now and have managed to
get the entire thing running with one exception:

If I do a search, when I click on the link for the search results, I get an
error because it seems to be reating the current directory twice (i.e.
www34/...../store/www34/store/page.html)

If anyone has had any experinece with this porgram and can offer any advice,
I would greatly appreciate it!

Thanks!







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

Date: 26 Sep 1997 15:43:54 GMT
From: Ronald Gvggel <r.goeggel@atos-group.de>
Subject: Re: printing variables...
Message-Id: <60gl7q$a0k$1@news.pop-stuttgart.de>

mick@io.com (Michele Beltrame) wrote:

> Hallo!
> 
> Suppose you've got a piece of code like:
> 
> 	print <<End_of_prt;
> 	<body background="$hpathbkg.jpg">
> 	End_of_prt
> 
> The variable to be substituted is $hpath, so that the final output whould be
> (supposing $hpath='/skm/'):
> 
> 	<body background="/skm/bkg.jpg">
> 

You may try something like

 	print <<End_of_prt;
 	<body background="${hpath}bkg.jpg">
 	End_of_prt

This will also work in 
 	print "<body background=¥"${hpath}bkg.jpg¥">¥n";

regards,
Ronald


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

Date: Fri, 26 Sep 1997 21:54:48 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Regular expression
Message-Id: <ohsh06.ss7.ln@localhost>

Patrick Timmins (ptimmins@netserv.unmc.edu) wrote:
: Sorry, that m in front should be an s .
: Pat

: Patrick Timmins wrote:

: > this will match any occurences of the format you stated (regardless of
: > what the actual ip # is) and replace it with whatever is in $newip :
: > 
: > m/http¥:¥/¥/[¥d.]+¥/test¥.html/$newip/;


Please help to eradicate the scourge of maintenance programmers,
commonly known as the "leaning toothpick syndrome" (you can search
for that term in the perlop man page if you care to). 

You can get identical results with this more readable rendition:

   s#http://[¥d.]+/test¥.html#$newip#;

The colon did not need escaping to begin with.

I'd throw a 'g' on the end of it too...


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


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

Date: 27 Sep 1997 11:05:30 GMT
From: burt@ici.net (Burt Lewis)
Subject: Repeated Execution of a Script
Message-Id: <60ip9q$5k$1@bashir.ici.net>

Hi,

I'm using SSI to run a script which dispaly a random - that works fine!

Problem:

After the banner is displayed 10 seconds, I want to re-run the script to grab 
another banner and replace it with what's on display.

Any ideas on this would be appreciated.

Also, I want to do this without refreshing the whole browser window.


Thanks!

Burt Lewis
www.eastonmass.com



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

Date: Sat, 27 Sep 1997 12:17:18 +0100
From: Godfrey Smith <godfrey@hnashe.com>
Subject: Re: Reverse Engineer Time strings
Message-Id: <342CEB3E.5C62@hnashe.com>

Godfrey Smith wrote:
> 
> I have to take a string and translate it into the
> numerical time format. (since the epoch)
> 
> platform NT4.0
> 
> the strings look like this:
> 
> 22/Sep/1997:12:23:26
> 
> if anyone  can supply a line of code
> I would be grateful
> Godfrey Smith
UPDATE
I spent three hours and finally came up with the maths to do this
mail me if you need it


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

Date: Sat, 27 Sep 97 02:42:13 GMT
From: harold@spectra.net (Harold J. Fennell)
Subject: Sendmail Attach Document using Perl
Message-Id: <60hrib$m4d$1@e3000.supernews.com>

I am trying to attach a file so that when receive te user already has it in a 
file on their end.  I have tried almost everything.  I tried using sendmail -B 
8BITMIME < filename.  

        I would like the message to have some text as a body along 
with the attached file.  The text would be about three lines they would see 
when they view the message.

        I am using BSDI version3 with sendmail v8 and perl 5.003.  Any help 
with this matter will be greatly appreciated.  Thanks in advanced.

Harold

-------------------------------------------------------------------------------------
-  Harold J. Fennell                  Phone: 607-693-3304        -
-  Advanced Research Labs      Fax: 607-693-4250            -
-  P.O. Box 56                         E-mail: harold@spectra.net-
-  Nineveh, NY 13813                                                       -
-  Internet Consultant                                                       -
-------------------------------------------------------------------------------------


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

Date: 27 Sep 1997 11:42:12 GMT
From: alex@kawo2.rwth-aachen.de (Trudno zhit' v derevne bez nagana.)
Subject: sysread() question
Message-Id: <60irek$lfk$1@news.rwth-aachen.de>

Hi,

can someone please explain me, what i am doing wrong?
I am trying to sysread a byte sequence from a TCP-socket.
The first byte contains the number of bytes to follow:

sub read_seq
{
    my $SOCKET = shift;				# socket handle
    my $seq;
						# first read 1 byte:
    my $bytes_read = sysread $SOCKET, $seq, 1; 	# line 43
    return 0 unless $bytes_read;		# error or EOF

    my $bytes_to_read = $seq;
    my $offset = 1;				# because 1st byte 
					# of $seq will hold length
    while ($bytes_to_read)
    {
        $bytes_read = sysread $SOCKET, $seq, $bytes_to_read, $offset;
        return 0 unless $bytes_read;		# error or EOF
        $bytes_to_read -= $bytes_read;
        $offset += $bytes_read;
    }
    return $seq;
}

But when i am trying to use this subroutine like:

my $client_address_packed = accept(CLIENT, SERVER) or die "accept: $!";
select CLIENT;
$| = 1;
 ...
$seq = read_seq(CLIENT);

i am receiving warning:
Use of uninitialized value at ./pref.pl line 43

Does it mean, my $SOCKET=shift; didnt work?  How am i then
supposed to use file/socket handles in Perl subroutines?

Thanks 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: Sat, 27 Sep 1997 16:15:04 +0900
From: Dan Kogai <dankogai@dan.co.jp>
To: Darren Hayes <darrenh@efn.org>
Subject: Re: Tab Delimiter character -- Unix to Mac
Message-Id: <342CB278.CD1@dan.co.jp>

Darren Hayes wrote:
> I have a script which takes info from an html form and writes to a
> database record....
> 
> $database_delimiter="¥^t";
# should be
  $database_delimiter="¥t";

  for a tab.  No carat required.

Dan the Camel Abuser


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

Date: Fri, 26 Sep 1997 21:49:02 -0400
From: Yash Khemani <yash@teczar.com>
To: Authorized User <matthew.kravitz@systecinc.com>
Subject: Re: WHILE LOOP LOGIC
Message-Id: <342C660E.38D8166A@teczar.com>

Authorized User wrote:
> 
> hola-
> i am writing a simple 'while loop' script.  i need to read in a string from
> an external file and take that array and split it into seperate variables.
> for example:
> 
> external file contains:
> line1   xxxxx   yyyyy
> line2   vvvvvvv ccccc

# define file name here, from cmd line arg, from getopts - your choice.
$filename = '/tmp/foo';

open (inf,$filename);
while (<inf>) {
    local (@ary = split /¥s+/,$_;
    if ($ary[0] =‾ /line/) {
	# do what you like here
    };
};


> my Perl script :
> 
> open(LISTFILE,<external_file_name>);
> while ($LISTVAR=<LISTFILE>) {
>         if ($LISTVAR=‾ /line/ ) {
>         ###HOW DO I INITIALIZE THE INDIVIDUAL VARIABLES
>         ###LIKE LINE1, xxxxx, and yyyyy ?
> ...
> 
> thanks for the help...
> 
> matthew kravitz


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

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

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