[10057] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3650 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 7 03:07:23 1998

Date: Mon, 7 Sep 98 00:00:25 -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           Mon, 7 Sep 1998     Volume: 8 Number: 3650

Today's topics:
    Re: a better read()? <samwang@freewwweb.com>
        Authentication <bsilva@gladstone.uoregon.edu>
        cannot find ananth@lankacom.net
        Getting rid of excess file space within a file without  <9401962@ml.petech.ac.za>
    Re: Hats off to Tom Phoenix (Norman UNsoliciteds)
    Re: How do I check if an input have only letters and nu (Larry Rosler)
    Re: I have too much free time..... <jwb79@mail.idt.net>
    Re: IO::File Permissions - Revisited <garry@america.net>
    Re: IO::File Permissions - Revisited <sneaker@sneex.fccj.org>
    Re: IO::File Permissions - Revisited <garry@america.net>
    Re: IO::File Permissions - Revisited (Martien Verbruggen)
    Re: Pattern matching specific (Gerry Buzzell)
        Please Help With Net::Telnet Login Prompt <bfb@att.net>
        print number lincr@usa.net
    Re: print number (Larry Rosler)
    Re: print number <ajohnson@gpu.srv.ualberta.ca>
        Printing images (A Watcher)
        Problems with require command (Michael Johns)
    Re: Regex/File/substitution/CGI (Ronald J Kimball)
        Text::CSV parsing sporadically (Steve Vertigan)
        Web Development Resources info@heliumweb.com
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sun, 06 Sep 1998 22:52:29 -0500
From: Sam Wang <samwang@freewwweb.com>
Subject: Re: a better read()?
Message-Id: <35F3587C.A73A8C37@freewwweb.com>

i'm talking about LENGTH. as i recall, you have to set this.

Martien Verbruggen wrote:

> In article <35F31AAB.EFEEC3B1@freewwweb.com>,
>         Sam Wang <samwang@freewwweb.com> writes:
> > i think it kinda sucks how you have to specify how big the buffer is for
> > read(). if you specify it too big, perl'll quit with an out of memory
> > error, too little and it might not be enough. is there a way around
> > this?
>
> Err...
>
> # perldoc -f read
> =item read FILEHANDLE,SCALAR,LENGTH,OFFSET
>
> =item read FILEHANDLE,SCALAR,LENGTH
>
> Attempts to read LENGTH bytes of data into variable SCALAR from the
> specified FILEHANDLE.  Returns the number of bytes actually read, or
> undef if there was an error.  SCALAR will be grown or shrunk to the
> length actually read.  An OFFSET may be specified to place the read
> data at some other place than the beginning of the string.  This call
> is actually implemented in terms of stdio's fread call.  To get a true
> read system call, see sysread().
>
> How do you specify the size of the buffer? Where does it say that you
> have to? This actually seems to imply that you don't have to set the
> size. I certainly never have.
>
> Martien
> --
> Martien Verbruggen                  |
> Webmaster www.tradingpost.com.au    | The world is complex; sendmail.cf
> Commercial Dynamics Pty. Ltd.       | reflects this.
> NSW, Australia                      |
>



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

Date: Sun, 6 Sep 1998 19:59:00 -0700
From: "Brian L. Silva" <bsilva@gladstone.uoregon.edu>
Subject: Authentication
Message-Id: <Pine.GSO.3.96.980906195610.21972A-100000@gladstone.uoregon.edu>


I am using Apache to require password authentication for a CGI system I've
coded in PERL. I was hoping someone could explain how I can retrieve the
username of the person who has been authenticated in PERL. Thanks!

- Brian



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

Date: Mon, 07 Sep 1998 06:21:00 GMT
From: ananth@lankacom.net
Subject: cannot find
Message-Id: <6svu0d$t4o$1@nnrp1.dejanews.com>

i am lost. can somebody tell me which is the the perl library, so that
readParse will create the perl associative array called $IN which contains
the values assigned to every form variable when the user fills out the form.
I am usin perl5 in AIX(IBM RS6000) platform

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 07 Sep 1998 08:24:41 +0200
From: Bruce Smith <9401962@ml.petech.ac.za>
Subject: Getting rid of excess file space within a file without closing and reopening
Message-Id: <35F37C28.D288E7C0@ml.petech.ac.za>

Hi there.

