[12199] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5799 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 27 02:07:22 1999

Date: Wed, 26 May 99 23:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 26 May 1999     Volume: 8 Number: 5799

Today's topics:
    Re: DBM File will not open after Redhat 6.0 upgrade (mrMark)
    Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe finsol@ts.co.nz
    Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe finsol@ts.co.nz
    Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe (Sam Holden)
        flock and string search. <rich_guy@hotmail.com>
    Re: hash of array ? (Scott)
    Re: help on openiong and manipulating files (Scott)
    Re: how to create dynamic arrays (Scott)
    Re: ODBC assistance <xrxoxtxhxdx@xrxoxtxhx.xnxextx>
    Re: Pattern Matching -- Up a Certain Creek with no Padd <uri@sysarch.com>
        Perl "Camel Book" error or perl bug ("W. James Showalter, Jr.")
    Re: Perl "Camel Book" error or perl bug (Larry Rosler)
    Re: perl -w, "uninitialized" variables, and the Perl la (Ronald J Kimball)
    Re: perl -w, "uninitialized" variables, and the Perl la (Ronald J Kimball)
        perl script as an executable (Jason Q.)
    Re: perl script updating 2 frames? <webmaster@chatbase.com>
    Re: perl syntax error <david@kasey.umkc.edu>
    Re: Please help ? (Tad McClellan)
        please test my new site.. <djfst34@pitt.edu>
        Reading text file <ducott@geocities.com>
    Re: removings " "s from strings <daniel.vesma@thewebtree.com>
    Re: require problem <webmaster@chatbase.com>
    Re: s/// multiple lines in file from cmd line (Ronald J Kimball)
    Re: system command to string (DATE) (Tom Vaughan)
    Re: system command to string (DATE) (Tad McClellan)
    Re: system command to string (DATE) (BXTC)
        Text::Query::Advanced,SQL, and Boolean logic kellan1@my-deja.com
    Re: unexponentialize field from text file zenin@bawdycaste.org
        using zipcodes to graphically desplay survey results on <djfst34@pitt.edu>
    Re: workarounds for prototypes (Tim Herzog)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 27 May 1999 00:31:46 -0400
From: getpepsi@yahoo.com (mrMark)
Subject: Re: DBM File will not open after Redhat 6.0 upgrade
Message-Id: <MPG.11b694bcafc3381f989680@news.supernews.com>

In article <374C23A5.90EBC81A@flair.law.ubc.ca>, bruce@flair.law.ubc.ca 
says...

> Oddly, the message I am getting is "File exists". This is odd because I
> don't get the message if I delete the file, let the script create the
> file, and then run the script again. It doesn't mind the file existing
> unless I try opening the old database.
> 
> I've tried both "use DB_File" and "use AnyDBM_File" to no avail. I've
> tried specifying the .db extension in the dbmopen call and not. No
> change.
> 
> I've even tried changing the mode parameter of dbmopen from 0666 to
> undef. At least that resulted in a change. The dbmopen call still
> failed, but $! wasn't set to anything.
> 
> The perl, which I assume was installed by Redhat 6.0, is 5.005_3.
> 
> Again, any help appreciated.
> 

While I can't confirm this either way (I'm still using RH5.0), the 
problem may be that RH updated the version of BerkeleyDB in the system.  
It sounds like the original DB was created with bDB 1.58 and the new 
version is bDB 2.0(something).

My only clue into this is that it sounds like the same problem I was 
having when I updated to bDB to avoid a problem I was having.

Mark


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

Date: Thu, 27 May 1999 05:00:36 GMT
From: finsol@ts.co.nz
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <7iijhk$a1$1@nnrp1.deja.com>

In article <pudge-2505992309540001@192.168.0.77>,
  pudge@pobox.com (Chris Nandor) wrote:
> In article <7i80g6$kao$1@nnrp1.deja.com>, finsol@ts.co.nz wrote:
>

> It is telling that you say "I was informed that Perl wasn't used for
> anything critical anyway."  I do not mean offense here, but you are
> obviously unqualified to be writing articles about this issue if you
don't
> know what Perl is used for, and your editor/publisher should be taken
to
> task for letting you write for that publication.
>
Of course Perl, like most programming languages, is used for many
types of applications, some critical, some not.  I used this as an
example of one the many stupid comments I receive from programmers who
think their limited view of computing, based on their limited
experience, applies to the rest of the world.  The comment was from a
Perl programmer and in his limited experience that was true.  Many Perl
programmers think the mis-use of localtime is a non-issue
because, based on their limited experience, it does not occur or, if it
does, it cannot cause any problem worthy of consideration.

