[14048] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1458 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 22 12:15:33 1999

Date: Mon, 22 Nov 1999 09:15:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <943290921-v9-i1458@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 22 Nov 1999     Volume: 9 Number: 1458

Today's topics:
    Re: Simple help <sariq@texas.net>
        Simple s#this string#that string# doesn't work? <rjsmith@uk.oracle.com>
    Re: Simple s#this string#that string# doesn't work? <rhomberg@ife.ee.ethz.ch>
    Re: Simple s#this string#that string# doesn't work? (Tad McClellan)
    Re: Simple s#this string#that string# doesn't work? <rjsmith@uk.oracle.com>
        Sockets. plee22@my-deja.com
        Somewhat general question zeushao@my-deja.com
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
        Write to and read from flat files <Richard.Koudry@bt.com>
    Re: Write to and read from flat files <gellyfish@gellyfish.com>
    Re: Write to and read from flat files <rhomberg@ife.ee.ethz.ch>
    Re: Y2K in perl (David Cantrell)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 22 Nov 1999 08:42:32 -0600
From: Tom Briles <sariq@texas.net>
Subject: Re: Simple help
Message-Id: <38395658.76641CF@texas.net>

Larry Rosler wrote:
> 
> In article <3835769C.6D903FD8@texas.net> on Fri, 19 Nov 1999 10:11:08 -
> 0600, Tom Briles <sariq@texas.net> says...
> 
> ...
> 
> > But here's my shot at it (though I don't know why Larry thinks Jack
> > Nicklaus would be teaching bowling).
> 
> Testing to see if anybody would actually read the data.  You pass!

Woohoo!

> > /\s+(99.+)\s{2}/ and push @students, $1 while (<DATA>);
> 
> But that should be non-greedy (99.+?), so you don't need the next step
> that strips the trailing whitespace.

Well, my test data had consecutive spaces *within* the name.  Granted,
that was not seen in the original poster's data (same with non-alpha
characters, for which I also accounted).

Any graceful ideas on how to strip the trailing whitespace, without an
additional loop through the hash/array, are welcome.

- Tom


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

Date: Mon, 22 Nov 1999 11:22:36 +0000
From: Reg Smith <rjsmith@uk.oracle.com>
Subject: Simple s#this string#that string# doesn't work?
Message-Id: <3839277C.A0B7746F@uk.oracle.com>

This is a multi-part message in MIME format.
--------------57E585B5F3D6F898E57D6BE9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello

I hope I'm doing something stupid, because this apparently simple
substitute is driving me nuts!

I have a HTML file that I want to update some values in when the file
gets checked into Clearcase (a source code control system). Clearcase
runs a perl script on the HTML file when it gets checked in.

What I have done is to surround the strings I want to replace with HTML
comment tags, to simplify searching for them. e.g.

In the HTML file, there is a line like this;

<!-- CC_ID_STR -->\main\work_in_progress\5<!-- CC_ID_STR -->

The "\main\work_in_progress\5" is the clearcase version that I want to
update everytime a new version is created each time it is cheched in.
This version can be obtained from the environment via the %ENV hash as
clearcase sets it as an enviroment variable.

To replace the version string the perl script itself just uses

s#<!-- CC_ID_STR -->.*?<!-- CC_ID_STR -->#<!-- CC_ID_STR
-->$CC_ID_STR<!-- CC_ID_STR -->#s;

I expected this to simply replace the version

<!-- CC_ID_STR -->\main\work_in_progress\5<!-- CC_ID_STR -->

 ..with

<!-- CC_ID_STR -->\main\work_in_progress\6<!-- CC_ID_STR -->

 ..and keep the <!-- CC_ID_STR --> tags for the next time.

(I used the ...#s; in case any of the web page editors people might use
decided to put the <!-- CC_ID_STR --> tags on different lines)

But what is actually happenning is that the <!-- CC_ID_STR --> tags are
not appearing in the new file at all, but the new version is;