I am looking for some info on files and copying while locked with flock.
I have a file which gets parsed for lines that need to be deleted, and
the lines which have to be kept are written to a temp file. Once the
entire file is parsed, the situation is reversed and the temp file
contents are copied to the original file. I have to use locking and the
code I have come up with is as follows, running on a Linux 2.0.35 box
and Perl 5.004.

open(LOG, "+</log/death.log");
open(TMP, "+>/tmp/death.log/tmp");
flock(LOG, LOCK_EX);
flock(TMP, LOCK_EX);
while (<LOG>) {
    if (!(m/$Test/)) {
        print TMP "$_";
    }
}
seek(LOG, 0, 0);
seek(TMP, 0, 0);
while (<TMP>) {
    print LOG "$_";
}
close(LOG);
close(TMP);
unlink(TMP);

What happens with this is that the lines get removed as per spec, but
the last lines  of the file, ie the difference between the old file size
and the new file size remain. Is there any way to get around this, by
clearing the file before the second while loop, that does not release
the locks. The system that this runs on handles a lot of CGI script
execution and the files under these scripts are accessed frequently, and
it has happened that simple closing the file causes another script to
grab the lock and I end up with data corruption.

Thanks in advance

Bruce Smith



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

Date: Mon, 07 Sep 1998 13:37:08 +0900
From: No.unsoiliciteds@dead.end (Norman UNsoliciteds)
Subject: Re: Hats off to Tom Phoenix
Message-Id: <No.unsoiliciteds-0709981337080001@cs11o39.ppp.infoweb.or.jp>


can anybody point me to the Perl man page for the hypocrites in
synagogues() function :^). If it looks like a function....


In article <6spt2o$et1@news1.panix.com>, dha@panix.com (David Adler) wrote:

> On 4 Sep 1998 15:51:25 -0400, Chip Salzenberg <chip@pobox.com> wrote:
> >"Hence when you go making gifts of mercy, do not blow a trumpet ahead
> >of you, just as the hypocrites do in the synagogues and in the
> 
> Ah, you're just jealous 'cause you don't know how to play a ram's
> horn...  
> 
> Hypocrites in Synagogues, indeed... :-)
> 
> dave, pointing out the smiley, since people seem to often miss them
> during discussions of subjects such as religion

-- 
It took a learned man to teach me the true meaning 
of ignorance - the willingness to believe learning 
is finite
Norman Unsoliciteds -The Wilderness Years, Boscara Press 1967


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

Date: Sun, 6 Sep 1998 19:33:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How do I check if an input have only letters and numbers??
Message-Id: <MPG.105ce5c17778002d98982e@nntp.hpl.hp.com>

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

