[9922] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3515 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 23 02:01:11 1998

Date: Sat, 22 Aug 98 23:00:17 -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, 22 Aug 1998     Volume: 8 Number: 3515

Today's topics:
        CGI made simple <administrator@sodertalje.se>
    Re: h2ph on Solaris 2.6 lvirden@cas.org
    Re: Informix ONL 5.0 / ESQL 4.10.U and PERL 5.00404 (Gary L. Burnore)
    Re: Is Perl5.004 Year 2000 compilant? (brian moore)
    Re: Is Perl5.004 Year 2000 compilant? lvirden@cas.org
    Re: Is Perl5.004 Year 2000 compilant? (Larry Rosler)
    Re: Perl Docs.. forget the original post (Tad McClellan)
    Re: Perl Docs.. forget the original post (Larry Rosler)
    Re: Perl documentation <mpersico@erols.com>
    Re: Perl documentation <rra@stanford.edu>
    Re: Send cmd and Receive result from command? (Tad McClellan)
        Someone playing games or a badly configured server (Gary L. Burnore)
    Re: Strange characters while writing in files (Tad McClellan)
    Re: Strange characters while writing in files (Larry Rosler)
    Re: Substitution issue. (Tad McClellan)
    Re: why doesn't this work as expected... (Tad McClellan)
    Re: Why dont people read the FAQs <mpersico@erols.com>
    Re: Why dont people read the FAQs (Gary L. Burnore)
    Re: Why dont people read the FAQs lvirden@cas.org
    Re: Why dont people read the FAQs lvirden@cas.org
    Re: Why dont people read the FAQs (Gary L. Burnore)
    Re: Why dont people read the FAQs (Gary L. Burnore)
    Re: Win32 perl, XS and VC++ 6 <mpersico@erols.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 20 Aug 98 07:29:36 GMT
From: "B Hahn" <administrator@sodertalje.se>
Subject: CGI made simple
Message-Id: <01bdcc0d$44c14580$0349c6c3@worldw2>

WebMerger is a CGI parser engine that allows your
Web pages to generate dynamic output on the fly.

Interact with databases such as ODBC, JDBC or pure text files.
HTML alike tags, very easy to learn and use.
Can be installed remotely at your ISP on both Windows NT/95/98
and Unix platforms.

Create->
Guestbooks
Searchable databases
Online courses
shopping applications
message boards

Or implement->
counters
local search engine
date & time functions

Download it for FREE at http://www.webmerger.com
Fully functional freeware currently in beta stage, final release
scheduled for release for September 1998.
The final release has improved recursive tag handling allowing
nested SQL outputs as well as nested IF statements and 
credit card validation.

sales@webmerger.com

Regards
//B Hahn


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

Date: 23 Aug 1998 02:23:43 GMT
From: lvirden@cas.org
Subject: Re: h2ph on Solaris 2.6
Message-Id: <6rnuff$f6c$1@srv38s4u.cas.org>


According to  <psabp@concentric.net>:
:Just wondering if anyone else has seen a problem with h2ph on Solaris
:2.6.  I am trying to use the system sockets but when I run h2ph on a

Actually, I've seen it several places - 2.6 just being the latest.  Bugs
in h2ph are fixed on a regular basis - I identified a 2.6 one in the past
two weeks and a fix was posted to a mailing list where the next maintenance
release for perl 5.005 is being prepared.
-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

Date: Sun, 23 Aug 1998 05:43:31 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: Informix ONL 5.0 / ESQL 4.10.U and PERL 5.00404
Message-Id: <35e4abe4.271680370@nntpd.databasix.com>

On Mon, 17 Aug 1998 15:09:08 -0400, in article
<35D87FD4.D7C@exchange.sms.siemens.com>, Rich Sy
<Richmont.Sy@exchange.sms.siemens.com> wrote:

>We have informix online 5.0 and esqlc 4.10.U.  We want to use perl
>5.00404 to interface with informix.  So far we've not found any
>available perl interface to informix that can make use of what we
>currently have. I thought I've found something with the older 'isqlperl'
>but it only compiles with perl 4.
>
>Can anyone suggest any strategy as to how we can quickly and efficiently
>interface with informix?  We don't have the expertise nor the time to
>extend perl.
>
>We were thinking along the line of spawning an esqlc program from perl
>that has all the informix connections available and communicate with the
>perl parent process via some sort of an ipc.  We thought we could use
>dynamic sql but found that statements such as "describe...from" and
>"allocate descriptor" do not compile in our current version of esqlc.