The frequent raising of this issue by programmers who have only just
discovered this problem would indicate that there are still many who
have yet to discover that the localtime year value in 2000 will be '100'
and not '00' as many have assumed.

A very common way for programmers to learn a programming language,
beyond their first, is to maintain an existing application in that
language and make logical assumptions about instructions based on how
they are used within the code. Right or wrong, that is the reality.  If
Perl is your one and only language then you have probably learnt it at
an academic institution and most likely referred to the manual on a
frequent basis.

If I saw localtime used in a program to format and output the value
YYMMDD, I would be unlikely to check the manual just to be sure that YY
was 'years since 1900' and not the last two digits of the year. I would
probably only see a need for this if I was familiar with one of the very
few languages that handle the year value in this way (i.e. C and Java).
Otherwise, I would not have any reason to expect anything but 00 for the
year 2000.

Your ignorance of the potential seriousness of this aspect of
the Y2K problem would indicate that you are unqualified to judge whether
or not I have the qualifications to write on this subject.

Jocelyn Amon

--
Financial Solutions Limited
http://www.ts.co.nz/~finsol/


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Thu, 27 May 1999 05:32:06 GMT
From: finsol@ts.co.nz
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <7iilcm$1dl$1@nnrp1.deja.com>

In article <slrn7klkcn.mq8.sitaram@diac.com>,
  sitaram@diac.com (Sitaram Chamarty) wrote:
>
> I think the lady means "that real world in which "consultants" can
> make lots of moolah by spreading unnecessary FUD about Y2K, and
> where they (as well as trial lawyers) are panicking at the thought
> of NOTHING major happening, and trying their damnedest to make hay
> before the sun starts shining again".
>
So, you work for nothing do you? When do you get your sainthood?

We computer people don't need Y2K to make money. Many of us Y2K
programmers would rather be doing something a bit more interesting than
looking at badly written bug-riddled code. It is my belief that any
programmer with a conscience should be concentrating on Y2K work -
however boring they might find it. Unfortunately, it doesn't pay any
more money than writing new exciting whizz-bang programs! And we get
less kudos and no ego-boosting feed-back from the users.

> >with Perl that you will clutch at any straw to defend it - even by
> >attempting to descredit me by attacking my choice in newsgroup
> >technology? Come on, Perl is just another programming language - time
>
> Jocelyn: when a "consultant" like you does not know or choose to
> use a proper newsreader, and instead uses dejanews/Netscape, Tom
> DOES have a point.
>
> I dont know what services you sell, but if I saw a carpenter
> trying to use a saw where a chisel is more appropriate, I would
> not hire him for anything more than making a bird house.  Perhaps
> not even that.

I have more important things to do than spending my time searching for
the ultimate newsreader. Deja News works just fine for me and,
obviously, for many others.
>
> It follows therefore, that you are not qualified to pass judgement
> or even make comments about that which you do not understand.  Oh,
> and I notice you still havent fixed your web page to remove the
> claim that CGI is a language, thus dooming your reputation in the
> eyes of every knowledgeable visitor to your pages.
>
Whether a method of instructing a computer can be deemed a programming
language, scripting language, interface language, job control language
or some other esoteric jargon you would care to name, is a grey area
that I don't wish to debate. The fact is that CGI shares the same Y2K
booby-trap problem as Perl. Fixing Y2K problems is more important than
playing stupid semantics.

Jocelyn Amon

--
Financial Solutions Limited
http://www.ts.co.nz/~finsol/


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: 27 May 1999 05:50:34 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <slrn7kpn9a.fap.sholden@pgrad.cs.usyd.edu.au>

On Thu, 27 May 1999 05:32:06 GMT, finsol@ts.co.nz <finsol@ts.co.nz> wrote:
>
>Whether a method of instructing a computer can be deemed a programming
>language, scripting language, interface language, job control language
>or some other esoteric jargon you would care to name, is a grey area
>that I don't wish to debate. The fact is that CGI shares the same Y2K
>booby-trap problem as Perl. Fixing Y2K problems is more important than
>playing stupid semantics.

Perl doesn't have a Y2K booby-trap problem. I guess you mean localtime as
used by people who can't read. In that case how does CGI have one? Care 
to name where in the CGI spec you find this Y2K problem? You can;t 
because you obviously have no idea what CGI is, since if you did you'd
know it can not possibly have a Y2K problem of the kind you mean.