In article <35f30022.31243359@news.iaehv.nl> on Sun, 06 Sep 1998 21:41:19 
GMT, Focus@bigfoot.com <Focus@bigfoot.com> says...
> I'm new at this, so that's why I'm asking a really stupid question.
> How do I check if an input have only letters and numbers?? (So no
> weird characters like ~`!!#$%^&*()-_=+[]{};:<>,.?/@)

This is a language question, not a modules question.  The correct regex 
is either

/^[^\W_]*$/	# Matches "" or "\n"

or

/^[^\W_]+$/	# Requires at least one letter or digit

depending on how you want to classify an string that is empty or 
that consists only of a newline.  See `perldoc perlre` for details.

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


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

Date: 7 Sep 1998 03:59:06 GMT
From: "Jim Babbington" <jwb79@mail.idt.net>
Subject: Re: I have too much free time.....
Message-Id: <01bdda13$fe20d400$6488fdc7@dixon>



Garry Williams <garry@america.net> wrote in article <35F30AEE.3D65A719@america.net>...
: Well, I get the idea, but my shell wants to have a whack at those
: variables: 
: 
: $ perl -e "$_ = 'Guy';m/([G|g])(uy|al)/;print qq(Just another perl
: ${1}${2})"
: Can't modify constant item in scalar assignment at -e line 1, near
: "'Guy';"
: Execution of -e aborted due to compilation errors.
: 
: If I switch the single quotes for double quotes and vice versa, my shell
: leaves things alone: 
: 
: $ perl -e '$_ = "Guy";m/([G|g])(uy|al)/;print qq(Just another perl
: ${1}${2})'
: Just another perl Guy$
: 
: :-)  
: 
: -Garry Williams

Sorry about that Unix folks (my linux machine is broke). Hey, BTW, if I cant make up my mind on 
what OS I'm going to use, what if I can make up my mind on gender either?

Winderz: 
perl -e "use integer;$_ = 'Just another perl guy';@f=('al','uy');s/(.*)(G|g).*/$1${2}$f[rand(2)*1]/;print"

Unix(untested):
perl -e 'use integer;$_ = "Just another perl guy";@f=("al","uy");s/(.*)(G|g).*/$1${2}$f[rand(2)*1]/;print'

:-)
--
Happy hacking....

Jim




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

Date: Mon, 07 Sep 1998 01:59:23 GMT
From: Garry Williams <garry@america.net>
Subject: Re: IO::File Permissions - Revisited
Message-Id: <35F33E34.D76DC80D@america.net>

>From perldoc IO::File...

         If IO::File::open is given a numeric mode, it passes
         that mode and the optional permissions value to the Perl
         sysopen operator.  For convenience, IO::File::import
         tries to import the O_XXX constants from the Fcntl
         module.  

>From perldoc -f perlfunc...

         If the file named by FILENAME does not exist and the
         open call creates it (typically because MODE
         includes the O_CREAT flag), then the value of PERMS
         specifies the permissions of the newly created file.
         If PERMS is omitted, the default value is 0666,
         which allows read and write for all.  This default
         is reasonable: see umask.

>From perldoc -f umask...

         Sets the umask for the process to EXPR and returns
         the previous value.  If EXPR is omitted, merely 
         returns the current umask.  Remember that a umask 
         is a number, usually given in octal; it is I<not> 
         a string of octal digits.  See also L</oct>, if all 
         you have is a string.

That's not much help.  From man umask...

         The umask utility sets the file mode creation 
         mask of the current shell execution 
         environment to the value specified by the 
         mask operand.  This mask affects the initial 
         value of the file permission bits of 
         subsequently created files.  

Ah, heck.  The file is created under control of the umask.  Use chmod to
modify it or set the umask to something like 077 before creating the
file.  It looks like your umask is set to 022 instead.  (I know this is
documented somewhere, but the obvious path wasn't real clear, eh?)  

-Garry Williams

Bill 'Sneex' Jones wrote:
> 
> Perl IO::File Bug?
> 
> I do this:
> 
> #!/usr/bin/perl -w
> 
> use strict;
> use diagnostics;
> use IO;
> 
> # Get the date in the format of 'Sun Sep  6 18:04:46 1998'
> my $ltDate = localtime;
> 
> # Now get the Serialized Date, and string'em back together...
> my ($seconds, $minutes, $hour, $monthDate, $month,
> $year, $weekDay, $yearDate, $daylightSavings) = localtime;
> my $ltSerial =
> "$seconds$minutes$hour$monthDate$month$year$weekDay$yearDate$daylightSavings";
> 
> my $file = "test.File";
> my $fh = new IO::File $file, "a", "0600";
> 
> if (defined $fh) {
>    print $fh "$ltSerial|$ltDate\n";
>    undef $fh;
> } else { print "Oops! $!"; }
> 
> autoflush STDOUT 1;
> 
> But the test.File is still created 0644.
> What am I missing?
> 
> Any ideas,
> -Sneex-
> __________________________________________________________________
> Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
> __________________________________________________________________
> It is common sense to take a method and try it.  If it fails,
> admit it frankly and try another.  But above all, try something.
>                 -- Franklin D. Roosevelt


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

Date: Sun, 06 Sep 1998 22:19:29 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: IO::File Permissions - Revisited
Message-Id: <35F342B1.B859A8B8@sneex.fccj.org>

Garry Williams wrote:
> 
> <Snip stuff already read...>
>
> Ah, heck.  The file is created under control of the umask.  Use chmod to
> modify it or set the umask to something like 077 before creating the
> file.  It looks like your umask is set to 022 instead.  (I know this is
> documented somewhere, but the obvious path wasn't real clear, eh?)
> 
> -Garry Williams

I went thru several 
                    my $fh = new IO::File $file, "a", 0755;
                                                      ----
                                                      /
        different permission settings, thus ----------

IE, I tried 0600, 0755, 0700, 0444, etc...

And they all create the file with 0644...
(Yes, I am deleting the file between interations.)

So, the permissions portion doesn't appear to work.

Just wondering why,
-Sneex-  :]
__________________________________________________________________
Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
__________________________________________________________________
It is common sense to take a method and try it.  If it fails,
admit it frankly and try another.  But above all, try something.
                -- Franklin D. Roosevelt


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

Date: Mon, 07 Sep 1998 02:35:46 GMT
From: Garry Williams <garry@america.net>
Subject: Re: IO::File Permissions - Revisited
Message-Id: <35F346C9.72C3776C@america.net>

Try `umask 077;' before creating the file.  

-Garry Williams

Bill 'Sneex' Jones wrote:
> 
> I went thru several
>                     my $fh = new IO::File $file, "a", 0755;
>                                                       ----
>                                                       /
>         different permission settings, thus ----------
> 
> IE, I tried 0600, 0755, 0700, 0444, etc...
> 
> And they all create the file with 0644...
> (Yes, I am deleting the file between interations.)
> 
> So, the permissions portion doesn't appear to work.
> 
> Just wondering why,
> -Sneex-  :]
> __________________________________________________________________
> Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
> __________________________________________________________________
> It is common sense to take a method and try it.  If it fails,
> admit it frankly and try another.  But above all, try something.
>                 -- Franklin D. Roosevelt


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

