[6844] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 469 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 13 19:07:15 1997

Date: Tue, 13 May 97 16:00:33 -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, 13 May 1997     Volume: 8 Number: 469

Today's topics:
     Re: A Perl Question <info@tomworld.demon.nl>
     Re: Best Perl Book <santiago_alvarez@hotmail.com>
     Re: Databases under Linux, Unix ? <boei@trifox.com>
     Re: Definition of $<digit> in perlvar.pod (Ilya Zakharevich)
     Handy with perl?  Here's a one-liner challenge. <gordon@graphics.cornell.edu>
     Re: HP-UX 9.05 binaries buckinm@nfric.nesusa.com
     Re: I Need HELP in reseting @INC!!!!!!!!!!!! (A. Deckers)
     Re: index question <marclang@draz.cs.washington.edu>
     Re: Lists question (Mike Stok)
     Re: Memory Clearing (Abigail)
     Mime types for .cgi, .pl ?? <zonycat@flash.net>
     Re: New draft of scripting white paper lvirden@cas.org
     Re: Objects and Reference Count <rootbeer@teleport.com>
     Re: PERL script autoresponder problems...please take a  (Bob)
     Re: Private area using Perl/CGI <jkv@a.sol.no>
     Re: Randal Schwartz (Brian Lavender)
     Re: Randal Schwartz (A. Deckers)
     Re: Randal Schwartz (Tung-chiang Yang)
     Re: Randal Schwartz (Craig Berry)
     Re: Randal Schwartz (Craig Berry)
     Re: Reading past CTRL-Z in file (Ronald L. Parker)
     Re: speed up "STDOUT" ? <psrc@corp.airmedia.com>
     Re: Strange effect (Jahwan Kim)
     time conversion problem on HP-UX <epapec@epa.ericsson.se>
     Re: Undump Question... <marclang@draz.cs.washington.edu>
     unlink vs. system("rm...") <eglamkowski@mathematica-mpr.com>
     Re: unlink vs. system("rm...") (Matthew Cravit)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 11 May 1997 18:31:51 GMT
From: "Tom Nuss" <info@tomworld.demon.nl>
Subject: Re: A Perl Question
Message-Id: <01bc5e39$9c739aa0$0be09fc2@default>