Your version of esqlc is not new enough for dsql.  Try upgrading.
-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: 23 Aug 1998 05:10:12 GMT
From: bem@news.cmc.net (brian moore)
Subject: Re: Is Perl5.004 Year 2000 compilant?
Message-Id: <slrn6tv921.rfd.bem@thorin.cmc.net>

On Sat, 22 Aug 1998 08:11:10 -0700, 
 Larry Rosler <lr@hpl.hp.com> wrote:
> Yes, you are missing the main point.  As was discussed here recently, the 
> issue is not whether the OS and the internal data represent time in 32 or 
> 64 bits.  The issue is that all existing external data (in which time is 
> now represented exclusively in 32-bit integers) become ambiguous.  Either 
> the programs that deal with such data must add logic to resolve the 
> ambiguities, or the data sets themselves must be redesigned and 
> rewritten.

That is assuming they deal with saving the date as either the ambiguous
'01/10/99' or as a binary number.  One is icky because of century wrap (as
well as constantly dealing with "30 das hath September" rules for a simple
increment) and the other is equally icky unless you plan on always using the
same hardware platform.

> This is the real reason behind the massive cost of the century bug -- 
> external storage of the year in two decimal digits.  Using six bytes to 
> store a date is wasteful, but preceded C and the Unix Epoch.  So, just as 
> Cobol's data are facing Armageddon now, C[++] and Perl's data will face 
> it in 2038.

Unless, of course, you're saving the date as the offset in ASCII to be cross
platform and allow snarfing of data with a variety of tools.

> Do not expect enlightment to come before 2035 or so.  Are *you* 
> allocating more than 32 bits to store time in external data?

time_t is time_t.  sizeof() works quite well.  Note that you will find this
problem out not in 2038, but most likely the first time you port to a 64-bit
CPU and your compiler whines at you, or the first time you port from a Sparc
to an Intel chip and you have to deal with byte ordering since your program
now barfs on all the dates.

FWIW, I always store dates as ASCII representation of the offset from the
epoch.  My stuff will run just fine.

-- 
Brian Moore                             Kill A Spammer For Jesus
Sysadmin, C/Perl Hacker, Usenet Vandal 


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

Date: 23 Aug 1998 02:15:21 GMT
From: lvirden@cas.org
Subject: Re: Is Perl5.004 Year 2000 compilant?
Message-Id: <6rntvp$e36$1@srv38s4u.cas.org>