Date: Mon, 07 Sep 1998 02:50:05 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: IO::File Permissions - Revisited
Message-Id: <xRHI1.654$mW2.24027@nsw.nnrp.telstra.net>

In article <35F342B1.B859A8B8@sneex.fccj.org>,
	Bill 'Sneex' Jones <sneaker@sneex.fccj.org> writes:

>> Ah, heck.  The file is created under control of the umask.  Use chmod to
>> modify it or set the umask to something like 077 before creating the
>> file.  It looks like your umask is set to 022 instead.  (I know this is
>> documented somewhere, but the obvious path wasn't real clear, eh?)
>> 
>> -Garry Williams
> 
> I went thru several 
>                     my $fh = new IO::File $file, "a", 0755;
>                                                       ----
>                                                       /
>         different permission settings, thus ----------
> 
> IE, I tried 0600, 0755, 0700, 0444, etc...

Yes, but what _is_ your umask? 

Set your umask to 0. To read what umask does, check the manpage for
open(2). If you're not on a unix box:

[SNIP]
                    The access  permission  bits
                    (see  <sys/stat.h>)  of the file mode are set
                    to the value of  mode,  modified  as  follows
                    (see  creat(2)):   a bitwise-AND is performed
                    on the file-mode bits and  the  corresponding
                    bits  in  the complement of the process' file
                    mode creation mask.  Thus, all  bits  set  in
                    the  process's  file  mode creation mask (see
                    umask(2)) are correspondingly cleared in  the
                    file's permission mask.  The "save text image
                    after execution bit" of the mode  is  cleared
                    (see  chmod(2)).
[SNIP]

There's more information in the man pages for creat(2) and on many
systems in intro(2).

> And they all create the file with 0644...

Hmm. They shouldn't. The umask should just clear the umask bits in
your creation mode. It should not set bits that aren't set already.
What's the system you're on?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd.       | reflects this.
NSW, Australia                      | 


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

Date: Mon, 07 Sep 1998 06:18:04 GMT
From: gbuzzell@hardlink.com (Gerry Buzzell)
Subject: Re: Pattern matching specific
Message-Id: <35f379c5.214445058@news.hardlink.com>

gbuzzell@hardlink.com[Gerry Buzzell] wrote:

Can't you put each line into a string and then use the 
$s = substr($string, $start, $length) function to extract
the desired information?



>I have a file that has  the following information for example
>
>One    Two    Three    Four       Five
>           xyz                  P019
> 2                             C12345
>
>I need to get the information from under the heading Four.
>It isn't always the same and neither is the text before the part I need.
>
>The last dilemma is that the field after the 4th column is not always
>empty.
>Is there a pattern match that specifies the characters literally.
>What I need is the 26th through the 31st characters of each line.
>I can't seem to find anything about how to match specific parts of a
>line without
>knowing there content to give pattern by.
>Please help
>Thanks
>
>



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

Date: 7 Sep 1998 04:03:49 GMT
From: Bernie <bfb@att.net>
Subject: Please Help With Net::Telnet Login Prompt
Message-Id: <35F35AC7.5064163E@att.net>

Can someone please tell me how to construct a
login prompt from the following information?
I created a script at work which works just
fine, but I can't get it to work on my localhost.
It keeps timing out and I've tried numerous
variations for the prompt regex.
I've also included output from the dump_log file.

-Thanks



Here's the actual telnet login:

/home/super/perls> telnet localhost
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Red Hat Linux release 5.1 (Manhattan)
Kernel 2.0.34 on an i586
login: postgres
Password:
Warning: your password will expire in -1 days
Last login: Sun Sep  6 23:07:58 from localhost
START /home/postgres/.ocaldom.hstry
localhost.localdomain:/home/postgres:


And here's the output from the dump_log file:

/home/super/perls> cat dump_log
< 0x00000: ff fd 18 ff  fd 20 ff fd  23 ff fd 27               }.}
}#}'

> 0x00000: ff fc 18 ff  fc 20 ff fc  23 ff fc 27               |.|
|#|'

< 0x00000: ff fb 03 ff  fd 01 ff fd  1f ff fb 05  ff fd 21
{.}.}.{.}!

> 0x00000: ff fd 03 ff  fc 01 ff fc  1f ff fe 05  ff fc 21
}.|.|.~.|!

< 0x00000: ff fb 01 0d  0a 52 65 64  20 48 61 74  20 4c 69 6e  {...Red
Hat Lin
< 0x00010: 75 78 20 72  65 6c 65 61  73 65 20 35  2e 31 20 28  ux
release 5.1 (
< 0x00020: 4d 61 6e 68  61 74 74 61  6e 29 0d 0a  4b 65 72 6e
Manhattan)..Kern
< 0x00030: 65 6c 20 32  2e 30 2e 33  34 20 6f 6e  20 61 6e 20  el 2.0.34
on an
< 0x00040: 69 35 38 36  0d 0a                                  i586..

> 0x00000: ff fd 01                                            }.

< 0x00000: 6c 6f 67 69  6e 3a 20                               login:

> 0x00000: 70 6f 73 74  67 72 65 73  0d 0a
postgres..

< 0x00000: 70 6f 73 74  67 72 65 73  0d 0a
postgres..

< 0x00000: 50 61 73 73  77 6f 72 64  3a 20                     Password:

> 0x00000: 6e 65 72 64  73 31 0d 0a
mypasswd1..

< 0x00000: 6e 65 72 64  73 31 0d 0a
mypasswd1..




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

Date: Mon, 07 Sep 1998 02:56:13 GMT
From: lincr@usa.net
Subject: print number
Message-Id: <6svi0d$f1p$1@nnrp1.dejanews.com>

I want to print a number like 12345678 as follow:

   12,345,678

how can I do ?

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Sun, 6 Sep 1998 20:22:57 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: print number
Message-Id: <MPG.105cf167fc32576198982f@nntp.hpl.hp.com>

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

In article <6svi0d$f1p$1@nnrp1.dejanews.com> on Mon, 07 Sep 1998 02:56:13 
GMT, lincr@usa.net <lincr@usa.net> says...
> I want to print a number like 12345678 as follow:
> 
>    12,345,678
> 
> how can I do ?

You can do it by reading perlfaq5: "How can I output my numbers with 
commas added?"

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


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

Date: Sun, 06 Sep 1998 22:19:05 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: print number
Message-Id: <35F350A9.3CE52F95@gpu.srv.ualberta.ca>

lincr@usa.net wrote:
> 
> I want to print a number like 12345678 as follow:
> 
>    12,345,678
> 
> how can I do ?

see the FAQ entry regarding this question:

perlfaq5.pod:=head2 How can I output my numbers with commas added?

regards
andrew


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

Date: Mon, 07 Sep 1998 06:02:46 GMT
From: dodge@aloha.net (A Watcher)
Subject: Printing images
Message-Id: <35f47429.25818148@news.aloha.net>

Hi,

Is there a simple way to print three small gif files on the outsides
of hidden named fields?  

	print "<form method=post action=$script_url>\n";
	print "<input type=hidden name=merchant value=$			
	post_query{'merchant'}>\n";
print "<b>PRINT ONE GIF HERE plus some bold text:</b>";
	print "<input type=text name=\"CCN2\" size=20 			
	maxlength=25>\n";
	print "<input type=hidden name=\"action\" 			
	value=\"cc2\"><p>\n";
	print "<input type=hidden 					
	name=\"email\"value=\"$post_query{'email'}\">";
PRINT THE SAME GIF HERE 
	print "<center>";


Have two more gif files I want printed to my forms.    

Any easy way to do this?  I tried img src="name1.gif"

Thanks for your expertise. 

John




 The more I know, the more I know -- I don't know.

                    {:>)=  

            http://www.spiced.com        


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