Ali Ranjbar <ranjbar@cig.mot.com> schreef in artikel
<33721653.41C67EA6@cig.mot.com>...
> Hello there;
> 
> I am new to Perl. I am trying to search for parentheses in a string and
> then get read of them. Getting read of them should not be difficult.
> However; sounds like Perl is using () for memory in regular expressions.
> How do I do that. I tried:
> if ($summary=~ /\(/{ # where $summary has the string I am searching in.
> 
> I also tried:
> if ($summary=~ /(/{ # where $summary has the string I am searching in.
> 
> and
> if ($summary=~ /(|)/{ # where $summary has the string I am searching in.
> 
> Every time I get a syntax error.
> -- 
> Ali N. Ranjbar			Motorola CIG, IL75-3J5
> Phone:(847)435-9797		Fax:(847)632-5959     E_mail:ranjbar@cig.mot.com
> 
> I will not let anyone walk through my mind with their dirty feet.
> 							Mahatma Gandhi
> 


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

Date: 13 May 1997 10:58:16 GMT
From: "Santiago Alvarez Rojo" <santiago_alvarez@hotmail.com>
Subject: Re: Best Perl Book
Message-Id: <01bc5f8c$81b03440$7131a8c0@sg059pcs>

Learning Perl
Randal L. Schwartz

Programming Perl, 2nd Edition
Larry Wall
+------------------------------------------------------------------+
| Santiago Alvarez Rojo           santiago_alvarez@hotmail.com     |
|                                http://www.gambito.com/santiago   |
|        PGP key: http://gambito.com/santiago/pgp.txt              |
|   fingerprint = D2 BB 9F DD 48 84 9F 5B  80 41 50 D2 28 12 1C 59 |
+------------------------------------------------------------------+


Loay M. A. <loay@micron.net> escribis en artmculo
<33781502.24C3@micron.net>...
> I've heard about Perl and I am impressed so far.  Could someone
> please, recommend a good Perl book for me as a starting point.
> 
> 
> Thank you,,,
> mailto:loay@micron.net
> 


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

Date: Tue, 13 May 1997 08:23:37 -0700
From: Bob Eisner <boei@trifox.com>
To: konink@telebyte.nl
Subject: Re: Databases under Linux, Unix ?
Message-Id: <33788779.2C83@trifox.com>

T. de Konink wrote:
> 
> Hi,
> 
> I am making database-applications using Perl, in a very primitive way. I
> simply use text-files with field-delimeters, splitting&joining fields.
> Now it's the time for me to apply a more professional way to store my
> data, but I really do not know how to do it. I've got much experience in
> developping MSAccess databases, but I don't think I could handle these
> kinds of databases using Perl under Unix/Linux. Thats the reason I've
> got the next questions.
> 
> QUESTIONS
> 1) Is it possible to use MSAcces databases under Perl Unix/Linux, using
> a special module or driver ? When soo, what do I need for it.
> 2) What kind of databases should I use (Perl Unix/Linux) to get an good
> performance and have standard functions to read, modify, search, write
> and query records ? What do I need for it ?
> 3) Do you have any examples for me of database-usement under Perl/Linux
> ?
> 
> Thanks in advance,
> Thomas de Konink
> mailto:konink@telebyte.nl


You may want to take a look at ADABAS D Personal Edition from Software
AG.

It's avaiable on Linux and is supported by Trifox's VORTEXperl product.

Trifox has a product, VORTEXperl.  It talks to multiple RDBMS.
It uses Perl Sockets so there is no need to re-build the Perl
runtime.  Please see http://www.trifox.com for details.

The beta version of VORTEXperl is available on our FTP server:

 ftp://ftp.trifox.com/pub/products/perl/vtxperl.tar

Please see http://www.softwareag.com/adaform/adad.htm for details on
obtaining a FREE copy of ADABAS D Personal Edition for Linux

Regards,

Bob Eisner
408.369.2392



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

Date: 13 May 1997 21:35:31 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Definition of $<digit> in perlvar.pod
Message-Id: <5lamr3$3ih$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to John L. Allen
<allen@gateway.grumman.com>],
who wrote in article <5l9nmr$lth@gateway.grumman.com>:
> 	perl -e '$_="abcd"; /(?:(b)|(c))+/; print "$1:$2:$3:$4\n"'
> 	:c::
> 
> 	perl -e '$_="bcde"; /(?:(b)(c)|(d)(e))+/; print "$1:$2:$3:$4\n"'
> 	:c:d:e
> 
> One or both of these examples exhibit bugs.  I'm asking what the correct
> output should be and why.  In the name of consistency, the outputs should
> be either
> 
> 	:c::   and   ::d:e
> 
> or
> 
> 	b:c::  and   b:c:d:e
> 
> Now, which is it?

My current copy of perl prints the second variant, so it behaves as it
is documented.  Note that there are two bugs in the "mainstream" perl,
and only one is fixed in my copy.  Say,

 ./perl -e '$_="bcde"; /(?:([bd])(c)|(d)(e))+/; print "$1:$2:$3:$4\n"'
d:c:d:e

So "looking-ahead" bug is not corrected, but hidden by a different
modification of backreference setting (it is atomic now).

Ilya


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

Date: Tue, 13 May 1997 18:45:56 -0400
From: Gordon Kindlmann <gordon@graphics.cornell.edu>
Subject: Handy with perl?  Here's a one-liner challenge.
Message-Id: <3378EF24.7B75@graphics.cornell.edu>

hi,

As part of using gnu make, we're generating small dependency files
that need to be post-processed.  We chose perl to do this
post-processing.  We have (below) a four line perl program that does
the job.  Knowing that such programs are often writable as a single
line of code, we tried our hand at compactifying it further but got
nowhere.  We would appreciate any help in this matter.  Our faith
in the perl community hangs in the balance ;-)

#!/usr/local/bin/perl
($target, $dep) = split(/:/, join(' ', <STDIN>));
print $target, ": \\\n";
map { print $_." \\\n" } grep m%^([^/\\])|($ARGV[0])%, split(/[ ]+/,
$dep);
print "\n";

What it does: given a dependency rule written over a number of lines,
removes all the filenames after the colon except those which either 
don't start with a slash, or those which do start with the command
line argument to the program.

For instance, given some file called test.d:

------------
CHist.o: CHist.c pcgvCHist.h \
 /usr/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.05/2.7.2.1/include/stdio.h
\
 /usr/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.05/2.7.2.1/include/stdarg.h
\
 /usr/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.05/2.7.2.1/include/va-pa.h
\
 /usr/include/sys/stdsyms.h \
 /usr/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.05/2.7.2.1/include/stdlib.h
\
 /usr/include/pwd.h \
 /usr/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.05/2.7.2.1/include/errno.h
\
 /usr/include/sys/errno.h \
 /usr/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.05/2.7.2.1/include/string.h
\
 /usr/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.05/2.7.2.1/include/math.h \
 /usr/include/time.h /usr/include/sys/time.h \
 /afs/bingo/projects/viz/proj/pcgv/include/pcgvCCom.h \
 /usr/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.05/2.7.2.1/include/float.h
\
 /usr/include/sys/shm.h \

/usr/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.05/2.7.2.1/include/sys/types.h
\
 /usr/include/sys/ipc.h /afs/bingo/projects/viz/cvi/include/pcgvCVio.h \
 /afs/bingo/projects/viz/proj/pcgv/include/pcgvCImage.h \
 /usr/include/ctype.h
------------

the program invoked as

  mfilt.pl /afs/bingo/projects/ < test.d

produces:

------------
CHist.o: \
CHist.c \
pcgvCHist.h \
/afs/bingo/projects/viz/proj/pcgv/include/pcgvCCom.h \
/afs/bingo/projects/viz/cvi/include/pcgvCVio.h \
/afs/bingo/projects/viz/proj/pcgv/include/pcgvCImage.h \

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

where the "------------" are what I'm using to delimit the beginning
and ending of the files.  Note that many filenames may appear on each
line of the input file.

And, if I may be so picky, it sure would be neat if that last line
didn't not have a backslash, thereby eliminating the need for the
final blank line.

Thanks for any assistance,
Gordon


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

Date: Fri, 09 May 1997 15:33:17 -0600
From: buckinm@nfric.nesusa.com
Subject: Re: HP-UX 9.05 binaries
Message-Id: <863209595.29137@dejanews.com>

In article <33720DD8.2A69@dial.pipex.com>,
  Philip Lee <phil_lee@dial.pipex.com> wrote:
>
> I'm trying to set up a small intranet here to show the benefits to senior
> managers.  I've designed the pages but they do not interact with the
> user.  I don't know C and hence Perl appears to be the best bet for
> creating CGI scripts.  I've got the source code but it won't compile
> without *loads* of errors.  I've tried to find Perl binaries on the net
> without success.  There are some available but for HP-UX 10.x from the
> HP-UX Porting Centres.
>
> Does anybody know where I might obtain binaries for HP-UX 9.05 ?
>
> Thanks
>

Your errors could be because the C compiler HP normally ships isn't ansi
compatible.  Your best bet may be installing the GNU C compiler, or HP's
c89 compiler.  I get no errors whatsoever on HP-UX 9 on the machines I
have the ansi compiler.

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


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

Date: 13 May 1997 15:11:11 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: I Need HELP in reseting @INC!!!!!!!!!!!!
Message-Id: <slrn5nh14f.763.I-hate-cyber-promo@news.rediris.es>

In comp.lang.perl.misc,
	eserra@svmp01.hisd.harris.com wrote:
>Hi all,
>  Do you know how to reset @INC from its default value?

use lib '/some/path/to/lib';

Why didn't you read the FAQ and the documentation?

-- 
Perl information: <URL:http://www.perl.com/perl/>
    Perl archive: <URL:http://www.perl.com/CPAN/>
        Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<


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

Date: Mon, 12 May 1997 19:00:36 GMT
From: Marc Langheinrich <marclang@draz.cs.washington.edu>
Subject: Re: index question
Message-Id: <qyjpvuwsegb.fsf@draz.cs.washington.edu>

Allon Henig <ahenig@iil.intel.com> writes:

> Hi I bumped into a very paculier behavior of the index function
> 
> I have the following code:
> 
> $line = "Allon HENIG";
> $word_to_search = "henig"; # notice the lower case 
> $start = index ($line,/$word_to_search/i);
> print $start;
> 
> The out put is $start = 0 (?!?!?!?!?!?!?!)
> I would expect to get 6 or -1 but what the 0 is doing there and how
> can I over come this ?
> 
> 	Thanks,
> 			Allon
try

  $start = index (lc($line), $word_to_search);


Using a regular expression as the second argument to index is not
what it expects:

=item index STR,SUBSTR,POSITION

=item index STR,SUBSTR

Returns the position of the first occurrence of SUBSTR in STR at or after
POSITION.  If POSITION is omitted, starts searching from the beginning of
the string.  The return value is based at 0 (or whatever you've set the C<$[>
variable to--but don't do that).  If the substring is not found, returns
one less than the base, ordinarily -1.

marc
-- 
Marc Langheinrich                  Department of Computer Science & Engr.
office phone: (206) 543-5129       University of Washington, Box 352350, 
email: marclang@cs.washington.edu  Seattle, WA 98195-2350, USA
www: http://www.cs.washington.edu/homes/marclang/


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

Date: 13 May 1997 19:17:21 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Lists question
Message-Id: <5laeo1$kgv@news-central.tiac.net>

In article <EA2nEL.9MK@cee.hw.ac.uk>,
Triantafyllos Marakis <ceetm@cee.hw.ac.uk> wrote:

The FAQ has been revised & updated.  You can check out

 .../CPAN/doc/manual/html/pod/perlfaq4/How_can_I_tel_whether_an_aray_.html

on a CPAN site - http://www.perl.com/CPAN/ is one way to get to the FAQ.

Hope this helps,

Mike

>I am trying to write a function that will delete a number of words from
>a given string
>
>Is it possible to search for that word within the array like in Pascal
>  eg. if word IN array

  [...]

>  if ($string in $unwanted_words) #how can this be implemented?
>  {
>      
>     $return_string = $string;
>  }


-- 
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: Tue, 13 May 1997 18:05:05 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Memory Clearing
Message-Id: <EA4swH.6zs@nonexistent.com>

On 13 May 1997 07:59:33 GMT, Torsten Naumann wrote in comp.lang.perl.misc
URL: news:5l9715$sci$1@narses.hrz.tu-chemnitz.de:
++ In article <EA3FrI.2r6@nonexistent.com>,
++ 	abigail@fnx.com (Abigail) writes:
++ ...
++ 
++ > Related (?) question:
++ > 
++ > I have a couple of programs that use Sybase::DBlib to access a
++ > database. The entire database contains less than 20 Mb data.
++ > But if the program does many queries to the database, it will
++ > run out of memory. In about 100.000 queries it will use over
++ > 150 Mb of memory. I've no idea what is leaking the memory.
++ > All my variables are my()ed (running with -wT & use strict;),
++ > and the few global variables are assigned to only once.
++ > 
++ > Is this a known bug in Sybase::DBlib? 
++ > Are there methods to find out which module uses so such memory?
++ 
++ I think you are using hashs (a very great thing I know) but the
++ problem is that such data structures need more memory than a simple
++ array. I had the same problem. My perl script scaned a file of 250kb
++ an the used memory was over 9mb - oops ! So I changed to use arrays
++ instead of hashs an the used memory was only 5mb for the same
++ datafile (2.5mb of this are perl self and his modules).

Nope, I'm using arrays. And they are all my()ed, so they should go
out of scope as soon as I leave the subroutine. I'm not getting
more than 2k out of the Sybase server for each query (just a single
row/query) Yet, the memory usuage grows and grows. :(

Maybe I should experiment and retrieve all the tables at once,
and use Perl instead of SQL to select rows.



Abigail


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

Date: Sun, 11 May 1997 00:03:34 -0700
From: Zonycat <zonycat@flash.net>
Subject: Mime types for .cgi, .pl ??
Message-Id: <33756F46.32AA@flash.net>

I am having no luck trying to locall display my cgi scripts.  I have
installed PWS and it works for finding my htm file.  When it tries to
execute the cgi file, a window flashes and it appears to say something
about not finding something in the Temporary Internet directory.  Why on
earth it is trying to go there I have no idea.  I did get the "source "
of the cgi script to display if I associated the .cgi with a mime type
of 'text/htm'.  I know that is not right.

Here's is what I got...

Win95
PWS installed
CGI and Perl5 installed
Registry set as explained in the thread: 'Re: Perl step by step?'

++++++++++++++++  as stated here ++++++++++++
> click Start on the task bar | Run | regedit.exe | click the plus next to:

>HKEY_LOCAL_MACHINE
>System
>CurrentControlSet
>Services
>W3Svc
>Parameters
>
>click on the folder Script Map | right click in the right frame | New ->
>string value | enter the extension .pl | right click on the .pl just
>created | Modify | enter the path to the perl program. (on my machine;
C:\Perl\bin\Perl.exe  %s    .  Don't forget the " space " %s at the end
of
the path to your Perl.exe .  I only know this from some else's previous
reply.  It really helped me out.  Thanks whoever originally posted that
solution.
Again to be clear, my path to perl in the registry is:
C:\Perl\bin\Perl.exe  %s
even put CGI.pm in my 'home directory' (wwwroot).
have my cgi script and htm file in there too.
   (did this to get rid of any 'path problems'
++++++++++++++++++++++++++++++



Got rid of the #! in the cgi script.
Modified CGI.pm to have $OS=WINDOWS

What else could I be missing??

Oh yes, I am just trying to display some of the 'canned' html/cgi
examples, one call tryit.cgi.

Any ideas would be greatly appreciated from people trying to use a local
server to test cgi programs such as the Personal Web Server (PWS)

Thanks,

Dennis


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

Date: 12 May 1997 11:22:41 GMT
From: lvirden@cas.org
Subject: Re: New draft of scripting white paper
Message-Id: <5l6ui1$6ks$1@cas.org>


According to Cimarron Taylor  <cimarron@dis.org>:
:To me the main difference between Tcl bindings to domain-specific
:API libraries and a true domain-specific language is that the fundamental
:execution model of a Tcl binding cannot differ from the semantics forced
:on you by the Tcl interpreter whereas the execution model of a domain-specific 
:language can adopt the semantics most appropriate to the problem.

I'm not sure of the constraints you are putting on this statement. 

Can you provide specific examples of the types of things you believe one
cannot do in Tcl but which would be required to be able to be done to
be able to create domain specific APIs?  During the previous part of this
thread, I had thought of Expect for instance as an example of a domain specifc
API.  Obviously, there are some implications of your statement above which
eliminates Expect from being such a construct.  I'm curious to understand
the implication.
-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: Tue, 13 May 1997 13:43:01 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Daniel Walton <dan@okdirect.com>
Subject: Re: Objects and Reference Count
Message-Id: <Pine.GSO.3.96.970513133709.4466I-100000@kelly.teleport.com>

On Mon, 12 May 1997, Daniel Walton wrote:

> I have some code that has a particular object instance (lets call it
> Instance-A) which creates & owns another object instance (lets call that
> Instance-B).  Along the course of execution, Instance-B decides it needs
> to remove itself from Instance-A and then get garbage collected to free
> up the memory space. 

Okay, so Instance-B is going to muck with Instance-A, along the way
deleting itself. So far, so good, but (of course) Perl will take care of
the garbage collection for you. 

> So Instance-B calls a method of Instance-A which makes Instance-A
> remove the reference to Instance-B.  Now Instance-B has no reference
> to it except, I am assuming, the reference on the function call stack.

Why bother assuming that? :-)  I don't know what's on the stack, but I can
be sure of what's hanging around in variables. If B's function-in-progress
still has a $self (or $me, or whatever you call it), there's still at
least one living reference to Instance-B. When that variable goes out of
scope, then there would be no further reference to that instance, which
would be collected.

> Perl won't core dump on me or perform strangely if I do this will it? 

Oh, that's a whole other question. Perl often performs strangely. :-)  But
if it dumps core (or if it fails to reclaim the memory) submit a bug
report. Hope this helps! 

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Tue, 13 May 1997 21:28:54 GMT
From: xxbbell@voicenet.com (Bob)
Subject: Re: PERL script autoresponder problems...please take a look.
Message-Id: <5lamfp$1mn$1@news1.voicenet.com>

	I assume your mail program is something like "sendmail".  No
expect here, but I have gotten something similar working.  Try putting
an extra newline at the end and see if that makes any difference.

          - Bob
          xxbbell@voicenet.com
          remove x's to reply



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

Date: 13 May 1997 22:41:19 +0200
From: Jon Kvebaek <jkv@a.sol.no>
Subject: Re: Private area using Perl/CGI
Message-Id: <yqpo911jqf4g.fsf@hullet.a.sn.no>

Ketil Froyn <ketilf@ifi.uio.no> writes:

> Does anyone know how to make a section of web-pages that needs a
> password to access? If so, would you like to share your knowledge with
> me? :)

Not much to do with Perl though - comp.infosystems.www.misc would
probably be a good place to direct your posts (better anyway - this
groups is cluttered with more than plenty of off-topic posts). That
said, the htaccess mechanism could be a solution. Look at
http://www.he.net/info/htaccess/demo.html - or ask your local
webmaster for help.

-- 
Jon Kvebaek <jkv@a.sol.no>
In my CD-player now: No disc in player.


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

Date: Tue, 13 May 1997 20:34:31 GMT
From: brian@brie.com (Brian Lavender)
Subject: Re: Randal Schwartz
Message-Id: <3378cf59.7260388@nntp.netcruiser>

posted to comp.lang.perl.misc and cc-ed to author

I think Randal will probably charge you and justifiably so. Why don't
you post your code and then the rest of us can scrutinize it and find
the problem?

Brian

On Mon, 12 May 1997 16:28:57 GMT, ce940@torfree.net (Michael Lauzon)
wrote:

>This is a question for Randal Schwartz.

What about the rest of us?

>I have a chat script written in Perl, but everytime I try to run it...it 
>gives me parse errors; it's a web-based chatsite.  I would really 
>appreciate it if you would take a look at it, though I will need to email 
>it to you...and for that I will need your email address.  I would really 
>like to get my chatsite up and running, but I can't get the script to 
>work.  

Hmm, what are the parse errors and what is the code? 

>Michael
>

----------------
Brian Lavender
Napa, CA
Brie Business Directory - Napa Valley     http://www.brie.com/bbd 
(707) 226-8891

"Have you heard of the new improbability drive?"


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

Date: 13 May 1997 19:14:26 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: Randal Schwartz
Message-Id: <slrn5nhfci.hmn.I-hate-cyber-promo@news.rediris.es>

In comp.lang.perl.misc,
	mike@stok.co.uk wrote:
>In article <hf38l5.f53.ln@localhost>, Tad McClellan <tadmc@flash.net> wrote:
>>Michael Lauzon (ce940@torfree.net) wrote:
>>: This is a question for Randal Schwartz.
>>
>>Well, then you delivered it the wrong way.
>
>>Individual communications should use an individual communication medium
>>such as email.
>
>Maybe that's why he said
>
>>: appreciate it if you would take a look at it, though I will need to email 
>>: it to you...and for that I will need your email address.  I would really 

Maybe he should have use DejaNews and searched for ~a (randal & schwartz).

Alain



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

Date: Tue, 13 May 1997 20:50:58 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Randal Schwartz
Message-Id: <tcyangEA50Kz.ErE@netcom.com>

He wanted to put the label "Randal Inside" on his script :)

================================
Brian Lavender (brian@brie.com) wrote:
: posted to comp.lang.perl.misc and cc-ed to author

: I think Randal will probably charge you and justifiably so. Why don't
: you post your code and then the rest of us can scrutinize it and find
: the problem?

: Brian

--
Tung-chiang Yang                       tcyang@netcom.com

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.clever.net/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: 12 May 1997 18:46:27 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Randal Schwartz
Message-Id: <5l7oi3$mrn$2@marina.cinenet.net>

Michael Lauzon (ce940@torfree.net) wrote:
: This is a question for Randal Schwartz.
: 
: I have a chat script written in Perl, but everytime I try to run it...it 
: gives me parse errors; it's a web-based chatsite.  I would really 
: appreciate it if you would take a look at it, though I will need to email 
: it to you...and for that I will need your email address.  I would really 
: like to get my chatsite up and running, but I can't get the script to 
: work.  

"This is a question for Janet Reno.

"My local city council has passed a new zoning law, and I need to 
determine if building a spare bedroom onto the back of my house is 
allowed under the new rules."

Isomorphic requests, those two.  Why are you asking Randal (specifically) 
this question?

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 13 May 1997 22:50:38 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Randal Schwartz
Message-Id: <5lar7v$44t$1@marina.cinenet.net>

Mike Stok (mike@stok.co.uk) wrote:
: In article <hf38l5.f53.ln@localhost>, Tad McClellan <tadmc@flash.net> wrote:
: >Michael Lauzon (ce940@torfree.net) wrote:
: >: This is a question for Randal Schwartz.
: >Well, then you delivered it the wrong way.
: >Individual communications should use an individual communication medium
: >such as email.
: 
: Maybe that's why he said
: 
: >: appreciate it if you would take a look at it, though I will need to email 
: >: it to you...and for that I will need your email address.  I would really 

Wow...maybe so.  Of course, the inability to find an email address that is
so well publicized -- in the Llama and Camel books, through numerous
postings by Randal himself, and in other ways -- might be taken as fairly
good evidence that Perl programming is a bit out of one's league,
regardless of any help one might obtain from Randal or anyone else. 

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Tue, 13 May 1997 22:00:01 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: Reading past CTRL-Z in file
Message-Id: <3379e2de.32205578@10.0.2.33>

On Tue, 13 May 1997 11:55:15 -0700, Doug Lockhart <dlockhar@sfu.ca>
wrote:

>I am using Perl 5.003 Build 306 on Windows NT 4.0.
>The file I am trying to process contains text mixed with binary
>data and sometimes there is a CTRL-Z embedded in the binary data.  
>I am trying to extract the text part of the data but my script
>only reads the file up to the CTRL-Z.  I apologize if this is a
>dumb question but I am just a beginner at using Perl.
>

If I had to guess, what you need is binmode.  From `man perlfunc`:

binmode FILEHANDLE 
     Arranges for the file to be read or written in ``binary'' mode in
     operating systems that distinguish between binary and text
     files. Files that are not in binary mode have CR LF sequences
     translated to LF on input and LF translated to CR LF on
     output. Binmode has no effect under Unix; in DOS and similarly
     archaic systems, it may be imperative--otherwise your
     DOS-damaged C library may mangle your file. The key distinction
     between systems that need binmode and those that
     don't is their text file formats. Systems like Unix and Plan9
     that delimit lines with a single character, and that encode that
     character in C as '\n', do not need binmode . The rest need it.
     If FILEHANDLE is an expression, the value is taken as
     the name of the filehandle. 

I know this doesn't say anything about ctrl-Z, but my experiments seem
to show that it matters, too.  In your case, try making 

binmode STDIN;

the first line of your program.

--
Ron Parker
Software Engineer
Farm Works Software       Come see us at http://www.farmworks.com
For PGP public key see http://www.farmworks.com/Ron_Parker_PGP_key.txt


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

Date: Tue, 13 May 1997 13:23:28 -0400
From: Paul S R Chisholm <psrc@corp.airmedia.com>
To: kim Tan <kimtan@lucent.com>
Subject: Re: speed up "STDOUT" ?
Message-Id: <3378A390.62A6@corp.airmedia.com>

kim Tan wrote:
> $| = 1;
> foreach $line (`cprogram`) {
>         do something;
> }

> However, basically it is slow because it will have to wait for the
> cprogram to finish all the output before executing the foreach

Then try something like:

if (! open(CPROG, "cprogram |") {
    die "cannot read from cprogram: $?\n";
}
while (<CPROG>) {
    do something;
}

> the cprogram is being maintained by different group

You'd better ensure that cprogram doesn't buffer its output when writing
to a pipe. The simplest way to do this is to run:

$ cprogram

in one window and:

$ cprogram | cat

in another, and make sure they output at about the same rate. (For
example (I learned this the hard way just yesterday:-), Perl (and most
programs that use stdio) doesn't buffer output to ttys or sockets, but
does buffer output to files and pipes. I had one Perl script piped into
another; the first delayed output from 3:30 p.m. Sunday until 10:30 a.m.
Monday. (Luckily, that was new software in beta test.)

--Paul S. R. Chisholm, AirMedia, Inc.      (formerly Ex Machina)
mailto:psrc@corp.airmedia.com http://www.corp.airmedia.com/~psrc
  I'm not speaking for the company, I'm just speaking my mind


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

Date: 13 May 1997 22:11:10 GMT
From: jahwan@supernova.math.lsa.umich.edu (Jahwan Kim)
Subject: Re: Strange effect
Message-Id: <slrn5nhpnu.b6j.jahwan@supernova.math.lsa.umich.edu>

    It's bizzare.  I guess it has something to do with how perl implements
'if-else' block and 'my' variables.  But this should not happen...
----
#!/usr/bin/perl -w
# Example 1
use strict; print "Perl version: $]\n"; my $x = 0;
if (0) {
    my $x = 1;
} else {
    $x = 1; print '$x is defined and $x equals ',$x,"\n" if defined($x);
}

The above code reports:
$x is defined and $x equals 0
----
#!/usr/bin/perl -w
# Example 2
use strict; print "Perl version: $]\n"; my $x = 0;
if (0) {
    my $x = 1;
} else {
    print "\$x is undefined.\n" unless defined($x);
    $x = 1; print '$x is defined and $x equals ',$x,"\n" if defined($x);
}

On the other hand, the above code reports:
$x is undefined.
$x is defined and $x equals 1
----
#!/usr/bin/perl -w
# Example 3
use strict; print "Perl version: $]\n"; my $x = 0;
if (0) {
    print "no my this time!\n";
} else {
    print "\$x is undefined.\n" unless defined($x);
    $x = 1; print '$x is defined and $x equals ',$x,"\n" if defined($x);
}

This now reports:
$x is defined and $x equals 1
----

    Somehow, the presence of 'my $x' in the block following 'if', which
won't be executed, (well, to be exact, my takes effect at compile time,
doesn't it?) somehow affects 'else' block.  Note that in the second
example,  at the beginning of 'else' block, $x is not even defined!  (c.f.
the third example.)
    Can someone PLEASE explain what's going on?
    
Jahwan


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

Date: Tue, 13 May 1997 19:30:58 +1000
From: Peter Chan <epapec@epa.ericsson.se>
Subject: time conversion problem on HP-UX
Message-Id: <337834D2.41C67EA6@epa.ericsson.se>

Hello there,

I am having a problem with the local time <-> gmt time conversion from
running perl 5.003 on a HP system and I hope someone can help me out. 

I had a subroutine which converts the current time to its GMT 
equivalent. However, the resulted GMT time is always 2 hours less 
than what it supposed to be. I tried to converted the resulted GMT time
back to the local time and it is also 2 hours off. 

I am sure the subroutine works because it works on a Sun running 
Solaris 2. Also, I know the timezone and locale settings on the HP
is fine since a small C program I ran give me the right result.	

Has anyone come across this kind of problem ?

Please reply through email to epapec@epa.ericsson.se and I will send 
the results I got back to the newsgroup.

I am using perl 5.003 running on HP-UX 10.10.

Thanks

Peter 


-- 
Peter Chan 	(epapec@epa.ericsson.se)
Ericsson Australia
198 Bell Street
Preston Victoria 3072
Australia 
Tel: +61 3 9243-5458 	Fax: +61 3 9243-5258
=============================================


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

Date: Mon, 12 May 1997 19:05:25 GMT
From: Marc Langheinrich <marclang@draz.cs.washington.edu>
Subject: Re: Undump Question...
Message-Id: <qyjohagse8a.fsf@draz.cs.washington.edu>

Sarah Burcham <sarah@ecl.wustl.edu> writes:

> I'm trying to speed up some of my perl code by getting it into an
> executable binary and am looking for some advice if anybody can help.
> 
> First Question:  
> 
> As found in the perlrun docs, perl has a -u option which supposedly will
> dump core.  That's great -- where does it leave this core file?  I'm on a
> Solaris system and have looked in the current working directory, the root
> directory, /var/tmp, and /tmp.  I'd assume either the system's perl wasn't
> compiled correctly to begin with, or I'm just really overlooking
> something.  I tried doing a truss of the process I'd run with perl -u, but
> couldn't find any obvious references to where it might be leaving this
> core file. 
> 
> Second Question:
> 
> I found a FAQ that pointed out the undump that comes with TeX as a viable
> possibility once I have a core file.  The other suggestion was to build
> perl with the unexec() from GNU emacs.  Anybody tried either of these and
> if so which one worked?
> 
> // Sarah Elizabeth Burcham
> // Engineering Computer Laboratories
> // sarah@ecl.wustl.edu
> 
Have you looked at Malcom Beatties compiler for Perl?

>> The Perl Compiler 
>>
>> The Perl Compiler, (yes, Virginia, you can compile to C) by Malcolm
>> Beattie is available in alpha-3 release. This is still considered
>> experimental, but is definitely firming up. See also his first
>> announcement about it for details. Please read the relevant FAQs
>> about what it is and what it is not.

See

    http://www.perl.com/perl/info/software.html

marc
-- 
Marc Langheinrich                  Department of Computer Science & Engr.
office phone: (206) 543-5129       University of Washington, Box 352350, 
email: marclang@cs.washington.edu  Seattle, WA 98195-2350, USA
www: http://www.cs.washington.edu/homes/marclang/


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

Date: Tue, 13 May 1997 17:00:22 -0400
From: the count <eglamkowski@mathematica-mpr.com>
Subject: unlink vs. system("rm...")
Message-Id: <3378D666.2E46@mathematica-mpr.com>

if i create a file in a perl program (via open(FOO, ">foo.tmp"), and 
later in the same program want to delete that file, which would be
the preferred method of doing this:

unlink("foo.tmp"); or
system("rm -f foo.tmp");

or is there no meaningful difference? (since the file is created, used 
and deleted only by this one program)

-- 
Due to continuing problems with my hotmail account, any mail received
from eglamkowski@hotmail.com dated after 5/9/97 should be considered
fraudulent.  I am no longer using my hotmail account, and never will
again;  due to the fact that I have been unable to logon for several
days in a row, "Invalid login/password combination", I must assume my
account was hacked and the password changed.

-*-*->    Please do not send mail to, nor accept mail from    <-*-*-
-*-*->                 eglamkowski@hotmail.com                <-*-*-


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

Date: 13 May 1997 15:50:55 -0700
From: mcravit@best.com (Matthew Cravit)
Subject: Re: unlink vs. system("rm...")
Message-Id: <5lar8f$o8l$1@shell3.ba.best.com>

In article <3378D666.2E46@mathematica-mpr.com>,
the count  <eglamkowski@mathematica-mpr.com> wrote:
>if i create a file in a perl program (via open(FOO, ">foo.tmp"), and 
>later in the same program want to delete that file, which would be
>the preferred method of doing this:
>
>unlink("foo.tmp"); or
>system("rm -f foo.tmp");

The use of unlink() is preferred, for two reasons that I can think of:

1. If you use unlink, that part of your code is portable to systems 
   which do not have "rm".

2. system() spawns a shell; unlink doesn't. So, by using unlink() you
   save the overhead of spawning a shell.

/MC

-- 
--
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@taos.com (work)     | time you make it.


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

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

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