I guess HTTP has a Y2K problem too. And NNTP, since they are closer to CGI
than perl is. 

It would be good to learn something before you make a statement that you
word as 'The fact is that CGI...'. 

CGI is not a language. Don't pretend it is. It makes you look stupid.

-- 
Sam

The very fact that it's possible to write messy programs in Perl is also
what makes it possible to write programs that are cleaner in Perl than
they could ever be in a language that attempts to enforce cleanliness.
	--Larry Wall


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

Date: Wed, 26 May 1999 21:47:53 -0700
From: "$Richy Rich$" <rich_guy@hotmail.com>
Subject: flock and string search.
Message-Id: <374ccb44.1@news1.starnetinc.com>

hi,

    i can't find an in-depth answer to this question, so i'll go ahead
and ask. if you can point me to a URL or info file regarding the flock
command, then that would do, rather then repeating some text. my
question is, i know how to implement the flock command for locking a
file, but i don't understand how it works with the 'wait' i guess. if
the file is locked and my isp i am running a cgi script on is deathly
slow (which is usually is!), then if another user tries to create a
session file (by the same name - there's a reason for this which is
irrelevant to my question), does this user's process just wait as long
as it takes for the file to be unlocked? i only ask, because i
understand this is how it works, but i mean, will the second user's
process time out, go zombie or error if it takes too long? i need to use
exclusive locks, as it creates a new file for each user, in order and
increments by one each time - until it reaches a limit. do i have to be
concerned about users getting 500 errors or timing out and getting a
document contains no data error a lot, or will it simply wait until the
time needed? if not, what's the way around this? i have earlier versions
of this program that use badly written code, where it has manual locks
by checking to see if they exist, which is a bad idea already and worse
seeing that this isp is so bogged down for other people's bad ideas. :)
(and yes, i've checked man flock, etc.)

The other question i have, is how to best implement a block for foul
words for people's names within their session. i take the string and
check in a sub routine for matches. i first changed the string to lower
case only by saying
sub Check {
my ($string) = shift;
$text = lc($string);
$bad_word = 1 if ($test =~ m!badword1! || $test =~ m!badword2!
            || $test =~ m!badword3!); #etc. (there's more of course!).
return(string); #return result for printing/adding info once
processed/checked.
}

this is called by

 $string = Check($string);

and then saying

 if ($ban_word == 1) {
   print "sorry, try again, that contains a bad word!\n";
   exit;
} else {
 submit info.
}

how can i have it so it stops searching at the first bad word it finds?
i've checked all the info i can about it (with my limited knowledge),
but i can't find that. i'm desperately trying to get my scripts to run
faster and not do any more work then needed, but i can't find the info i
seek in any of my perl books, well at least not yet. i've looked but i
think it's going to be a while before i get to that area, but i find i
need that info now. until then, i kindly ask for any advice or direction
to the proper area. i have learning perl, programming perl, the perl
cookbook (the right one), effective perl and some others and i still
can't find the info i need. did i overlook a page?

thanks and sorry for the rambling!





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

Date: Thu, 27 May 1999 04:04:49 GMT
From: shoelace@ihug.co.newzealand (Scott)
Subject: Re: hash of array ?
Message-Id: <374bae5a.178635040@news.ihug.co.nz>

	The 'FMTEYEWTK' or something series (found on www.perl.com)
has some good examples on this kind of stuff.  Also, Advanced Perl
Programming from O'Reilly has a chapter on implementing complex data
structures.

	- Scott

On Wed, 26 May 1999 07:29:15 GMT, tvn007@my-dejanews.com wrote:

>Hi,
>
>Does anyone knows any web site or books that I can learn more
>on Hash of Array , Array of Array or Hash of Hash ?
>
>I am looking for some good examples.
>
>Thanks,
>
>
>--== Sent via Deja.com http://www.deja.com/ ==--
>---Share what you know. Learn what you don't.---



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

Date: Thu, 27 May 1999 04:04:50 GMT
From: shoelace@ihug.co.newzealand (Scott)
Subject: Re: help on openiong and manipulating files
Message-Id: <374caf58.178889020@news.ihug.co.nz>

On Mon, 24 May 1999 21:41:01 -0700, Reese Butler <reese@value.net>
wrote:

>Im triying to open a simple .txt file and store txt into variables
>using code from a tutorial book that goes like so
>
>#!/usr/bin/perl
>
>print "Content-type: text/html\n\n";
>
>
>
>open(dbtest, "http://www.server.com\Hank\db.txt");

	You probably want the path to the file instead of the URL.
I'm not sure if there is a snazzy perl module to open a file from a
web address like this.  Would be interested if there was such a thing!

>
>select(dbtest);
>while (<dbtest>) {
>
>chop;
>
>($item, $price) = split(/:/,$_,2);
>$price_list{item} = $price;
>
>
>}
>close ( dbtest );
>
>this much of the code works, however when i try to print a variable i
>get nothing, as if its not reading anything at all.
>the book says to use: open($filehandle, "url");
>but when i use the $ sign i get an error. why is this, and why wont my
>code read any of db.txt into the $price_list array?
>db.txt is as follows

Blow this away and give the following a try:

#!/path/to/perl

use strict;

open(DBTEST, "db.txt") || die "Unable to open file";
while(<DBTEST>)
{
	my ($item, $price) = split(/:/);
	# do whatever else in here
}
close(DBTEST);


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

Date: Thu, 27 May 1999 04:04:51 GMT
From: shoelace@ihug.co.newzealand (Scott)
Subject: Re: how to create dynamic arrays
Message-Id: <374db13f.179376340@news.ihug.co.nz>

	As far as I know, Perl handles all arrays as dynamic since you
don't have to specify the element size when creating it.  You can just
keep pushing more values onto it and Perl is quite happy to cope.

	- Scott

On Mon, 24 May 1999 14:17:24 GMT, ii4@hotmail.com wrote:

>
>
>Hi,
>
>Is there a way to create arrays dynamically
>in perl?
>
>Thanks
>
>John
>
>
>--== Sent via Deja.com http://www.deja.com/ ==--
>---Share what you know. Learn what you don't.---



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

Date: Wed, 26 May 1999 22:39:09 -0700
From: "Dave Roth" <xrxoxtxhxdx@xrxoxtxhx.xnxextx>
Subject: Re: ODBC assistance
Message-Id: <GQ433.18353$pj7.96129@news2.giganews.com>

Greg Dalbey wrote in message <374C9573.1080EE82@enteract.com>...
>I need an answer to this one ...
>
>I want to communicate with an ODBC compliant db.  The db sits on my
>isp's
>server, which is an Intel machine running FreeBSD ... I don't know if I
>need more info than that, let me know ... I need to know what module I
>should be requiring and than where to find ODBC drivers for such a
>machine.
>
>I know of Win32::ODBC, but it sounds like you use that if you are
>running on an NT server, which this is not.
>
>Many of the example I have seen use DBI::ODBC but it sounds like they
>are running on an NT platform.  I use my ISP's distribution of Perl ...
>sounds like I should contact them, see if they have the proper modules
>installed ...

Greg,
Look into DBI::ODBC; it works well and is available on UNIX platforms
as well as Win32. Your ISP, however, will need appropriate ODBC
drivers that can talk with your database.

dave
--
=================================================================
Dave Roth                                ...glittering prizes and
Roth Consulting                      endless compromises, shatter
<rothd at roth dot net>                 the illusion of integrity
http://www.roth.net
Win32, Perl, C++, ODBC, Training

Our latest Perl book is now available:
"Win32 Perl Programming: The Standard Extensions"
http://www.roth.net/books/extensions/






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

Date: 26 May 1999 22:41:41 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Pattern Matching -- Up a Certain Creek with no Paddle
Message-Id: <x7btf7dyje.fsf@home.sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  LR> In article <x7g14jeeqa.fsf@home.sysarch.com> on 26 May 1999 16:51:57 -
  LR> 0400, Uri Guttman <uri@sysarch.com> says...
  >> 
  LR> s/^ //;
  >> +
  LR> s/ $//;
  >> +
  >> 
  >> aren't you missing the + (which is what the {1,} is above)?

  LR> Errr, no.  The '+' wouldn't do any harm, but it's not needed.  Look at 
  LR> the whole snippet, not those two lines.

  LR>     for (@record) {
  LR>         tr/ \r\t\f\b/ /s;
  LR>         s/^ //;
  LR>         s/ $//;
  LR>     }

  LR> Gotcha!  (On purpose. :-)

you bastard!! putting the squeeze option on me! i will never help you in
this group again. such humilation! falling right into the trap you
set. i am immediately switching over to python. i hear there are no
traps in that language. or maybe java. hmmm...

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Wed, 26 May 1999 22:30:55 -0400 (EDT)
From: gamma@mintaka.iern.disa.mil ("W. James Showalter, Jr.")
Subject: Perl "Camel Book" error or perl bug
Message-Id: <Pine.GSO.4.10.9905262208110.17296-100000@mintaka.iern.disa.mil>

I have done some checking in perl digests and can't find a reference to
this.

On page 120 of "Programming Perl", the example starting with "sub try"
doesn't work because the @_ return value of sub catch is evaluated in
scalar context, not list. I assume this is correct since on page 112 the
text says the return value of a subroutine is evaluated in list or scalar
context depending on whether the sub was called with a list or scalar
value.  Anyway, substituting $_[0] for @_ made the example work as
advertised.

I know there are some other errors and was wondering if a current errata
supplement exists for the book, "Programming Perl?"

Thanks,
Jim





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

Date: Wed, 26 May 1999 22:50:19 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl "Camel Book" error or perl bug
Message-Id: <MPG.11b67ce799fe9858989b0b@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <Pine.GSO.4.10.9905262208110.17296-
100000@mintaka.iern.disa.mil> on Wed, 26 May 1999 22:30:55 -0400 (EDT), 
W. James Showalter, Jr. <gamma@mintaka.iern.disa.mil> says...
 ...
> I know there are some other errors and was wondering if a current errata
> supplement exists for the book, "Programming Perl?"

You could have found this yourself from the http://www.ora.com/ 
homepage.  

http://www.oreilly.com/catalog/pperl2/errata/

Maybe you can find the error from there.

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


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

Date: Wed, 26 May 1999 23:18:24 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: perl -w, "uninitialized" variables, and the Perl language spec
Message-Id: <1dsfnai.z1amx7x0tsxsN@p65.tc2.metro.ma.tiac.com>

John Siracusa <macintsh@cs.bu.edu> wrote:

> It's my understanding that all newly-created perl variables are
> guaranteed to to evaluate to be "empty" (i.e. evaluate to "false").
> Notice I didn't call them "uninitialized" variables, because, IMO,
> they *are* initialized--with undef or "emptiness" or whatever.  A
> truly uninitialized variable would contain random garbage, as in
> lower-level languages like C (in most circumstances).  This is one
> of the reasons many people use Perl: it's a higher-level language
> that isolates the programmer from many tedious tasks.

Notice that the warning reads "uninitialized value", not "uninitialized
variable".  The uninitialized value in Perl is called undef.

Even with $foo = undef, which might be called an initialization, the
value of $foo is still uninitialized.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Wed, 26 May 1999 23:18:30 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: perl -w, "uninitialized" variables, and the Perl language spec
Message-Id: <1dsfnd3.2h8fk31pcx8uuN@p65.tc2.metro.ma.tiac.com>

John Siracusa <macintsh@cs.bu.edu> wrote:

> Let me try rephrasing: what is the danger of using "uninitialized"
> variables in perl if all such variables are guaranteed to be in a
> known (and unchanging from perl version to perl version) state?

The danger is that the values of your variables were probably left
uninitialized by mistake.  For example:


#!/usr/local/bin/perl -w
@array = (0, 1, 2);
for ($i = 0; $i <= @array; ++$i) {
  print "$array[$i] \n";
}
__END__
0
1
2
Use of uninitialized value at - line 3.


Or:

$!/usr/local/bin/perl -w
$_ = 'foo';
/(bar)/;
print "$1\n";
__END__
Use of uninitialized value at - line 3.


Or:

#!/usr/local/bin/perl -w
$not_here = $ENV{NOT_HERE};
print "$not_here\n";
__END__
Use of uninitialized value at - line 2.


Note that if you _really_ don't want to bother initializing your
variables' values, you shouldn't be using -w.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 27 May 1999 02:22:16 GMT
From: pigs_can_fly@mindless.com (Jason Q.)
Subject: perl script as an executable
Message-Id: <3750aa44.70100469@news.cyberway.com.sg>

Hi

For a project of mine, one of the servers I am using requires that
perl scripts be in executable (.exe) format. I have converted the
script using perl2exe. The script involved is a search script.

My question is, how do I pass the search parameters (keywords etc) to
the script? I need to do this via the html->form->post command.


My apologies that this problem is cgi-related but I have had no luck
in the other newgroups. I would appreciate if someone could point me
in the right direction.


Thanks


JQ


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

Date: Wed, 26 May 1999 21:57:31 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: perl script updating 2 frames?
Message-Id: <374CD0BA.67E48FD1@chatbase.com>

Olivier Maas wrote:
> 
> Hello,
> I would like a Perl script to modify 2 frames in the web page.
> e.g. a page with 2 frames (Fram1 & Fram2)
> 
> I have a form being posted to a perl script in Fram2, Fram2 is modified
> simply with:
> $html=CGI->new; printing the header and printing the html page.
> 
> but how do I do to also modify Fram1?

Your question would be better of asking in a CGI NG. There's a few
things you can do, i.e., print the location with a "target: frame", but
that only works with certain browsers.
-- 
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com   
Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, etc.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, etc.
Freelance Programming & Consulting, Musician, Martial Arts, Sciences.


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

Date: Wed, 26 May 1999 20:33:38 +0000
From: "David L. Nicol" <david@kasey.umkc.edu>
Subject: Re: perl syntax error
Message-Id: <374C5AA2.32D30D5C@kasey.umkc.edu>


when in doubt add parentheses


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

Date: Wed, 26 May 1999 10:34:15 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Please help ?
Message-Id: <7p0hi7.knm.ln@magna.metronet.com>

tvn007@my-deja.com wrote:

: Would someone please help me on this ?

: I would like the ouput as follow:

: DATA X Y Z A B C;

: N100 xyz 10X011;
: N10  xyz X01000;
: N12  xyz 000001;


-----------------------------
#!/usr/bin/perl -w
use strict;

{ local $/ = ";\n";   # grab (maybe) 2 lines at a time
                      # localize changes to special variables
                      # see perlvar.pod for info on $/

   while (<DATA>) {
      s/\n *//;       # delete the first newline and spaces
      print;
   }
}

__DATA__
N100 xyz 10X
         011;
N10  xyz X01
         000;
N12  xyz 000
         001;
-----------------------------


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


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

Date: Thu, 27 May 1999 01:57:11 -0400
From: "Dan Foley" <djfst34@pitt.edu>
Subject: please test my new site..
Message-Id: <7iimor$g8t$1@usenet01.srv.cis.pitt.edu>

Made with javascript/html/perl

(that is why i am posting on these 3 newsgroups)

it's a simple survey.. to figure out who says soda and who says pop. can
everyone please take a few seconds to answer this one question survey and
also to let me know if u find any bugs along the way.

Currently i am just gathering data.. soon i wish to display the results
graphically on a map of the us.. (i guess demographically).. if u might be
able to help out with that. let me know..

to take the survey and test my site go to

www.pitt.edu/~djfst34/surveys/sodapop.html



--
------------------------------------------------------------
- Dan Foley                                         -
- music, resume, more on me              -
- www.pitt.edu/~djfst34                      -
------------------------------------------------------------




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

Date: Wed, 26 May 1999 19:09:24 -0700
From: "Robert" <ducott@geocities.com>
Subject: Reading text file
Message-Id: <374ca81d@carrera.intergate.ca>

Iam trying to write code that will read a text file and print it's contents
to an html file. I have this code working however, it prints all the text on
a single line rather than reading the paragraphs and printing the data on
separate line as it's written in the text file. sample code below. Does
anyone know how I can tell the code to read the text file and print it's
contents in the same format as it's written in the text file.

#!/usr/bin/perl

$listdata="listsheet.txt";

$fullpath="/cgi-bin/mail/data";

$flock="y";

print "Content-type: text/html\n\n";

&updatesheet;

exit;

sub updatesheet {

    open (F,"$fullpath/$listdata");
    @a=<F>;
    print <<"HTML CODE";

<html>

<head>

<title>Fresh Sheet updated!</title>
</head>

<body topmargin="8" leftmargin="8" bgcolor="#FFFFFF">

<center><strong>@a</center></strong>

</body>
</html>

HTML CODE

##############################################
close F;
}




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

Date: Thu, 27 May 1999 05:16:20 +0100
From: "Daniel Vesma" <daniel.vesma@thewebtree.com>
Subject: Re: removings " "s from strings
Message-Id: <7iihd1$3sh$1@gxsn.com>

>It's a bad book.  But since the people who buy it don't know
>that, and don't know Perl, it can get away with murder.
>In fact, in terms of getting away with murder, it's a serial
>killer.  :-)