According to Larry Rosler <lr@hpl.hp.com>:
:Cobol's data are facing Armageddon now, C[++] and Perl's data will face 
:it in 2038.
:
:Do not expect enlightment to come before 2035 or so.  Are *you* 
:allocating more than 32 bits to store time in external data?
:
:Be afraid.  Be very afraid.  Or (as a colleague put it at the Perl 
:Conference), be doing the Big Sleep, as he and I will be by then. :-(


That may be the case - as long as you never care about calculating long
term investment forecasts, or 50 year business mortgages, or for that matter
standard 30 year home mortgages in about 10 years.

Otherwise folk, the same hole is being dug today for ourselves within
10 or so years...

-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

Date: Sat, 22 Aug 1998 22:51:30 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Is Perl5.004 Year 2000 compilant?
Message-Id: <MPG.10494db94879bdbe9897e3@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <slrn6tv921.rfd.bem@thorin.cmc.net> on 23 Aug 1998 05:10:12 
GMT, brian moore <bem@news.cmc.net> says...
 ...
> Unless, of course, you're saving the date as the offset in ASCII to be cross
> platform and allow snarfing of data with a variety of tools.
> 
 ...
> 
> FWIW, I always store dates as ASCII representation of the offset from the
> epoch.  My stuff will run just fine.

Provided you do all arithmetic using BigInt on the string representation.  
Otherwise Perl's data conversions and 32-bit arithmetic will ruin you.  
If you pad current dates to ten bytes with a leading zero, you will be 
able to do sorts using string comparison, for several centuries.

Actually your approach makes a great deal of sense.  Ten bytes (or eleven 
if signed) instead of four (now) or eight (eventually) for a time_t isn't 
too outrageous, and the costs of conversion and arithmetic aren't 
horrendous.

-- 
(Yet Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sat, 22 Aug 1998 08:03:31 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl Docs.. forget the original post
Message-Id: <3jfmr6.6gu.ln@metronet.com>

Simon Wistow (simon@new-mediacom.com) wrote:

: Some of us with window boxes don't have grep either (now there's an
: idea, hmmmm);


  No need for 'grep' if you have 'perl':

      perl -n -e 'print if /your keyword here/' *.pod


  If that finds too many hits, try searching only the "headings":

      perl -n -e 'print if /^=/ && /your keyword here/' *.pod


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 22 Aug 1998 22:19:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl Docs.. forget the original post
Message-Id: <MPG.10494645edd6880f9897e1@nntp.hpl.hp.com>

In article <3jfmr6.6gu.ln@metronet.com> on Sat, 22 Aug 1998 08:03:31 -
0500, Tad McClellan <tadmc@metronet.com> says...
> Simon Wistow (simon@new-mediacom.com) wrote:
> : Some of us with window boxes don't have grep either (now there's an
> : idea, hmmmm);
>   No need for 'grep' if you have 'perl':
>       perl -n -e 'print if /your keyword here/' *.pod
>   If that finds too many hits, try searching only the "headings":
>       perl -n -e 'print if /^=/ && /your keyword here/' *.pod

No need even to use command-line inputs such as these.  Point your 
Windows mouse to the Start button, which leads you to Find ... Files or 
Folders..., Advanced, Containing text: ...

Perhaps the 'Advanced' scares folks away.  Be brave, Simon.  If you can 
use Perl, you can use Micro$oft's Find capability.  Really.

-- 
(Yet Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sat, 22 Aug 1998 23:13:39 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Perl documentation
Message-Id: <35DF88E3.84A78A79@erols.com>

Ok, howse about this:

When I read man pages in XEmacs, it happens to be smart enough to create links to other man pages, I guess from parsing the nroff source.

Now straight man has no such thing. HTML pages do however. So, here's a rather long, complicated idea. But, "it's just so crazy it just might work!"

1) Make sure the POD is "right". Create proper L<> tags for all the non-perl man page refs in the perl docs (if there aren't already). Add refs to the corresponding man pages where they should be, but are not today. 

2) Add a "make the html" option to the Perl installation. Better yet, force HTML generation in addition to manpage generation. Yes, I know you should push all that stuff to a web server, but it's just as easy to load a local HTML file into Netscape. I'd install it all in the /usr/local/perl/man tree side by side with the man pages.

So far, this is easy stuff. Now comes the hard part. <grin>

3) Someone needs to write 'nroff2html'. The perl installation could simply translate the whole man tree or grep the perl pod for man refs and just translate those. Voila! HTML'd man pages and live links in the perl docs.

Sound like a plan?

No, I have no idea if it's possible. I know zero about nroff. Just food for thought.

-- 
#!/usr/bin/perl -- Matthew O. Persico
print "Just Another Perl Neophyte\n";
## Simplicity is a blessing when you're 
## supporting the program at 2AM


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

Date: 22 Aug 1998 20:18:05 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl documentation
Message-Id: <m3hfz4jsia.fsf@windlord.Stanford.EDU>

Matthew O Persico <mpersico@erols.com> writes:

> 3) Someone needs to write 'nroff2html'. The perl installation could
> simply translate the whole man tree or grep the perl pod for man refs
> and just translate those. Voila! HTML'd man pages and live links in the
> perl docs.

nroff2html has already been written, actually; it's called rman.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Sat, 22 Aug 1998 08:55:15 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Send cmd and Receive result from command?
Message-Id: <3kimr6.emu.ln@metronet.com>