Line in OLD file
<!-- CC_ID_STR -->\main\work_in_progress\5<!-- CC_ID_STR -->

Replaced line in NEW file
\main\work_in_progress\6

Why have the literally typed <!-- CC_ID_STR --> tags disappeared? The
search part of the operation obviously found them as it has replaced the
actual version correctly, so it doesn't look like the \'s in the version
string have affected anything? Am I being dumb?

Thanks in advance

Reg Smith

--

______________________________________________________________________________

Reg Smith                               Tel: +44 (0)118 924 3063 (Direct
Line)
System Administrator                    Tel: +44 (0)118 924 5500
(Support)
520 Oracle Parkway                      Fax: +44 (0)118 9245148
Thames Valley Park, Reading, RG6 1DA    E-mail: rjsmith@uk.oracle.com
______________________________________________________________________________

Development Services
http://des2000.uk.oracle.com/devserv/
Oracle Common Development Framework     http://www-ocdf.uk.oracle.com
______________________________________________________  __  __ _  __ .
__
                                                       (__)|-</-\(__ |__
-_


--------------57E585B5F3D6F898E57D6BE9
Content-Type: text/x-vcard; charset=us-ascii;
 name="rjsmith.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Reg Smith
Content-Disposition: attachment;
 filename="rjsmith.vcf"

begin:vcard 
n:Smith;Reg
tel;fax:0118 92 40509
tel;work:0118 92 43063
x-mozilla-html:FALSE
org:Oracle UK;Development Services
version:2.1
email;internet:rjsmith@uk.oracle.com
title:System Administrator II
adr;quoted-printable:;;520 Oracle Parkway=0D=0AThames Valley Park;Reading;Berks;RG6 1DA;UK
fn:Reg Smith
end:vcard

--------------57E585B5F3D6F898E57D6BE9--



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

Date: Mon, 22 Nov 1999 14:25:05 +0100
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Simple s#this string#that string# doesn't work?
Message-Id: <38394431.F714C94B@ife.ee.ethz.ch>

Reg Smith wrote:
> 
> What I have done is to surround the strings I want to replace with HTML
> comment tags, to simplify searching for them. e.g.
> 
> In the HTML file, there is a line like this;
> 
> <!-- CC_ID_STR -->\main\work_in_progress\5<!-- CC_ID_STR -->
> 
> s#<!-- CC_ID_STR -->.*?<!-- CC_ID_STR -->#<!-- CC_ID_STR
> -->$CC_ID_STR<!-- CC_ID_STR -->#s;
> 
> But what is actually happenning is that the <!-- CC_ID_STR --> tags are
> not appearing in the new file at all, but the new version is;
> 
> Line in OLD file
> <!-- CC_ID_STR -->\main\work_in_progress\5<!-- CC_ID_STR -->
> 
> Replaced line in NEW file
> \main\work_in_progress\6

Did you test what you posted?
Just testing your code indicates to me that it is working correctly:

$_ = '<!-- CC_ID_STR -->\main\work_in_progress\5<!-- CC_ID_STR -->';
my $CC_ID_STR = "/main/work_in_progress/6";

s[<!-- CC_ID_STR -->.*?<!-- CC_ID_STR -->]
 [<!-- CC_ID_STR -->$CC_ID_STR<!-- CC_ID_STR -->]s;
print "$_\n";

prints the correct string.

I'd change some stuff to shorten it and minimize the probability of
typing errors:

my $tag = qr#<!-- CC_ID_STR -->#;

s#(?<=$tag).*?(?=$tag)#$CC_ID_STR#s;

- Alex
PS: cut your .sig by about 10 lines and a useless vcard


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

Date: Mon, 22 Nov 1999 04:53:49 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Simple s#this string#that string# doesn't work?
Message-Id: <slrn83i4ld.7hv.tadmc@magna.metronet.com>

On Mon, 22 Nov 1999 11:22:36 +0000, Reg Smith <rjsmith@uk.oracle.com> wrote:
>This is a multi-part message in MIME format.
>--------------57E585B5F3D6F898E57D6BE9
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit


>I hope I'm doing something stupid, 


   Yes, you are;


   1) posting MIME to the plain-text Usenet medium

   2) long sig

   3) vcard crap

   4) funky word-wrap



   To fix that, and get more and better responses to Usenet posts:

   1) monitor     news.announce.newusers   for a couple of weeks

   2) configure your "newsreader" properly (or, use a real newsreader)



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


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