Yeah, the week after I got the book, I realised it was pants and got myself
a copy of "Learning Perl".


Daniel Vesma
http://www.thewebtree.com
http://www.thewebtree.com/daniel-vesma





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

Date: Wed, 26 May 1999 22:03:14 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: require problem
Message-Id: <374CD212.262F70C@chatbase.com>

alfredo wrote:
> 
> When I use command -> require "script.pl"; an error appair : internal
> server error !
> Someone can help me ? How do I do for use this command ?
> 
> Thanks

Do you have a file called 'script.pl' in the same directory as the
script that required it? If so, is there any errors in 'script.pl', does
it return with a call of 1; at the end? Does it have the correct
permissions to open that file, or execute? There's too many reasons to
guess why. You'll have to provide some more info (please only the
relevant areas of the script(s).
-- 
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com   
Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, etc.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, etc.
Freelance Programming & Consulting, Musician, Martial Arts, Sciences.


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

Date: Wed, 26 May 1999 23:18:31 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: s/// multiple lines in file from cmd line
Message-Id: <1dsfol1.ur2wg01lp3b9hN@p65.tc2.metro.ma.tiac.com>

Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:

> Another possibility if there's a file too big to slurp:
> 
> perl -pi.bak -e '/-{60,}/ && $s++;s/.*//s if $s;$s %= 2' *.config