8\(F&@ (versace@gianni.com) wrote:

: How to do that? I'd tried 

[snip code]

: Please help!

   You have already been helped!

   Find out where the documentation that came with your perl is,
   and have a look now and again.


   Perl FAQ, part 8:

      "How can I open a pipe both to and from a command?"

      "Why can't I get the output of a command with system()?"

      "How can I capture STDERR from an external command?"



   That last one is not obviously applicable from the quoted question,
   but it reviews the three ways of executing external programs from
   within Perl.



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sun, 23 Aug 1998 03:45:53 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Someone playing games or a badly configured server
Message-Id: <35e086fa.262228670@nntpd.databasix.com>

Further checks show that I'm not the only "victim" of this.  

Charles F Hankel in the thread COBOL and Perl
Ronald J Kimnall in Why dont people read the FAQs
Craig Berry in Why don't people read the FAQs
Michael J. Carman in NEWBIE Question: Perl Script In Unix vs...
Larry Rosler in Is Perl5.004 Year 2000 compliant?
Roland J Kimball in How to sort this associative array?
Larry Rosler in Perl Documentation
Ronald J Kimball in Perl Documentation
Craig Berry in Perl Documentation


Each time, the nntp posting host on the duplicates is
isdn-brg.eunet.no

and the message ID ends in elle.eunet.no


Ideas?















On Sun, 23 Aug 1998 02:46:26 GMT, in article
<35df8257.261042004@news.primenet.com>, gburnore@databasix.com (Gary L.
Burnore) wrote:

>On Sat, 22 Aug 1998 14:56:23 GMT, in article
><35f0dbae.218369869@nntpd.databasix.com>, gburnore@databasix.com (Gary L.
>Burnore) wrote:
>
>
>Post snipped.
>
>Looks like someone is playing games.  Note the message ID's and posting hosts
>on the following as they did not come from databasix.com
>
>
>Newsgroups: comp.lang.perl.misc
>Subject: Re: Why dont people read the FAQs
>Date: Sat, 22 Aug 1998 14:56:23 GMT
>Organization: The Home Office in Wazoo, NE
>Lines: 39
>Message-ID: <35f0dbae.218369869@nntpd.databasix.com>
>References: <ant171908b49Rr9i@waveney.demon.co.uk>
><lnontkrb.fsf@mailhost.panix.com> <u7yasmof78.fsf@mch2pc21.tuwien.ac.at>
>Reply-To: whatpartofdontemailme@dontyouunderstand
>NNTP-Posting-Host: dbdev.databasix.com
>Mime-Version: 1.0
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Newsreader: Forte Agent 1.5/32.452
>X-No-Archive: yes
>Xref: news.primenet.com comp.lang.perl.misc:154817
>
>
>From: gburnore@databasix.com (Gary L. Burnore)
>Newsgroups: comp.lang.perl.misc
>Subject: Re: Why dont people read the FAQs
>Date: Sat, 22 Aug 1998 14:56:23 GMT
>Organization: The Home Office in Wazoo, NE
>Lines: 39
>Message-ID: <6rnekj$1au$1@elle.eunet.no>
>References: <ant171908b49Rr9i@waveney.demon.co.uk>
><lnontkrb.fsf@mailhost.panix.com> <u7yasmof78.fsf@mch2pc21.tuwien.ac.at>
>Reply-To: whatpartofdontemailme@dontyouunderstand
>NNTP-Posting-Host: p8.isdn-brg.eunet.no
>Mime-Version: 1.0
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Newsreader: Forte Agent 1.5/32.452
>X-No-Archive: yes
>Xref: news.primenet.com comp.lang.perl.misc:154886
>
>From: gburnore@databasix.com (Gary L. Burnore)
>Newsgroups: comp.lang.perl.misc
>Subject: Re: Why dont people read the FAQs
>Date: Sat, 22 Aug 1998 14:56:23 GMT
>Organization: The Home Office in Wazoo, NE
>Lines: 39
>Message-ID: <6rmmtj$ljg$2@elle.eunet.no>
>References: <ant171908b49Rr9i@waveney.demon.co.uk>
><lnontkrb.fsf@mailhost.panix.com> <u7yasmof78.fsf@mch2pc21.tuwien.ac.at>
>Reply-To: whatpartofdontemailme@dontyouunderstand
>NNTP-Posting-Host: p8.isdn-brg.eunet.no
>Mime-Version: 1.0
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Newsreader: Forte Agent 1.5/32.452
>X-No-Archive: yes
>Xref: news.primenet.com comp.lang.perl.misc:154842
>
>From: gburnore@databasix.com (Gary L. Burnore)
>Newsgroups: comp.lang.perl.misc
>Subject: Re: Why dont people read the FAQs
>Date: Sat, 22 Aug 1998 14:56:23 GMT
>Organization: The Home Office in Wazoo, NE
>Lines: 39
>Message-ID: <6rmmq8$la3$1@elle.eunet.no>
>References: <ant171908b49Rr9i@waveney.demon.co.uk>
><lnontkrb.fsf@mailhost.panix.com> <u7yasmof78.fsf@mch2pc21.tuwien.ac.at>
>Reply-To: whatpartofdontemailme@dontyouunderstand
>NNTP-Posting-Host: p8.isdn-brg.eunet.no
>Mime-Version: 1.0
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Newsreader: Forte Agent 1.5/32.452
>X-No-Archive: yes
>Xref: news.primenet.com comp.lang.perl.misc:154836
>
>From: gburnore@databasix.com (Gary L. Burnore)
>Newsgroups: comp.lang.perl.misc
>Subject: Re: Why dont people read the FAQs
>Date: Sat, 22 Aug 1998 14:56:23 GMT
>Organization: The Home Office in Wazoo, NE
>Lines: 39
>Message-ID: <6rmmi6$k1a$2@elle.eunet.no>
>References: <ant171908b49Rr9i@waveney.demon.co.uk>
><lnontkrb.fsf@mailhost.panix.com> <u7yasmof78.fsf@mch2pc21.tuwien.ac.at>
>Reply-To: whatpartofdontemailme@dontyouunderstand
>NNTP-Posting-Host: p8.isdn-brg.eunet.no
>Mime-Version: 1.0
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Newsreader: Forte Agent 1.5/32.452
>X-No-Archive: yes
>Xref: news.primenet.com comp.lang.perl.misc:154830
>
>From: gburnore@databasix.com (Gary L. Burnore)
>Newsgroups: comp.lang.perl.misc
>Subject: Re: Why dont people read the FAQs
>Date: Sat, 22 Aug 1998 14:56:23 GMT
>Organization: The Home Office in Wazoo, NE
>Lines: 39
>Message-ID: <6rmmdh$j53$1@elle.eunet.no>
>References: <ant171908b49Rr9i@waveney.demon.co.uk>
><lnontkrb.fsf@mailhost.panix.com> <u7yasmof78.fsf@mch2pc21.tuwien.ac.at>
>Reply-To: whatpartofdontemailme@dontyouunderstand
>NNTP-Posting-Host: p8.isdn-brg.eunet.no
>Mime-Version: 1.0
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Newsreader: Forte Agent 1.5/32.452
>X-No-Archive: yes
>Xref: news.primenet.com comp.lang.perl.misc:154824

-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: Sat, 22 Aug 1998 08:59:29 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Strange characters while writing in files
Message-Id: <1simr6.emu.ln@metronet.com>

joumdane@hotmail.com wrote:

: I'm writing a program whitch is handling files. When I write in any file a
: string, i find the string written but with more characters at the end of the
: string. a sample program whitch gives this is :

: $file = 'tmp1';
: open(TEST, ">$file" );

   You should always, yes always, check the return value from open() calls.

   Especially when you are having trouble with open() calls  ;-)


      open(TEST, ">$file" ) || die "could not open '$file'   $!";