Date: Mon, 22 Nov 1999 16:43:07 +0000
From: Reg Smith <rjsmith@uk.oracle.com>
Subject: Re: Simple s#this string#that string# doesn't work?
Message-Id: <3839729B.49C03FE0@uk.oracle.com>

I can certainly remove the vcard, but as for the choice of newreader, at the
moment my company has just moved everyone over to using Netscape, so by default
that's why I'm using it, not out of malicious disregard for newgroup postings.

Do you have any recommendations for a more newsgroup friendly reader?

Best wishes

Reg



Tad McClellan wrote:

> On Mon, 22 Nov 1999 11:22:36 +0000, Reg Smith <rjsmith@uk.oracle.com> wrote:
> >This is a multi-part message in MIME format.
> >--------------57E585B5F3D6F898E57D6BE9
> >Content-Type: text/plain; charset=us-ascii
> >Content-Transfer-Encoding: 7bit
>
> >I hope I'm doing something stupid,
>
>    Yes, you are;
>
>    1) posting MIME to the plain-text Usenet medium
>
>    2) long sig
>
>    3) vcard crap
>
>    4) funky word-wrap
>
>    To fix that, and get more and better responses to Usenet posts:
>
>    1) monitor     news.announce.newusers   for a couple of weeks
>
>    2) configure your "newsreader" properly (or, use a real newsreader)
>
> --
>     Tad McClellan                          SGML Consulting
>     tadmc@metronet.com                     Perl programming
>     Fort Worth, Texas

--



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

Date: Mon, 22 Nov 1999 16:20:25 GMT
From: plee22@my-deja.com
Subject: Sockets.
Message-Id: <81bqg2$55s$1@nnrp1.deja.com>

I am tryig to connect to a socket on an NT workstation that is in use
by abother application.  I wish to see the transfers between the client
and server on port 5010. simply logger.

I do not know how to attached my socket object to the already opened
socket for listening.  Any ides on how this is done?

Thanks,
Pete


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 22 Nov 1999 16:38:08 GMT
From: zeushao@my-deja.com
Subject: Somewhat general question
Message-Id: <81brh8$60j$1@nnrp1.deja.com>

Hello. I'm having a bit of trouble with something that seems pretty
easy at first. I'm writing a web doohickey to display results from an
already-written search tool.

I have a bunch of data that looks something like this:

file a
 record a1
 record a2
 record a3
file b
 record b1
 record b2
file c
 record c1
 record c2
 record c3
 record c4

 ...

This is how the data arrives, more or less. I wish to display about 150
records per page. At the top of the page, I print out links to the
different pages. I was doing this by sending a variable s to this
script indicating which record should be the first record. However, now
I need to display things so that if the bottom of the search results
ends on file c, clicking on "page 2" takes you to the top of file d.
And, just as importantly, clicking on "page 6" takes you to the top of
file z (or whatever). I'm having trouble figuring out how to do this.
Anyone got any ideas?

--Me


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 22 Nov 1999 15:05:02 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <81bm2u$3f8$1@info2.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 15 Nov 1999 15:06:45 GMT and ending at
22 Nov 1999 07:59:24 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 1999 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Excluded Posters
================

perlfaq-suggestions\@(?:.*\.)?perl\.com

Totals
======

Posters:  507
Articles: 1926 (1068 with cutlined signatures)
Threads:  472
Volume generated: 3260.8 kb
    - headers:    1510.7 kb (30,107 lines)
    - bodies:     1564.9 kb (49,928 lines)
    - original:   996.0 kb (34,907 lines)
    - signatures: 183.3 kb (3,764 lines)