How about the range operator?

perl -ni.bak -e '$n=/<<\s*(\w+)/../^$1/;print if $n<1 || $n=~/E/;'

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 27 May 1999 03:15:40 GMT
From: vaughan@itdc.edu (Tom Vaughan)
Subject: Re: system command to string (DATE)
Message-Id: <7iidcs$jrf$1@malgudi.oar.net>

(BXTC) (bxtc@forfree.at) wrote:
: To start let me tell you I am new to Perl.  This is what I need:
: 	I need to get the date from my system (linux) and put the output into a
: string.

And why wouldn't you use the backticks? The one under the tilde.

$string=`date +%m/%d/%y`; or whatever options you want for date. Do a man date for info


Tom



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

Date: Wed, 26 May 1999 12:20:14 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: system command to string (DATE)
Message-Id: <uv6hi7.gtm.ln@magna.metronet.com>

(BXTC) (bxtc@forfree.at) wrote:
: To start let me tell you I am new to Perl.  This is what I need:
: 	I need to get the date from my system (linux) and put the output into a
: string.
: 	I read from someone else's post(and perldoc -f system), that calling
: 'date' from the system is not good because it isn't intended to capture
: the output, and someone said exec might be better.  And perldoc was
: saying that system is almost the same thing as exec LIST but after
: reading some it looks like exec doesn't return to the program, so when I
: use it, it just spits out the output and exits the program.