Date: Mon, 07 Sep 1998 11:18:40 GMT
From: usenet@anchor.demon.co.uk (Michael Johns)
Subject: Problems with require command
Message-Id: <905138321.17265.0.nnrp-04.9e98287c@news.demon.co.uk>

I am trying to use the 'require' command in PERL.  My program checks
to see whether the file that is being required is readable and
executable.  It then tries to require the file.  The program passes
the readibility/executability test, but locks up when the require
command is used.  Is there a simple solution to my problem?

It may be something the ISP has done, because the program suddenly
stopped working (i.e. they may have inadvertently made the file
inaccesible in some way - although it shows up as fully
readable/executable).  The file being required returns 1 at the end.
Can anyone help?





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

Date: Sun, 6 Sep 1998 23:32:26 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Regex/File/substitution/CGI
Message-Id: <1deyjnf.tkvsvd1a5gqmyN@bay1-98.quincy.ziplink.net>

<e_blumenau@my-dejanews.com> wrote:

> $stmt = <B>;
> while ($temp=<Q>)
>   {
>     $val = $c->param($key);
> #     $stmt =~ s/b/$val/;
>     $stmt =~ s/$temp/$val/;
>     $i++;
>     $key = "t$i";
>   }
> 
> <B> is the file with the body of the Mad-Lib.  <Q> is the file with the entry
> types(NOUN,ADJECTIVE,VERB,etc).  Basically, whereever NOUN appears in $stmt, I
> want to replace it with the value from the GET parameter.  The commented
> statement works.  So why doesn't the next one?  Why isn't it recognizing $temp
> in $stmt?  Obviously I am missing something.  Any help would be appreciated.

Yes, you're missing telling us what the value of $temp is.

Actually, I bet what you're really missing is chomp($temp), unless you
really want to match that newline...

If you get a chance, you might want to give your filehandles more
descriptive names.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 7 Sep 1998 05:39:44 -0000
From: steve@inature.com.au (Steve Vertigan)
Subject: Text::CSV parsing sporadically
Message-Id: <19980907053944.4128.qmail@nym.alias.net>

Hi.  I'm trying to read data from a CSV file that's been exported from MS 
Access with the perl module CSV.pm.  The problem is that on a file of about 
450 records about 360 were parsed ok and 80 were marked as corrupt.  On a 
hunch I exported to temporary file from access and tried to import straight 
back in and it marked 12 as corrupt.  The "truncation error" seemed to 
indicate some fields are longer than 255 characters but doesn't explain why 
the perl module doesn't like the other 80 records.  Is Access exporting in a 
non-compliant way or is the problem more likely with CSV.pm?  I've included 
one of the lines marked as bad (with wrapping to 80 char) in the hope that 
someone can tell me what's breaking here.

RECORD...

7107,"Sunley","H",,"Mr & Mrs H----",,,"29 ----- Avenue, Collingwood Park",," 
IPSWICH","Qld","4301",,"07.111.11111",,,"2ad","bungalow 153sm 3bd 1ba","5 
persons","hmx","AUSTRALASIA","AUSTRALIA","QUEENSLAND","IPSWICH","suburban","
Brisbane - 40km","Retired Maintenance Supervisor:","Weather 
July-August-September like British summer 150 - 260C. East  access to Gold 
Coast - Queensland. Beautiful one day, perfect the  next. We require 
accommodation for the dates 10 August - 22  September '98, but will be quite 
happy for a family to occupy our  home for a longer period up to the 3 
months duration.  Sauna/jacuzzi available.","Washer/Drier, Television, Car 
Exchange","BRITAIN, (England, Scotland, Wales, Open to offers) flexible","3 
months","01/Jul/98-22/Sep/98","Yes","GT-982-AUQD-0248p",,,,,"7",,,,,,,,,,,,,
,"'",,,,,,,,,,,,,,


Any ideas?

Thanks,

--Steve


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

Date: Mon, 07 Sep 1998 02:29:34 GMT
From: info@heliumweb.com
Subject: Web Development Resources
Message-Id: <6svged$cq8$1@nnrp1.dejanews.com>

Hello

	If you are interested in finding web development resources on the
internet go to webknowhow.net. This site contains over 1000 links to many web
development resources including CGI scripts, HTML, Java, JavaScript,
Graphics, Design, Web Promotion and more. http://webknowhow.net.


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

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

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