: print TEST "HI" ;
: close <TEST> ;
        ^    ^
        ^    ^

: Anyone knows what's going on ?

   That is an *in*put operator.

   You opened the file for *out*put...



   close(TEST);
   or
   close TEST;

   should do it.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 22 Aug 1998 22:30:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Strange characters while writing in files
Message-Id: <MPG.104948b4bd420c279897e2@nntp.hpl.hp.com>

In article <1simr6.emu.ln@metronet.com> on Sat, 22 Aug 1998 08:59:29 -
0500, Tad McClellan <tadmc@metronet.com> says...
> joumdane@hotmail.com wrote:
 ...
> : close <TEST> ;
>         ^    ^
>         ^    ^
> 
> : Anyone knows what's going on ?
> 
>    That is an *in*put operator.
> 
>    You opened the file for *out*put...
>
>    close(TEST);
>    or
>    close TEST;
> 
>    should do it.

     close TEST or die "could not close '$file' $!";

should do it even better.  As Tom C pointed out in his talk on Perl style 
at the Perl Conference, failure to check every print statement is 
understandable laziness.  Failure to check every close statement when 
writing to a file is sloth.  (My words, not his; but his point.)  File 
systems do get full and writes do fail, and it's nice to notice it 
eventually.

-- 
(Yet Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sat, 22 Aug 1998 23:30:48 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Substitution issue.
Message-Id: <ot5or6.nf1.ln@metronet.com>

Kevin Holbrook (kevin@templegames.com) wrote:

: I am trying to substitute all commas in a string between double quotes
: with carats.

: I have tried :

: 1 while ($string =~ s/\"(.*?)\,(.*?)\"/$1^$2/g);
                        ^      ^      ^
                        ^      ^      ^ you don't need any of these escapes...

                                        you only need to escape characters
                                        that have special meaning in
                                        regexen. Commas and double
                                        quotes do not mean anything
                                        special in a regex...


   Note that the double quotes are not getting put back into the
   replacement string. Subsequent attempts cannot match because
   the double quotes are gone.

     1 while ($string =~ s/(".*?),(.*?")/$1^$2/);
                            ^         ^        ^ don't need the s///g either
                            ^         ^ keep the quotes

   You might also note that the .*? _can_ match a double quote, if
   that is what is needed to make the match succeed. See what it
   does with:

      $string = '"no commas here", "Hello, this, is, a, test"';


   I don't think you want to be changing commas that are _not_
   within double quotes. So write the regex so that it will
   _only_ match paired double quotes:

      $string =~ s!("[^"]*")! ($s=$1) =~ tr/,/^/; $s !ge;


   That also will work fine on multiline strings. 
   No need for a s///s modifier (because there are no dots in the regex).


: Also :

: $string =~ s/\"(.*?)\,(.*?)\"/$1^$2/gs;
                                       ^
                                       ^ so these might be multiline strings?

                                         if so, why no s///s on the first
                                         regex above?


    s///g "remembers" where it left off, so it will pick up trying
    to find a match _after_ the second quote.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 22 Aug 1998 08:49:37 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: why doesn't this work as expected...
Message-Id: <h9imr6.klu.ln@metronet.com>

Ken McNamara (conmara@tcon.net) wrote:

: Now I know why I need to follow this news group.  

: Turns out 'tr///' does not use
: regular expressions.  

: Probably obvious to long time Perl afficionados - 


   Because long time Perl afficionados look up functions in the
   documentation that comes with the functions  ;-)


: but that
: fact is a really obscure detail in the docs I have.


   What docs are you refering to?



   I expect that you also have the "standard" docs that come
   with perl?

   They should always be preferred over any others. They are updated
   with each new version of perl.



--------- perlop manpage ----------
=item tr/SEARCHLIST/REPLACEMENTLIST/cds

=item y/SEARCHLIST/REPLACEMENTLIST/cds

Translates all occurrences of the characters found in the search list
with the corresponding character in the replacement list.  It returns
the number of characters replaced or deleted. [snip rest]
-----------------------------------

   No mention of regular expressions anywhere in the description of tr///;

   If it seems obscure that 'tr///' does not use regular expressions,
   could you please help identify how to make it more clear?

   (or are you referring to some other documentation?)


   Obscurity is a bug in the documentation. Documentation is updated
   right along with the internal perl implementation code. You can
   report it to perl's maintainers by using the 'perlbug' program
   that also comes with the perl distribution.
  

: Thanks for posting this question - you saved me some grief!


   Check the docs for fu(rther|ture) grief relief.

   ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 22 Aug 1998 23:00:51 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Why dont people read the FAQs
Message-Id: <35DF85E3.4CA781E7@erols.com>

Gary L. Burnore wrote:
> 
> On Mon, 17 Aug 1998 20:23:08 +0100, in article
> <ant171908b49Rr9i@waveney.demon.co.uk>, Richard Proctor
> <Richard@waveney.demon.co.uk> wrote:
> 

> >7) A lot of postings come to clp.misc that are really about servers and cgi,
> >this represents a major use of perl and results from people looking here
> >because of the perl content, maybe there should be a clp.cgi?
> 
> DingDingDingDing.  Now this makes sense.  Great idea.
> 