Original Content Rating: 0.636

Averages
========

Posts per poster: 3.8
    median: 1 post
    mode:   1 post - 300 posters
    s:      13.1 posts
Posts per thread: 4.1
    median: 3.0 posts
    mode:   2 posts - 111 threads
    s:      4.7 posts
Message size: 1733.7 bytes
    - header:     803.2 bytes (15.6 lines)
    - body:       832.0 bytes (25.9 lines)
    - original:   529.5 bytes (18.1 lines)
    - signature:  97.5 bytes (2.0 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

  167   276.7 (126.4/130.6/ 61.6)  Jonathan Stowe <gellyfish@gellyfish.com>
  148   232.9 (108.9/ 96.9/ 52.9)  kragen@dnaco.net (Kragen Sitaker)
  116   193.5 ( 93.4/ 86.6/ 51.4)  David Cassell <cassell@mail.cor.epa.gov>
   78   197.3 ( 88.0/ 76.5/ 73.1)  abigail@delanet.com
   71   121.6 ( 45.7/ 67.8/ 35.4)  Larry Rosler <lr@hpl.hp.com>
   59    96.2 ( 56.0/ 33.4/ 20.9)  Tom Phoenix <rootbeer@redcat.com>
   57   119.3 ( 52.1/ 50.1/ 26.4)  Uri Guttman <uri@sysarch.com>
   43    87.4 ( 32.8/ 46.0/ 27.6)  mgjv@comdyn.com.au
   24    33.8 ( 17.8/ 15.9/  5.7)  Tom Briles <sariq@texas.net>
   23    33.4 ( 16.7/ 10.7/  5.2)  bmccoy@foiservices.com

These posters accounted for 40.8% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

 276.7 (126.4/130.6/ 61.6)    167  Jonathan Stowe <gellyfish@gellyfish.com>
 232.9 (108.9/ 96.9/ 52.9)    148  kragen@dnaco.net (Kragen Sitaker)
 197.3 ( 88.0/ 76.5/ 73.1)     78  abigail@delanet.com
 193.5 ( 93.4/ 86.6/ 51.4)    116  David Cassell <cassell@mail.cor.epa.gov>
 121.6 ( 45.7/ 67.8/ 35.4)     71  Larry Rosler <lr@hpl.hp.com>
 119.3 ( 52.1/ 50.1/ 26.4)     57  Uri Guttman <uri@sysarch.com>
  96.2 ( 56.0/ 33.4/ 20.9)     59  Tom Phoenix <rootbeer@redcat.com>
  87.4 ( 32.8/ 46.0/ 27.6)     43  mgjv@comdyn.com.au
  46.8 ( 16.9/ 25.8/ 16.7)     20  lee.lindley@bigfoot.com
  37.7 ( 14.9/ 22.7/ 18.2)     17  mjd@op.net (Mark-Jason Dominus)

These posters accounted for 43.2% of the total volume.

Top 10 Posters by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

1.000  (  3.8 /  3.8)      7  dillon_rm@magix.com.sg
0.984  (  1.9 /  2.0)      5  "Martin Elliott" <martin@mert.globalnet.co.uk>
0.955  ( 73.1 / 76.5)     78  abigail@delanet.com
0.949  (  2.1 /  2.2)      7  Waranun Bunjongsat <bunjonwa@trek.CS.ORST.EDU>
0.903  (  1.1 /  1.2)      6  Re'em Bar <reembar@netvision.net.il>
0.817  (  3.9 /  4.8)      5  "John Lin" <johnlin@chttl.com.tw>
0.799  ( 18.2 / 22.7)     17  mjd@op.net (Mark-Jason Dominus)
0.726  (  7.1 /  9.7)     10  Jeff Zucker <jeff@vpservices.com>
0.716  (  5.4 /  7.5)     12  scott@aravis.softbase.com (Scott McMahan)
0.700  (  8.6 / 12.3)     20  "Alan J. Flavell" <flavell@mail.cern.ch>

Bottom 10 Posters by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.439  (  4.9 / 11.3)     15  ilya@math.ohio-state.edu (Ilya Zakharevich)
0.429  (  4.8 / 11.1)     11  anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
0.422  (  4.1 /  9.7)     10  sholden@cs.usyd.edu.au
0.410  (  4.4 / 10.8)     14  Ala Qumsieh <aqumsieh@matrox.com>
0.393  (  5.3 / 13.6)      9  "Jakob" <asd@ds.aw>
0.375  (  1.7 /  4.5)      5  Jaime Perez <jaimedp@pacbell.net>
0.363  (  2.4 /  6.6)      7  jaws@mindspring.com (John Armsby)
0.360  (  5.7 / 15.9)     24  Tom Briles <sariq@texas.net>
0.336  (  1.8 /  5.3)      5  "Wyzelli" <wyzelli@yahoo.com>
0.330  (  1.3 /  3.8)      5  Mike Wescott <Mike.Wescott@ColumbiaSC.NCR.COM>

62 posters (12%) had at least five posts.

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   44  Fetch Dilbert.
   26  Is there no  length()  function?
   25  Trying to use a variable as an operator
   24  file descriptors already used when perl starts
   21  Simple help
   21  Perl programming sytle
   20  Generating pi
   20  environment vars
   17  legal names and about sorting
   17  Please help me create a file with perl

These threads accounted for 12.2% of all articles.

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  84.7 ( 37.7/ 38.8/ 23.8)     44  Fetch Dilbert.
  53.0 ( 21.5/ 28.1/ 19.0)     25  Trying to use a variable as an operator
  51.8 ( 21.5/ 26.6/ 19.5)     24  file descriptors already used when perl starts
  51.2 ( 16.4/ 33.6/ 14.9)     21  Simple help
  41.5 ( 17.7/ 21.2/ 10.4)     20  environment vars
  38.7 ( 22.0/ 14.3/  9.3)     26  Is there no  length()  function?
  36.6 ( 12.7/ 22.0/ 13.1)     17  legal names and about sorting
  33.3 ( 16.1/ 16.3/  9.5)     20  Generating pi
  33.0 ( 16.5/ 13.8/  9.0)     21  Perl programming sytle
  32.5 ( 11.8/ 19.3/ 13.5)     14  Is $$variable allowed like in PHP ?

These threads accounted for 14.0% of the total volume.

Top 10 Threads by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.834  (  2.9/   3.5)      5  newbie : looking for a script that reads all  the file names in the directory
0.821  (  5.1/   6.3)      8  help need please on perl
0.814  (  3.8/   4.7)      8  Can't get hostname with gethostbyaddr
0.800  (  4.2/   5.2)      7  reading html files
0.798  (  1.4/   1.8)      6  reading one line at a time
0.787  (  4.7/   6.0)      8  Longest match
0.774  (  1.5/   1.9)      6  How to Capitalize the first letter of a word an or whole word
0.769  (  1.8/   2.3)      7  unwanted refresh with Apache server
0.767  (  4.3/   5.5)     13  Can Perl return the ASCII code for a given character?
0.765  (  6.7/   8.7)      5  New dialect of perl: xperl (or reinventing perl, or perl-izing jpython)

Bottom 10 Threads by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.440  (  1.9 /  4.3)      7  MD5 encryption
0.437  (  2.6 /  5.9)      8  FAQ 5.3: How do I count the number of lines in a file?
0.433  (  3.3 /  7.7)     10  How to sort lines of plain text db file ?
0.429  (  0.9 /  2.1)      6  looking for a developer . . .
0.418  (  1.6 /  3.9)      6  openin file on client machine
0.415  (  2.0 /  4.7)      6  File::Find on Win32 :-( - getit4.pl (0/1)
0.412  (  2.6 /  6.3)     10  how to send data back and forth over sockets
0.400  (  3.2 /  8.1)      8  Keeping string on same line
0.391  (  2.0 /  5.1)      6  CHMOD for Net::FTP. Help, cool hackers !
0.281  (  0.9 /  3.2)      5  ###### GET YOUR PentiumII-366 FOR ONLY $9.99 #######;dlkh 0596';  gp[5ifkl'l

139 threads (29%) had at least five posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      26  comp.lang.perl.modules
      26  alt.perl
      14  comp.lang.apl
      12  comp.lang.perl
      11  comp.os.linux.setup
      11  comp.os.linux.networking
      11  comp.os.linux.advocacy
      11  comp.os.linux.misc
      10  alt.comp.perlcgi.freelance
       6  comp.databases.oracle.misc

Top 10 Crossposters
===================

Articles  Address
--------  -------

      15  kragen@dnaco.net (Kragen Sitaker)
      12  David Cassell <cassell@mail.cor.epa.gov>
       8  zlatko@gmx.at
       7  Jonathan Stowe <gellyfish@gellyfish.com>
       7  "Alan J. Flavell" <flavell@mail.cern.ch>
       6  "Tom Clark" <tomclark@btinternet.com>
       6  bmlam <310064202272#0001@online.de>
       6  Tom Briles <sariq@texas.net>
       5  dha@panix.com (David H. Adler)
       5  mjd@op.net (Mark-Jason Dominus)


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

Date: Mon, 22 Nov 1999 15:27:51 +0000
From: Richard Koudry <Richard.Koudry@bt.com>
Subject: Write to and read from flat files
Message-Id: <383960F7.F36DF9AA@bt.com>

CGI: write to & Read from flat files

I need help with two CGI scripts: one to write form data to a flat file
and the other to read data from a flat file and display it on the
browser.

Can you help please

Richard.Koudry@bt.com
Tel 01793 547048





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

Date: 22 Nov 1999 15:53:22 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Write to and read from flat files
Message-Id: <383966f2_2@newsread3.dircon.co.uk>

Richard Koudry <Richard.Koudry@bt.com> wrote:
> CGI: write to & Read from flat files
> 
> I need help with two CGI scripts: one to write form data to a flat file
> and the other to read data from a flat file and display it on the
> browser.
> 

Why dont you make one that does both things ?

/J\
-- 
"Do you want to go to court today?" - BBC News Website


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

Date: Mon, 22 Nov 1999 17:17:37 +0100
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Write to and read from flat files
Message-Id: <38396CA1.3DF3175@ife.ee.ethz.ch>

Richard Koudry wrote:
> I need help with two CGI scripts: one to write form data to a flat file
> and the other to read data from a flat file and display it on the
> browser.

well, then show as the portion of your CGI script where your Perl
problem is.

I suspect that you have nothing at all and hope for us to do your work.
I'm in a good mood, so I post code which does what you asked:

#!/usr/bin/perl -wT
use strict;
#common header to here
#code for writing form data to file
use CGI;
my $q=CGI->new;
open OF, ">>hi" 
  and (map {print OF "$_=@{[$q->param($_)]}\n"} $q->param) || 1
  and close OF;

#code to read data from file and disply it on the browser
print "text/plain\n\n";
open IF, "hi" and print<IF> and close IF;

- Alex


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

Date: Mon, 22 Nov 1999 14:00:53 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Y2K in perl
Message-Id: <383a4b88.245556671@10.0.0.155>

On Fri, 19 Nov 1999 23:20:52 GMT, gqc2017@my-deja.com said:

>Hi, I am using localtime() in perl to get the current year.

Actually, that will only tell you what your computer's clock _thinks_
the current year is.  If you want the _correct_ value, then you should
use one of the many Internet date/time servers :-)

>Now what can I do to make my code Y2K compliant?

I don't know.  Perl is a language, and as such, has about as many Y2K
problems as Serbo-Croat and French do.  If you have identified a Y2K
problem, then the way to correct it is to upgrade your programmer.

-- 
David Cantrell, part-time Unix/perl/SQL/java techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 1458
**************************************


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