[9029] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2647 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 20 11:13:44 1998

Date: Wed, 20 May 98 08:00:40 -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           Wed, 20 May 1998     Volume: 8 Number: 2647

Today's topics:
    Re: "Here" docs & cgi programming (Mark-Jason Dominus)
    Re: Benchmark: \s against [ \t] <jdf@pobox.com>
        Benchmark: Adding to the end of string (Jari Aalto+mail.perl)
        Benchmark: pre-extending array? (Jari Aalto+mail.perl)
        Benchmark: when using join '' is fast ? (Jari Aalto+mail.perl)
        Camel p. 541: "Prefer join()" (Jari Aalto+mail.perl)
    Re: COM and CPAN (actually, a semi-rant on survivable s (John Porter)
        Comment stripper for Perl (Andreas Schildbach)
    Re: Creating HTML tables? <paul.joslin@sdrc.com>
    Re: Dose %_ have a spacal meaning? (Mark-Jason Dominus)
    Re: Dose %_ have a spacal meaning? <lr@hpl.hp.com>
    Re: file locking question (Ryan McGuigan)
        Filename globbing strange behaviour mdeira@my-dejanews.com
    Re: Flat-File db recommendation <dfetter@shell4.ba.best.com>
    Re: From Linux/perl to MS SQL wjb3@po.cwru.edu
    Re: Function syntax with prototyping, filehandles and a <tchrist@mox.perl.com>
        Gif animations? <thafsaas@online.no>
    Re: Help please... <barnett@houston.Geco-Prakla.slb.com>
    Re: How does perl connect to Sybase SQLanywhere databas <dfetter@shell4.ba.best.com>
    Re: Information about fetchrow... (Gabor)
    Re: Inter-process file arbitration? (robert)
    Re: Non-static private variables (Mark-Jason Dominus)
    Re: omnihttpd (Nathan V. Patwardhan)
    Re: One you glob it, once you don't? (Jeffrey R. Drumm)
        OPEN Command question zucker@my-dejanews.com
    Re: OPEN Command question (Mike Stok)
    Re: perl text editor for windows95 (Wayne C. McCullough)
    Re: Printing to LPT2 or LPT3 on NT (Jeffrey R. Drumm)
    Re: Question: Is Perl an acronym? <sbutton@brussels.hp.com>
    Re: Run .pl or .cgi under Win95 scott@softbase.com
    Re: Sendmail to alias from Perl CGI script? thonge@my-dejanews.com
    Re: Software vendor liability [Was: Does Perl have a ID (Stuart McDow)
    Re: Software vendor liability [Was: Does Perl have a ID (Clinton Pierce)
    Re: translate A-Z to 1-26 (Shaun Sides)
    Re: while, each & assoc array (John Porter)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 20 May 1998 09:40:12 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: "Here" docs & cgi programming
Message-Id: <6jumfs$nav$1@monet.op.net>
Keywords: arum chili mountainside stagy


In article <35625047.46CD@monmouth.com>,
Liz & Joe Niederberger  <lniederberger@monmouth.com> wrote:
>I was thinking how nice it would be if I could write
>cgi scripts with "variable interpolation" operating on
>subroutine references as well as scalars and arrays.

You might want to look at the `Interpolation'  module, available from
CPAN and from

	http://www.plover.com/~mjd/perl/Interpolation/

 .  It lets you define arbitrary semantics for interpolations.



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

Date: 20 May 1998 08:41:28 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Re: Benchmark: \s against [ \t]
Message-Id: <67j1xdo7.fsf@mailhost.panix.com>

<jari.aalto@poboxes.com> (Jari Aalto+mail.perl) writes:

> The \s mathes [ \t\n\r\f], but I was in an assumtrion that the \s itself
> was somehow specially optimized. According to benchamrk, there seems to
> be no difference, which would indicate that \s gets tranlated to 
> [ \t\n\r\f] before giving to Matcher.

A quick glance at the source reveals this not to be the case.  The \s
assertion is much simpler than a character class; it is implemented
through the application of a macro found in handy.h:

#define isSPACE(c) \
        ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) =='\r' || (c) == '\f')

whereas a character class involves the application of 30 lines of C
code to a compiled regex operand...

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: 20 May 1998 17:05:43 +0300
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Benchmark: Adding to the end of string
Message-Id: <tbd8d9hwaw.fsf@blue.sea.net>


        Is these all the possibilities to add to the end of string?
        Comments on Benchmark suite are welcome. 5.004_04

        jari

Benchmark test

    4.4 Dot vs. in-place addition to the end of sring

        These all add "a" to the end of existing variable. Judging
        from results the ".=" seems to be specially optimized.

            timethese( 10_000,
            {
                a => 'my $a; for (1..100) { $a .= "a" }'
                ,
                b => 'my $a; for (1..100) { $a  = $a . "a" }'
                ,
                c => 'my $a; for (1..100) { $a = "$a a" }'
                 ,
                d => 'my $a; for (1..100) { substr($a,0,0) = "a" }'
            });

         a: 11 secs (10.52 usr  0.05 sys = 10.57 cpu)
         b: 20 secs (17.51 usr  0.05 sys = 17.56 cpu)
         c: 20 secs (19.59 usr  0.04 sys = 19.63 cpu)
         d: 32 secs (28.83 usr  0.12 sys = 28.95 cpu)


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

Date: 20 May 1998 17:00:51 +0300
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Benchmark: pre-extending array?
Message-Id: <tbiun1hwj0.fsf@blue.sea.net>


        In what circumstances the pre-extending is faster?
        Or is pre-exteding remerk obsolete in recent perl?
        Please comment if I did the test wrong.

        Tests run wirh 5.004_04

        jari

Bencmark Test

        [Camel p542] suggests that pre-extending an array would be faster
        than mallocing elements when needed. The first is traditional push
        array. In Second example we pre-extend the array to 150 elements
        and keep incrementing $i to hold position where we last added.
        Lastly we return added elements.

        I assume the slowdawn is caused by "indexing", which is slower than
        just pushing elements to an array.This may be analog to why
        for(;;) is slower that foreach that is talked on [Camel p537]

            timethese( 10_000,
            {
                a => '
                my @a;
                for (1..100)
                {
                    push @a, "1";
                }
                @a'
                ,
                b => '
                my @a = (undef) x 150;
                my $i = 0;
                for (1..100)
                {
                    $a[$i] = "1";
                    $i++;
                }
                @a[0..$i]'
            });

            a: 21 secs (18.84 usr  0.09 sys = 18.93 cpu)
            b: 36 secs (31.51 usr  0.11 sys = 31.62 cpu)


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

Date: 20 May 1998 17:03:08 +0300
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Benchmark: when using join '' is fast ?
Message-Id: <tbg1i5hwf7.fsf@blue.sea.net>


    Would someone know ehrn join '' is supposed to be faster than
    some other concatenation method? 5.004_04.

    jari

Benchmark test

    4.5 Dot vs. join when adding all together

        The variables "zxcv" are just taken from the lowest part of the
        keyboard....


            timethese( 1_000,
            {
                a => '
                for (1..300)
                {
                    $z = $x = $c = $v = $b = 1;
                    $a = join "" ,$z, $x, $c, $v, $b;
                }'
                ,
                b => '
                for (1..300)
                {
                    $z = $x = $c = $v = $b = 1;
                    $a = "$z$x$c$v$b";
                }'
                ,
                c => '
                for (1..300)
                {
                    $z = $x = $c = $v = $b = 1;
                    $a = $z . $x . $c .$v . $b;
                }'
            });

            a: 22 secs (20.76 usr  0.04 sys = 20.80 cpu)
            b: 22 secs (21.26 usr  0.02 sys = 21.28 cpu)
            c: 22 secs (20.99 usr  0.02 sys = 21.01 cpu)


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

Date: 20 May 1998 16:58:36 +0300
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Camel p. 541: "Prefer join()"
Message-Id: <tblnrxhwmr.fsf@blue.sea.net>


    The Efficiency section mentions at p. 541 that

        Prefer join...to a series of concatenated string. Multiple
        concatenations may cayuse strings to be copied back and forth
        multiple times. the join() operator avoids this.

    Could someone give an example on this. It's not clear to me when to
    prefer join(). In what circumstances? I was under assumption that
    join() would be faster than ".", but I don't knwo where I get that idea.
    I thought I would have such mentioned in camel...

    jari

            The variables "zxcv" are just taken from the lowest part of the
            keyboard....

            timethese( 1_000,
            {
                a =>
                'for (1..300)
                {
                    $z = $x = $c = $v = $b = 1;
                    $a = join "" ,$z, $x, $c, $v, $b;
                }'
                ,
                b =>
                'for (1..300)
                {
                    $z = $x = $c = $v = $b = 1;
                    $a = "$z$x$c$v$b";
                }'
                ,
                c =>
                'for (1..300)
                {
                    $z = $x = $c = $v = $b = 1;
                    $a = $z . $x . $c .$v . $b;
                }'
            });

            a: 22 secs (20.76 usr  0.04 sys = 20.80 cpu)
            b: 22 secs (21.26 usr  0.02 sys = 21.28 cpu)
            c: 22 secs (20.99 usr  0.02 sys = 21.01 cpu)



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

Date: Wed, 20 May 1998 14:03:42 GMT
From: jdporter@min.net (John Porter)
Subject: Re: COM and CPAN (actually, a semi-rant on survivable software design)
Message-Id: <MPG.fccae397d6dc58a9896d5@news.min.net>

On Tue, 19 May 1998 12:16:03 -0400,
in article <3561B043.2895E8DD@i2.com>,
bruce_howells@i2.com (Bruce Howells) wrote:
> 
> Well...  CPAN.pm doesn't work well on this NT machine. Why not?   Because LWP
> relies on a batch file, get.bat, in \perl\bin.   Note that the other LWP batch
> files (except for HEAD and POST) start, safely, with a LWP- prefix.
> 
> get is also the name of the executable for PVCS responsible for version control
> checkouts - which means my two options are either a working LWP or a working
> PVCS.   PVCS wins, which means \perl\bin\get.bat is now \perl\bin\get.lwp, and LWP
> - and thus CPAN - isn't an option on this machine.

Why in the world did you not rename get.bat to lwp-get.bat?
What possible advantage could there have been to renaming it so
unconformingly as you did?

John Porter


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

Date: Wed, 20 May 1998 13:46:55 GMT
From: as@rkdnet.de (Andreas Schildbach)
Subject: Comment stripper for Perl
Message-Id: <3562dea8.614328307@news.space.net>

Does anyone know a good comment stripper and maybe source code
obfusciator (sp?) for Perl code?

Thanks for any advice!

- Andreas



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

Date: 20 May 1998 08:21:39 -0400
From: Paul Joslin <paul.joslin@sdrc.com>
Subject: Re: Creating HTML tables?
Message-Id: <y4dk97h8758.fsf@hppop.sdrc.com>

On Tue, 19 May 1998 18:21:05 GMT, djones@everest.walcoff.com said:

djones> what I'm trying to do is write a perl script that takes an ascii file that
djones> contains a table template like the on below and convert it into an HTML table.
djones> The ultimate goal is to come up with an algorithem that would work an any
djones> template.  Any ideas?

a tbl/nroff to html translator?

Search CPAN for Data::ShowTable?

It looks at the data instead of a template but might do enough of the simple
cases to get you by...

-- 
	Paul R. Joslin          paul.joslin@sdrc.com     +1 513 576 2012
But you have to allow a little for the desire to evangelize when you
think you have good news.
		--Larry Wall in <1992Aug26.184221.29627@netlabs.com>


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

Date: 20 May 1998 09:35:29 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Dose %_ have a spacal meaning?
Message-Id: <6jum71$n96$1@monet.op.net>
Keywords: confirm doubleheader granite savoy


In article <895632249.454950@cabal>,
? the platypus {aka David Formosa}  <dformosa@st.nepean.uws.edu.au> wrote:
>Every so often I see a refrence to %_ in ether this newsgroup or burried
>within code.  
>
>Is is spechal, or is it just a normal hash that gets shoved about in *_
>along with $_ and @_ ?

It's just a hash.


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

Date: Wed, 20 May 1998 07:08:14 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Dose %_ have a spacal meaning?
Message-Id: <6juo5i$icl@hplntx.hpl.hp.com>

[posted and emailed]

Mark-Jason Dominus wrote in message <6jum71$n96$1@monet.op.net>...
>
>In article <895632249.454950@cabal>,
>? the platypus {aka David Formosa}  <dformosa@st.nepean.uws.edu.au>
wrote:
>>Every so often I see a refrence to %_ in ether this newsgroup or
burried
>>within code.
>>
>>Is is spechal, or is it just a normal hash that gets shoved about in
*_
>>along with $_ and @_ ?
>
>It's just a hash.

It is just a normal hash, but its name is special.  It need not be
declared as "local %_", when "use strict 'vars'" is in effect, and it
cannot be declared as "my %_" in any case (even within a block).

--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com





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

Date: 20 May 1998 13:26:03 GMT
From: ryan@mail.ramresearch.com (Ryan McGuigan)
Subject: Re: file locking question
Message-Id: <6jullb$ej0$1@news12.ispnews.com>

Thanks for your help everyone, I got it working now.  

Ryan McGuigan (ryan@mail.ramresearch.com) wrote:
: How can I read the last line of a file, and then append to it while having
: it locked the whole time?  

: thanks,
: Ryan


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

Date: Wed, 20 May 1998 14:09:00 GMT
From: mdeira@my-dejanews.com
Subject: Filename globbing strange behaviour
Message-Id: <6juo5s$dml$1@nnrp1.dejanews.com>

Is this behaviour normal ? I obtained this under a Solaris.
---
/tmp $export FILE_NAME=foo
/tmp $export DIR_NAME=/tmp
/tmp $ls -l $DIR_NAME/$FILE_NAME
/tmp/foo: No such file or directory
/tmp $perl -v

This is perl, version 5.003 with EMBED
        built under solaris at Apr  2 1998 12:36:23
        + suidperl security patch

Copyright 1987-1996, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

/tmp $perl -w -e '$fileref="$ENV{DIR_NAME}/$ENV{FILE_NAME}";@filename =
glob(${fileref}); print "@filename","\n";'
/tmp/foo
/tmp $export
FILE_NAME=foo*
/tmp $ls -l
$DIR_NAME/$FILE_NAME
/tmp/foo*: No such file or directory
/tmp $perl -w -e '$fileref="$ENV{DIR_NAME}/$ENV{FILE_NAME}";@filename =
glob(${fileref}); print "@filename","\n";'

/tmp $
---
That is, if the $fileref contains a metacharacter it works correctly, if it
contains a simple, plain file name it does not wor as I would have expected.

Or should I not expect filename globbing as "ls -1" ?

Is this a bug or is it a feature ?

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 20 May 1998 14:04:40 GMT
From: David Fetter <dfetter@shell4.ba.best.com>
Subject: Re: Flat-File db recommendation
Message-Id: <6junto$m7n$1@nntp1.ba.best.com>

Bill Ferraro <skc1234@hotmail.com> wrote:

> Can anyone recommend a flat-file db module (e.g. Sprite) which can
> deal with columns that hold a lot of text? I'm trying to convert
> some Oracle tables into flat-file tables, but some of the Oracle
> fields hold up to 2000 words.

I don't know your exact situation, but have you considered using one
of the freely available RDBMS's for this project?  MySQL and
PostgreSQL do pretty well.

HTH,
David.
-- 
            David Fetter         888 O'Farrell Street Apt E1205
   shackle@ren.glaci.com          San Francisco, CA 94109-7089 USA
  http://www.best.com/~dfetter     +1 415 567 2690 (voice)
print unpack ("u*",q+92G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R"@``+)

I think that's how Chicago got started. A bunch of people in New York
said, 'Gee, I'm enjoying the crime and the poverty, but it just isn't
cold enough. Let's go west.'
                                       Richard Jeni


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

Date: Wed, 20 May 1998 13:07:57 GMT
From: wjb3@po.cwru.edu
Subject: Re: From Linux/perl to MS SQL
Message-Id: <3562d4e0.149081517@news.cwru.edu>

>How can I determine port on which SQL-Server is listening?
>Is the value 5000 any standard? Where I can found something about it?
>I've got now only msSQL Server REsource Guide and I didn't fount anything...
1433 is the default port.  Make sure that TCPIP support is running on
the server.

--Wes



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

Date: 20 May 1998 12:34:20 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Function syntax with prototyping, filehandles and arrays
Message-Id: <6juikc$di0$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Marc.Haber-usenet@gmx.de (Marc Haber) writes:
:One of my various prototypes is

Ooooh.  Perl ``prototypes'' are about context coercion.  
They aren't what Pascal/C/C++/anything else uses them for. 
They probably won't make you happy.

:sub write_to_temp(*$$$*)
:{
:	my (*FH,$mailfilename,$heloname,$sender,@rcpts) = @_;
:
:that should be called like
:
:write_to_temp(\STDIN,$filename,$host,$sender,@rcpts);

Why is it that you have a globular star on the fifth parameter
in the prototype, but the calling code and the called code both
treat what's coming in as a list there?  Why isn't it an @?

Or maybe a \@ in the proto, a @ in the caller, and a $rcpts_aref in
the callee?

If I were you, I would try making the program work without prototypes. :-)

--tom
-- 
USER: the word computer professionals use when they mean "idiot"


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

Date: Wed, 20 May 1998 15:07:42 +0200
From: Thomas Hafsaas <thafsaas@online.no>
Subject: Gif animations?
Message-Id: <3562D59E.F8A980FB@online.no>

Does anyone know of any gif animation tools libraries for perl?


--
"So I said to the runner, 'Remember to look ahead.', but all he could do
was run..."
 - Mirris Star Upon Dawn
thafsaas@online.no http://home.sol.no/~thafsaas




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

Date: Wed, 20 May 1998 08:21:51 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: dimce@hotmail.com
Subject: Re: Help please...
Message-Id: <3562D8EF.C71E509E@houston.Geco-Prakla.slb.com>

[courtesy cc to cited author]

Re: Help please...

Please read the following information on how to choose an appropriate
subject line:

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

Dimce H wrote:
> 
> Hello people  how are you?
>  I wanted to ask anyone if they could help me with a major assignment of
> mine.
Asking us to do your homework for you, hmmmm?  Not smart.  In fact,
likely to get you summarily (and immediately) flamed for even asking the
question.

> I am struggling big time. 
Congratulations!  You are on your way to becoming a programmer. 
Programming is not easy, or everyone would do it.  There is a steep
learning curve for your first language.  It gets easier once you
understand and are familiar with structured programming.

> I have to write a Perl script that gets
> data from a browser and inserts it into a database.
Okay.

> I don't know where
> to start.
You mention later that you are running under Windows NT.

There are many books and online resources available for Perl.  'Learning
Perl, 2nd Edition' by Schwartz (sp?), 'Programming Perl, 2nd Edition' by
Wall, Christiansen, and Schwartz.  The 'Gecko' book (which covers Perl
on Win32 machines) but I don't know the real title.  All these books are
by O'Reilly, and I would recommend you buy/read them.  For almost
anything you want to find online regarding Perl, see
http://www.perl.com   You can download loads of useful things (including
documentation, and the latest version of Perl) from this site.

These will help you get started on Perl.

> For example do I need a separate HTML form, and if so, how
> will the input of the form be passed onto the script?
For this question, you will need to consult someone with real HTML/CGI
experience.  My limited experience has just be hand writing HTML code,
and (badly) writing an internal CGI script (that isn't done yet).  Try
newsgroup(s) www.infosystems.www.authoring.cgi and
www.infosystems.www.authoring.html for assistance on the HTML/CGI
interaction questions.

You should probably buy (at least one) book on this subject.  I
purchased "CGI Programming on the World Wide Web" (again by
O'Reilly--don't remember the author's name, but it should be easy enough
to find).

> Does it matter
> which Windows server I run on my NT machine?
Windows server?  What, pray tell, is a Windows server?  I think you mean
Web server?  It doesn't matter to me which one you use.  Apache
(http://www.apache.org) probably has a version of their Apache web
server that will run under NT.  It's worth looking into.

> Which win32 extensions do I
> need to install?
Ask in a newsgroup devoted to all things win32 or in a newsgroup devoted
to the web server you choose to run.  I honestly have no idea.

> Any other special applications?  How would I start this
> script?
Read the books.  Read the documentation (c:\>perldoc perldoc) Understand
them.  Try a few things.

When/if that doesn't help, post a snippet of code that shows what you
are having trouble with.  You'll be infinitely more likely to get help
that way than by asking us to do your assignments for you.

> Any ideas?
Lots of ideas on lots of topics, but I don't think you want to hear any
of those right now.

> Have you got any scripts similar to this one?
No, but after having spent a fair amount of time learning Perl, and
reading about CGI, I could probably hack one together.

> It is
> supposed to take the Name, Surname, Student number (for validation),
> Subject name and a mark for that subject, and then store them into a
> database (possibly MS Access). It sounds fairly simple but to a newbie
> this is an extremely difficult task.
What on earth class are you taking that requires a 'newbie' to program a
Perl script of such magnitude and complexity?  If they're expecting you
to program in Perl, I would hope they would have the decency to point
you to the resources I pointed you to above.

> Can I get my hands on a script like
> this one anywhere on the net?
I don't know, what did the search engines turn up?  Maybe searching for
'someone to do my work for me' in a web search engine would help.

> Please, please help me if you can if have a spare minute to look into it
> and help me out heaps.
I think the best way to help you is to force you to help yourself.

There are a boatload of resources available on the web, usenet, and your
local bookstore.  May the books be with you.

> Thanking you kindly,
> DimCe
Hope that gets you pointed in the right direction.

Cheers,
Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

----------------------------------------------------------------------
Dave Barnett                 U.S.: barnett@houston.Geco-Prakla.slb.com
DAPD Software Support Eng    U.K.: barnett@gatwick.Geco-Prakla.slb.com
----------------------------------------------------------------------


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

Date: 20 May 1998 14:16:15 GMT
From: David Fetter <dfetter@shell4.ba.best.com>
Subject: Re: How does perl connect to Sybase SQLanywhere database?
Message-Id: <6juojf$m7n$2@nntp1.ba.best.com>

Pheng Lay <phengl@ir-optima.com> wrote:
> I have Sybase SQLanywhere 5.0 database running currently on our NT 4.0 with
> IIS 3.0 and SP3.  I would like to write a perl script to connect and
> open/update/close the databse.  The perl script will be launch by the java
> applet.  What do I have to do or is does any one has any sample code on how
> to connect to the SQLanywhere 5.0.  Any help is appreciated...thanks.

On CPAN, there is a section called
modules/by-category/07_Database_Interfaces.  If perl currently talks
to any database, you will find the relevant modules there.

HTH,
David.
-- 
            David Fetter         888 O'Farrell Street Apt E1205
   shackle@ren.glaci.com          San Francisco, CA 94109-7089 USA
  http://www.best.com/~dfetter     +1 415 567 2690 (voice)
print unpack ("u*",q+92G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R"@``+)

Did you ever walk in a room and forget why you walked in? I think
that's how dogs spend their lives.
                                       Sue Murphy


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

Date: 20 May 1998 13:02:36 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: Information about fetchrow...
Message-Id: <slrn6m5lfu.es4.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Cristina Durana <cristina.durana@iie.min-edu.pt> wrote :
# Hi all!!!!!!
# I need, with urgency, infromation about the instruction "fetchrow"...
# Anybody could help me, please...
# Thanks in advance
# Cristina

Perl doesn't have a standard command called 'fetchrow'.  If this is a
subroutine in a module, you might want to say which module it is. ;)


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

Date: 20 May 1998 16:31:44 +0200
From: robert@il.fontys.nl (robert)
Subject: Re: Inter-process file arbitration?
Message-Id: <6jupgg$cii@bsd1.ilse.net>

"Jeremy Goldberg" <jgoldberg@dial-but-dont-spam.pipex.com>:
 >flock doesn't seem to be what I'm looking for. I think what I want is a
 >semaphore system (or something similar), but all the IPC/sysV stuff just
 >leaves me befuddled, quite apart from the lack of documentation on how to
 >use it and what systems it works on.
 >Something like this:
 >if( FileLock() )        # Will wait until file is free, rather than just
 >aborting straight away
 >{
 >    ReadFile();
 >    ProcessData();
 >    WriteFile();        # We can be sure the data hasn't been written to
 >while we were changing it
 >    FileUnlock();
 >}

This can be implemented using flock(): flock() (unless LOCK_NB is used)
blocks until it can lock the file it wants to lock. Consider the following
short program:
-
#!/usr/local/bin/perl5 -w

use Fcntl qw(:flock);

open(FD, ">blah") or die "$$ open: $!";
flock(FD, LOCK_EX);
print "$$ Got lock, gonna sleep\n";
sleep 10;
close FD;
-

If you run two instances of this program at the same time (and in the same
directory), with the first instance getting a head start of a couple of
seconds, the second instance will wait on the first instance to unlock the
file (by closing the file, SEE BELOW) before it can continue with the print
and the sleep.

 >P.S. Does flock() only work AFTER you've opened a file?

Yes, since it works on filedescriptors (so you have to immediately lock the
file after opening it).

Also important to note is that using flock(LOCK_UN) to unlock a file can
be dangerous, since your OS might still have some unwritten data in disk-
buffers for the locked file. If you unlock before this data has been
actually written to disk, you might still corrupt the file. The best way
is not to call flock(LOCK_UN) at all, but rather to close the entire file.
That way, the OS will automatically release the lock without the hazard of
race-conditions. If, however, closing the file is not an option (like when
the file is being written to a whole lot, so closing/opening the file might
actually get in the way of performance), be VERY sure all data is written
to disk (flushing the filehandle might do the job, but don't take my word 
for it) before unlocking.

                                                                    robert


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

Date: 20 May 1998 09:29:53 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Non-static private variables
Message-Id: <6julsh$n7f$1@monet.op.net>
Keywords: Non-static private variables

In article <6jt07v$18h$1@mathserv.mps.ohio-state.edu>,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>[A complimentary Cc of this posting was sent to Mark-Jason Dominus
><mjd@op.net>],
>who wrote in article <6jsafh$hpa$1@monet.op.net>:
>> >As I understand Perl classes are just packages, which are just name
>> >spaces.  And instances of these classes are references to thingies which
>> >are scalars, hashes or arrays.
>> 
>> This is exactly right.
>
>Wrong.  Objects are not references, but the things you refer to.

The distinction is all in your head.  An object is not a datum or
a reference; it is an abstraction that is not really well-defined.

Suppose you define a rational number type where the number 3/4 is
represented as [3, 4].  Are rational numbers the underlying lists?  Or
are they the references to lists?  What if all your rational number
functions accept only references?

When you make a blessing, the blessing applies to the datum, but that
does not mean that it is the datum which is the object.  The blessing
is not enough.  To make a method call in Perl, you need a reference to
a blessed datum.  So it is not exactly right to say that either the
blessed datum or the reference is the object; you need them together.



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

Date: 20 May 1998 13:51:55 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: omnihttpd
Message-Id: <6jun5r$l5t@fridge.shore.net>

DUTOIT (abcdm@wanadoo.fr) wrote:

: I want to use omnihttpd like a local server . I have it but  how can I do ?

(1) Why are you asking this question here?
(2) If you don't know what omnihttpd does, how to download it, read
    the docs, and install it, you shouldn't be in the tech business.
(3) If you INSIST on asking a *webserver* question in a *Perl
    language* newsgroup, you are clueless or a freeloader or both.

I hate to be mean, but this is about the millionth (frighteningly)
misguided and downright incredible posting that I've ever seen.  It's
*very* discouraging.

--
Nathan V. Patwardhan



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

Date: Wed, 20 May 1998 13:05:36 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: One you glob it, once you don't?
Message-Id: <3562c285.89325983@news.mmc.org>

On 19 May 1998 23:27:54 GMT, Tom Christiansen <tchrist@mox.perl.com> wrote:

>It actually is.  Applications shouldn't be worrying about that.
>But I remember Sarathy seemed to have some reasons last time this 
>was brought up.  I never bought it though.  There's something
>fundamentally clean and uniform about the shell doing the globbing,
>not the application.

Hear, hear!

>He said you can use 

>    set PERL5OPT=-MWild

>in your shell to make it work right.

That is, of course, assuming one copies the code posted in his article to a
file called Wild.pm somewhere in @INC; it's not included in the standard NT
bindist.

>http://www.dejanews.com/dnquery.xp?QRY=glob&ST=PS&DBS=1&defaultOp=AND&maxhits=25&format=terse&showsort=score&groups=comp.lang.perl.misc&authors=gsar@*&subjects=&fromdate=&todate=

Anyway, thanks for digging that up, Tom . . . and it seems to work well as long
as you don't turn on -w. Perl complains about an uninitialized value in
File::DosGlob at line 112. It looks like $sym doesn't get initialized when
import() is called, so I inserted this just before line 112:

    defined $sym || ($sym = '');

I'm not a wizard at this stuff, so I don't know whether it breaks anything. And
since it's NT, who cares, right? ;-)

-- 
                               Jeffrey R. Drumm, Systems Integration Specialist
                       Maine Medical Center - Medical Information Systems Group
                                                            drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me


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

Date: Wed, 20 May 1998 13:55:27 GMT
From: zucker@my-dejanews.com
Subject: OPEN Command question
Message-Id: <6junce$cnt$1@nnrp1.dejanews.com>

Hi,

when using the command 'open' to write to a file, does automatic file locking
take place or do I have to write/include some file locking routine(s)?

Thanks in advance.

Rob.


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 20 May 1998 14:34:52 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: OPEN Command question
Message-Id: <6jupmc$hbo@news-central.tiac.net>

In article <6junce$cnt$1@nnrp1.dejanews.com>,  <zucker@my-dejanews.com> wrote:

>when using the command 'open' to write to a file, does automatic file locking
>take place or do I have to write/include some file locking routine(s)?

You have to do any file locking yourself, in recent perl distributions

  perldoc -f flock

might be a useful starting point.

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@colltech.com                  |            Collective Technologies (work)


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

Date: 20 May 1998 13:23:58 GMT
From: wayne@Glue.umd.edu (Wayne C. McCullough)
Subject: Re: perl text editor for windows95
Message-Id: <6julhe$98g$1@hecate.umd.edu>

Diane Strahl (jimndi@sgi.net) wrote:
: Can someone recommend a good, easy-to-use text editor to use for writing
: perl programs on windows95? I used bbedit on a friend's mac, which is
: the sort of thing I'm looking for. I've looked at vim and emacs, but
: they seem more complicated than what I want. Are they worth spending the
: time to learn? What are the advantages of these? Anything out there with
: pull-down menus rather than having to memorize all the commands which
: need to be typed in? Right now I'm using the basic windows95 text
: editors - notepad and wordpad. It'd be nice to use something that at
: least had syntax coloring.

I have been using PFE...  It's free, and it has most features you would
want.  With a little bit of set up you almost have a IDE.  Not syntax
colloring though.

W


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

Date: Wed, 20 May 1998 13:24:59 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Printing to LPT2 or LPT3 on NT
Message-Id: <3563d8e4.95052798@news.mmc.org>

[posted and mailed]

On Tue, 19 May 1998 22:58:50 -0400, "Joe Greene" <jgreene@ham.wb4uds.org>
wrote:

>Is there a way to print to LPT2?  I've tried "print LPT2 'some output'".
>And I've tried 'open OUTDEV, ">LPT2"'.  So far, the only way I've been able
>to do it is by outputing to a file and then copying the file to LPT2.  Seems
>to me there should be a way to use LPT2 with the print statement.

Yes, but it's not exactly straightforward. Create a share for the printer in
question, and print to the share using the UNC.  Seems to work pretty reliably.

   open PRT, ">//computer/sharename" or die "Dammit! $!\n";
   print PRT $stuff_to_print;

-- 
                               Jeffrey R. Drumm, Systems Integration Specialist
                       Maine Medical Center - Medical Information Systems Group
                                                            drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me


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

Date: Wed, 20 May 1998 14:40:26 +0200
From: Steve Button <sbutton@brussels.hp.com>
Subject: Re: Question: Is Perl an acronym?
Message-Id: <3562CF3A.429F@brussels.hp.com>

Lloyd Zusman wrote:
> 
> wayne@Glue.umd.edu (Wayne C. McCullough) writes:
> 
> > Lloyd Zusman (ljz@asfast.com) wrote:
> > : Larry Wall.  As early as 1988, I recall seeing his mention of another,
> > : possibly more appropriate acronym in the Perl man pages.
> >
> > Yes, but he told you (in the man page) not to tell anyone he said that.
> 
> True ... I had forgotten about that.  But then again, now that I think
> about it, I vaguely recall a smiley after that admonishment ... or is
> that just wishful thinking?

Uuuuhhh. Though may hath offended thy Gods. For a punishment you must
write in Java for 1 week, nay ASP. tskk.

I think that it stands for People from Earth Rarely Learn.

or Paranoid Electronic Robots Lie.

 ....or perhaps Larry tried putting grep backwards, came up with perg and
changed the g to an l (for Larry).

I wonder how far it would have got if it was called perg??

news:comp.lang.perg
http://www.perg.org

he he. :-)

Steve


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

Date: 20 May 1998 11:38:07 GMT
From: scott@softbase.com
Subject: Re: Run .pl or .cgi under Win95
Message-Id: <6jufav$pv9$2@mainsrv.main.nc.us>

unique (unique@net-lynx.com) wrote:
> I need help on running a perl script under a browser/Win95 .

You can't do this. You need a web server to run your CGI
program and serve up the output to your browser. 

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: Wed, 20 May 1998 13:51:57 GMT
From: thonge@my-dejanews.com
Subject: Re: Sendmail to alias from Perl CGI script?
Message-Id: <6jun5t$cca$1@nnrp1.dejanews.com>

In article <6jubbp$ec7$1@the-fly.zip.com.au>,
  "Noel Sampol" <noels@chilli.net.au> wrote:
>
> Hi...
>
> I have a Perl CGI script that runs /usr/bin/sendmail to send confirmation
> e-mail to me and to the 'visitor'. The problem is when I try the script via
> HTTP FORM POST using my e-mail alias of noels@ozinet.zip.com.au, the mail
> does not get sent to my alias but only to my real email of noels@zip.com.au.
>
[snip]
>
> What does the "|" mean?

The | is a "pipe", which tells Perl to send output to a command, in this case
/usr/bin/sendmail.  It's just another way of specifying a destination
for STDOUT.

Now I can't answer your other questions, but I'll be looking forward to the
replys, because I'm having trouble working with sendmail right now too.

Tony

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 20 May 1998 13:51:45 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Software vendor liability [Was: Does Perl have a IDE?]
Message-Id: <6jun5h$bkn$1@ns1.arlut.utexas.edu>

kfox@pt0204.pto.ford.com (Ken Fox) writes:
> 
> Being able to sue vendors for bad software encourages vendors to
> produce good software

Hmm. I think it would encourage vendors to get out of the software
business altogether. If I was a software writer/vendor faced with such
a risk, I'd just GPL the damn thing, stick an "as is" disclaimer on it
and be done with it.

It also makes me wonder whether this attitude discourages companies
from writing their own software. It you roll your own software, and it
fails, who do you sue? Yourself?

--
Stuart McDow                                     Applied Research Laboratories
smcdow@arlut.utexas.edu                      The University of Texas at Austin
            "Look for beauty in roughness, unpolishedness"


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

Date: 20 May 1998 14:19:02 GMT
From: cpierce1@cp500.fsic.ford.com (Clinton Pierce)
Subject: Re: Software vendor liability [Was: Does Perl have a IDE?]
Message-Id: <6juoom$d057@eccws1.dearborn.ford.com>

In article <6jt0r2$10m4@eccws1.dearborn.ford.com>,
	kfox@pt0204.pto.ford.com (Ken Fox) writes:
>So who said Ford has that attitude?  Clinton's motivation for not
>using gcc to ship production tools is that he does not "incur the
>wrath of Ford Management."  Ford has the policy that all software
>needs a purchase order. **
>
>** Reasonable people disagree with this policy because the quality
>   of free software is often better than purchased software.  That
>   doesn't mean the motivation of the policy makers is bad -- just
>   that they don't know the software industry very well.

Thanks Ken.  I'm one of those people who disagree entirely.  Which is
I think, why I'm the "Official Ford/Perl Help Desk".**  I've been pushing
for reasonable FREE substitutes where only unreasonable commercial ones
exist here at the Ford Systems Integration Center.  

This is also why GNU RCS (and not SCCS) is the FSIC Recommended Source
Control system.  The paperwork to allow these free tools to be used in
any official capacity at Ford is unbelievable....


Clinton "Have You Driven a Camel, Lately?" Pierce


** Being the "Official Ford/Perl Help Desk" simply means that we agree
   to answer questions about the Perl distribution maintained within 
   Ford and we keep Perl on an FTP site.  And that we maintain "OFFICIAL
   RESPONSIBILITY" for Perl.  Language questions we refer to the FAQ's, 
   books or USENET.  This amounts to almost no work...
-- 
+------------------------------------------------------------------------+
|  Clinton A. Pierce    |   "If you rush a Miracle Man,   | http://www.  |
|  cpierce1@ford.com    |     you get rotten miracles"    | dcicorp.com/ |
| fubar@ameritech.net   |--Miracle Max, The Princess Bride| ~clintp      |
+------------------------------------------------------------------------+
GCSd-s+:+a-C++UALIS++++P+++L++E---t++X+b+++DI++++G++e+>++h----r+++y+++>y*



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

Date: 20 May 1998 12:51:00 GMT
From: arch@abts.net (Shaun Sides)
Subject: Re: translate A-Z to 1-26
Message-Id: <slrn6m5kbi.mav.arch@abts.net>

Original message by: Ala Qumsieh <aqumsieh@matrox.com>
Date: Tue, 19 May 1998 13:42:07 -0400
Subject: Re: translate A-Z to 1-26


> You are :-)

I am. 8-P

> Did you try it before posting? First of all, tr/// doesn't have a g
> modifier!
> Your statement replaces all As with 1s, all Bs with 2s and every other
> capital letter with 6.

I realize that, now, and I formally apologize to the 'group for posting
something so ... stupid.  In penance, I will now commence to read the
tr/// entry in the camel book no fewer than 5 times a day for a week.
(I feel doubly stupid because I own the camel book but still did that)

> Nice try though ;-)

::sigh::  Guess I'll thank all of you for not being very hard on me.

-- 
Shaun L. Sides			arch@abts.net
Business web site		http://www.abts.net/~arch
Showershoe web site		http://www.abts.net/~arch/showershoe
Recreational web site		http://sara.mmlc.nwu.edu/~arch


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

Date: Wed, 20 May 1998 14:30:34 GMT
From: jdporter@min.net (John Porter)
Subject: Re: while, each & assoc array
Message-Id: <MPG.fccb486949a21b89896d6@news.min.net>

On 20 May 1998 02:57:45 GMT,
in article <895633065.788742@cabal>,
dformosa@st.nepean.uws.edu.au (? the platypus {aka David Formosa}) wrote:
> In <MPG.fcb5d46636d76149896cf@news.min.net> jdporter@min.net (John Porter) writes:
> 
> >On Mon, 18 May 1998 16:18:40 GMT,
> >in article <1d982ps.1cdon0b158dtq3N@roxboro0-027.dyn.interpath.net>,
> >phenix@interpath.com (John Moreno) wrote:
> >> 
> >> Yeah, I don't know who should be given the credit for it, but perls
> >> alternative for the single statement  (statement condition;) is much
> >> better.
> 
> >What, you're thinking it might be someone other than Larry?
> 
> From the camel, 

Specifically, the Glossary


> BASIC/PLUS
>   Another ancient languge, from which Perl derived exactly one idear. OK
> maybe two.*
> 
> * BASIC/PLUS is a registed [...ect...] And the answers are stament
> modifers and maybe formats.

Hmmm, yeah, you're right.

I notice that in the Pink Camel, he had these words, which were
somewhat edited for the Blue Camel:

	Another ancient language (reminiscent of Indo-European) from
	which Perl derived exactly one idea. Well, OK, maybe two...

John Porter


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

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

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