I'll second that. If I get a few minutes to breathe around here, I'll try to locate the "How to start a new newsgroup" docs and see what I can do.

-- 
#!/usr/bin/perl -- Matthew O. Persico
print "Just Another Perl Neophyte\n";
## Simplicity is a blessing when you're 
## supporting the program at 2AM


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

Date: Sun, 23 Aug 1998 03:54:46 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: Why dont people read the FAQs
Message-Id: <35e3926e.265161378@nntpd.databasix.com>

On Sat, 22 Aug 1998 23:00:51 -0400, in article <35DF85E3.4CA781E7@erols.com>,
"Matthew O. Persico" <mpersico@erols.com> wrote:

>Gary L. Burnore wrote:
>> 
>> On Mon, 17 Aug 1998 20:23:08 +0100, in article
>> <ant171908b49Rr9i@waveney.demon.co.uk>, Richard Proctor
>> <Richard@waveney.demon.co.uk> wrote:
>> 
>
>> >7) A lot of postings come to clp.misc that are really about servers and cgi,
>> >this represents a major use of perl and results from people looking here
>> >because of the perl content, maybe there should be a clp.cgi?
>> 
>> DingDingDingDing.  Now this makes sense.  Great idea.
>> 
>
>I'll second that. If I get a few minutes to breathe around here, I'll try to locate the "How to start a new newsgroup" docs and see what I can do.