: So, can anyone help me out and point me in the right direction?


   If you are new to Perl, then forget about exec().

   Then there are three ways of running external programs: 

      system()

      qx//   # backticks

      open()  # pipe open.



   But you don't need any of them!

   You can get a date string without resorting to external programs:

      my $date = localtime();


   Do:

      perldoc -f localtime

   to find out about what localtime() returns in a scalar context.


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


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

Date: Thu, 27 May 1999 04:21:35 GMT
From: "(BXTC)" <bxtc@forfree.at>
Subject: Re: system command to string (DATE)
Message-Id: <374DD2A4.F6F79636@forfree.at>

Tom Vaughan wrote:
> 
> (BXTC) (bxtc@forfree.at) wrote:
> : To start let me tell you I am new to Perl.  This is what I need:
> :       I need to get the date from my system (linux) and put the output into a
> : string.
> 
> And why wouldn't you use the backticks? The one under the tilde.
> 
> $string=`date +%m/%d/%y`; or whatever options you want for date. Do a man date for info
> 
> Tom


I would just like to thank everyone(I had several personal e-mails as
well) for their help.  I ended up using `s for now, but am reading all
the perldoc sections you recomended.  That was all I needed, the right
things to look up.  Thanks again,

-- 
(BXTC) ICQ# 23289202


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

Date: Thu, 27 May 1999 02:37:43 GMT
From: kellan1@my-deja.com
Subject: Text::Query::Advanced,SQL, and Boolean logic
Message-Id: <7iib5n$qoe$1@nnrp1.deja.com>

I'm looking into adding boolean logic to a quick search script I've been
working on.  Text::Query::Advanced has comments within it that indicate
that it could be subclassed parse boolean logic and generate something
other then regular expressions.

Has anybody modified/subclassed T::Q::A to do this?
Does anyone know of another quick way to translate boolean logic into
SQL?  Or of a readable example/introduction to parsing it?

Thank you,
Kellan Elliott-McCrea

(Also if anybody as a good search script for searching items in a
relational database, I would love to look at what other people have done)


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: 27 May 1999 02:46:27 GMT
From: zenin@bawdycaste.org
Subject: Re: unexponentialize field from text file
Message-Id: <927773344.6497@localhost>

Sheila Eugenio <seugenio@man.amis.com> wrote:
: I would really appreciate any help. I have a tab file with a field in
: exponential form. I was wondering how I can convert this to a floating
: point number in normal notation through regexp. thanks.
: 
: 0.20161E-01  to 0.020161
: 0.49279E-02  to 0.004928

	Does it have to be through regexp?

	$float = sprintf "%f", $exponential;

-- 
-Zenin (zenin@archive.rhps.org)         Caffeine...for the mind.
                                        Pizza......for the body.
                                        Sushi......for the soul.
                                             -- User Friendly


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

Date: Thu, 27 May 1999 00:59:25 -0400
From: "Dan Foley" <djfst34@pitt.edu>
Subject: using zipcodes to graphically desplay survey results online
Message-Id: <7iijcj$g4b$1@usenet01.srv.cis.pitt.edu>

Ok.. here is what I am trying to do:

I have a database with 2 fields zipcode, and survey answer. It has been, and
it still being complied at www.pitt.edu/~djfst34/surveys/sodapop.html

I wish to display the results geographically baised on the zipcode that goes
along with each answer.

either i will use javascript or perl to do this. I know javascript better,
but i don't know too much about it's abilty to deal with files and such...

my thought is that i am going to need some exteral database of zipcode and
somehow corrorlate them to a map. My current thought is that The only way to
really do this is with a zipcode data base that gives longitude and
latitude.. then i can just plot the results on my map.. no matter how zoomed
in or out you are.. i can always have an equation that plots the longitude
and latitude correctly..

i looked on the web and see such databases cost money, and this is just a
pet project of mine.. so is there another way..? Also.. lets say i did get
the longitute and latitute... how would i plot this.. do i do it real time
each time a user request the results? plot an overlay over a map?? I can't
think of how else i'd do it.. (javascript can do that. but we are talking a
database search for each entry.. and then a plot.. how long might this
take.. ?)

So. i would like to just hear people's thoughts on how i might do this.. by
the way i also have server side includes in my toolbox that i can use.. if
that would help any (i don't think it would in this case)

----Dan

djfst34@pitt.edu (please cc my email a copy of all reply's.. thanks)



--
------------------------------------------------------------
- Dan Foley                                         -
- music, resume, more on me              -
- www.pitt.edu/~djfst34                      -
------------------------------------------------------------




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

Date: Thu, 27 May 1999 00:58:59 -0500
From: therzog@knotech.com (Tim Herzog)
Subject: Re: workarounds for prototypes
Message-Id: <therzog-2705990058590001@therzog-host105.dsl.visi.com>

In article <slrn7kotsr.1bm.dragons@dragons.duesouth.net>,
dragons@dragons.duesouth.net wrote:

>: push @INC, '.';
>
>Totally useless.
>
>: use utils;
>
>The push is done while the program is running.
>
>The use is done while the program is compiling.

OK, right.  Let me delete that extremely offensive line of code, and
repost something that hopefully will draw more helpful responses than
snide commentary.


I have a perl program that defines a bunch of subroutines in a second file
(in the same directory) that I bring in with "require."  The problem is
that because require works at runtime, not compile time, the prototypes in
the second file aren't enforced by the perl compiler.

My workaround is to rename the second file "utils.pm", and then to this in
the main file:

use utils;

That seems to work, at least on my box (RedHat Linux, perl 5.005)

I don't change the contents of utils.pm, don't declare it as a package or
export anything.  For my own reasons (chiefly laziness), I'd rather not
reconstruct this thing as a true package:  I want everything to reside in
global namespace.

My question is:  how dangerous and/or compatible is this with other (and
possibly future) versions of perl?  Am I committing a big no-no?  I do
need this code to be compatible with a wide variety of systems (using Perl
5 as a minimum requirement), but my "module" need only work with this
application.

Thanks,

Tim

-- 
Tim Herzog


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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