I'll be glad to assist. Maybe Russ will as well.
-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: 23 Aug 1998 02:04:25 GMT
From: lvirden@cas.org
Subject: Re: Why dont people read the FAQs
Message-Id: <6rntb9$8k5$1@srv38s4u.cas.org>


On the other hand, if folk used email, the entire world would quit seeing
two , three, or in this case _SEVEN_ copies of the identical msg ...
-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

Date: 23 Aug 1998 02:05:32 GMT
From: lvirden@cas.org
Subject: Re: Why dont people read the FAQs
Message-Id: <6rntdc$8of$1@srv38s4u.cas.org>


I sure wish folk WOULD wait a few weeks instead of sending 7, 8 or more
copies of the same posting to this newsgroup.
-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

Date: Sun, 23 Aug 1998 05:39:59 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: Why dont people read the FAQs
Message-Id: <35e2ab07.271459687@nntpd.databasix.com>

On 23 Aug 1998 02:04:25 GMT, in article <6rntb9$8k5$1@srv38s4u.cas.org>,
lvirden@cas.org wrote:

>
>On the other hand, if folk used email, the entire world would quit seeing
>two , three, or in this case _SEVEN_ copies of the identical msg ...

If eunet.no would stop the abuse or misconfiguration of their server, there'd
only BE one post.   But you missed that, right?

-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: Sun, 23 Aug 1998 05:41:15 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: Why dont people read the FAQs
Message-Id: <35e3ab36.271505914@nntpd.databasix.com>

On 23 Aug 1998 02:05:32 GMT, in article <6rntdc$8of$1@srv38s4u.cas.org>,
lvirden@cas.org wrote:

>
>I sure wish folk WOULD wait a few weeks instead of sending 7, 8 or more
>copies of the same posting to this newsgroup.

Can you not see that the posts are being duplicated?  Do you know how to read
headers?  If not, you should learn. If so, stfu.
-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: Sat, 22 Aug 1998 23:17:24 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
To: RonaldWS <ronaldws@aol.com>
Subject: Re: Win32 perl, XS and VC++ 6
Message-Id: <35DF89C4.1A61B464@erols.com>

Sorry, I'm not that far out there. But maybe I can save you a few bucks. I recently compiled the core 5.005_02 distribution with the LEARNING edition of VC++ 5. It's only US$99 as opposed to the full-bown version. I'd try the corresponding cheapo version of vc++ 6.

-- 
#!/usr/bin/perl -- Matthew O. Persico
print "Just Another Perl Neophyte\n";
## Simplicity is a blessing when you're 
## supporting the program at 2AM


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 3515
**************************************

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