[18156] in Perl-Users-Digest
Perl-Users Digest, Issue: 324 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 21 00:05:36 2001
Date: Tue, 20 Feb 2001 21:05:08 -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: <982731908-v10-i324@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 20 Feb 2001 Volume: 10 Number: 324
Today's topics:
Re: covert "øY"" (embeded hex) to F89F how? <c_clarkson@hotmail.com>
Re: Difficult Split Question (Gwyn Judd)
Re: Difficult Split Question <godzilla@stomp.stomp.tokyo>
Re: Difficult Split Question (Christopher Burke)
Re: Difficult Split Question (Christopher Burke)
Re: Difficult Split Question (Christopher Burke)
Re: Difficult Split Question <godzilla@stomp.stomp.tokyo>
Re: Difficult Split Question (Gwyn Judd)
Re: Difficult Split Question (Gwyn Judd)
Re: Difficult Split Question <godzilla@stomp.stomp.tokyo>
Forms Simple Question <ofirb@jdc.org.il>
Re: How do you check for cursor keys? <dave@snorks.dyndns.org>
Re: Need help creating a simple class. <uri@sysarch.com>
Re: Need help creating a simple class. (Steven Smolinski)
Re: Need help creating a simple class. egwong@netcom.com
Re: Need help creating a simple class. (Steven Smolinski)
Problems with Net::DNS 0.19 and Digest::MD5 2.12 <htmailing.no.spam@yahoo.com>
Re: Re: PERL Request <mindfield@badgers.emulationnet.com>
Re: SW processes don't finish, HELP!!! (Logan Shaw)
Whats wrong with this???? <infinityzone@hotmail.com>
Re: Whats wrong with this???? (Gwyn Judd)
Re: Whats wrong with this???? <godzilla@stomp.stomp.tokyo>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 20 Feb 2001 15:38:38 -0600
From: "Charles K. Clarkson" <c_clarkson@hotmail.com>
Subject: Re: covert "øY"" (embeded hex) to F89F how?
Message-Id: <58C99ED2835F27B1.9A4E5C8B3904C831.1A09A314AECAD387@lp.airnews.net>
"Ty" <leinfidel@netscape.net> wrote in message
news:3A92AB8C.4040909@netscape.net...
: Hello all,
:
: I using regular expressions to deal with some documents that have a
: number of true embeded hex codes such as "øY"". I have no problem
: finding them using \x, but I need to replace them with their true hex
code.
:
: For the life of me I can find a way to figure out the value of øY" in
: hex, within a script, anyone know how?
:
: The only reason I know it's F89F is I dropped it in a hex editor...
printf '%2X.', ord for split //, 'øY';
HTH,
Charles K. Clarkson
------------------------------
Date: Wed, 21 Feb 2001 02:29:32 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Difficult Split Question
Message-Id: <slrn996a0b.20s.tjla@thislove.dyndns.org>
I was shocked! How could Christopher Burke <craznar@hotmail.com>
say such a terrible thing:
>I have input lines of the form :
>
>a,b,c,xyz(p,q,r),d
>a,def(x,y,z),b,pqr(m,n)
>
>I wish to split the line based on all ',' characters that are not between
>'(' and ')'.
This is in the FAQ.
perldoq -q split
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Algol-60 surely must be regarded as the most important programming language
yet developed.
-- T. Cheatham
------------------------------
Date: Tue, 20 Feb 2001 19:29:57 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Difficult Split Question
Message-Id: <3A933635.84A652F4@stomp.stomp.tokyo>
Christopher Burke wrote:
(snippage)
> I have input lines of the form :
> a,b,c,xyz(p,q,r),d
> a,def(x,y,z),b,pqr(m,n)
> I wish to split the line based on all ',' characters that
> are not between '(' and ')'.
* wipes chocolate frosting off her lips *
Piece of cake.
Godzilla!
--
TEST SCRIPT:
____________
#!perl
print "Content-type: text/plain\n\n";
$string = 'a,b,c,def(g,h,i),j
k,lmn(o,p,q),r,stu(v,w),
xyz,(1,2,3),4,5,6(7,8,9)';
$string =~ tr/\n//d;
$count = $string =~ tr/(/(/;
for ($iterate = 0; $iterate <= $count; $iterate++)
{
($temp1, $temp2) = $string =~ /(\([\w,]+\))/;
$temp1 =~ tr/,/¿/;
$string =~ s/$temp2/$temp1/;
}
@Array = split (/,/, $string);
foreach $element (@Array)
{
$element =~ tr/¿/,/;
print "$element\n";
}
exit;
PRINTED RESULTS:
_________________
a
b
c
def(g,h,i)
jk
lmn(o,p,q)
r
stu(v,w)
xyz
(1,2,3)
4
5
6(7,8,9)
------------------------------
Date: 21 Feb 2001 03:38:17 GMT
From: craznar@hotmail.com (Christopher Burke)
Subject: Re: Difficult Split Question
Message-Id: <904F85F8Bcraznar@130.102.2.1>
tjla@guvfybir.qlaqaf.bet (Gwyn Judd) wrote in
<slrn996a0b.20s.tjla@thislove.dyndns.org>:
>I was shocked! How could Christopher Burke <craznar@hotmail.com>
>say such a terrible thing:
>>I have input lines of the form :
>>
>>a,b,c,xyz(p,q,r),d
>>a,def(x,y,z),b,pqr(m,n)
>>
>>I wish to split the line based on all ',' characters that are not
>>between '(' and ')'.
>
>This is in the FAQ.
>
>perldoq -q split
>
No its not, because I want to keep the stuff outside the quotes and the
quotes. It was different enough to me to ask if there was an easy way of
doing it... I have worked out a 'brute force' way.
------------------------------
Date: 21 Feb 2001 03:38:36 GMT
From: craznar@hotmail.com (Christopher Burke)
Subject: Re: Difficult Split Question
Message-Id: <904F870E0craznar@130.102.2.1>
ebohlman@omsdev.com (Eric Bohlman) wrote in
<96v5fp$opd$1@bob.news.rcn.net>:
>Christopher Burke <craznar@hotmail.com> wrote:
>> I have input lines of the form :
>
>> a,b,c,xyz(p,q,r),d
>> a,def(x,y,z),b,pqr(m,n)
>
>> I wish to split the line based on all ',' characters that are not
>> between '(' and ')'.
>
>> Is there any "simple" way of doing this using split or regex or do I
>> need to do some 'brute force' coding ?
>
>
>This is actually only a minor variation of the problem of splitting
>comma-separated strings that may have quotes; it should be possible to
>adapt most of the solutions to the latter (starting with the one in
>perlfaq4) to handle it.
>
No its not, because I want to keep the stuff outside the quotes and the
quotes. It was different enough to me to ask if there was an easy way of
doing it... I have worked out a 'brute force' way.
------------------------------
Date: 21 Feb 2001 03:40:55 GMT
From: craznar@hotmail.com (Christopher Burke)
Subject: Re: Difficult Split Question
Message-Id: <904F86303craznar@130.102.2.1>
Thanks all - another Perl guru has suggested I change all the , to
something else if they are in the (). Do a normal split, then change the
'something else' back after.
Ends up being 3 lines - no loops, so I'll have to see how it goes.
godzilla@stomp.stomp.tokyo (Godzilla!) wrote in <3A933635.84A652F4
@stomp.stomp.tokyo>:
>Christopher Burke wrote:
>
>(snippage)
>
>> I have input lines of the form :
>
>> a,b,c,xyz(p,q,r),d
>> a,def(x,y,z),b,pqr(m,n)
>
>> I wish to split the line based on all ',' characters that
>> are not between '(' and ')'.
>
>
>* wipes chocolate frosting off her lips *
>
>Piece of cake.
>
>Godzilla!
>--
>
>TEST SCRIPT:
>____________
>
>#!perl
>
>print "Content-type: text/plain\n\n";
>
>$string = 'a,b,c,def(g,h,i),j
>k,lmn(o,p,q),r,stu(v,w),
>xyz,(1,2,3),4,5,6(7,8,9)';
>
>$string =~ tr/\n//d;
>$count = $string =~ tr/(/(/;
>
>for ($iterate = 0; $iterate <= $count; $iterate++)
> {
> ($temp1, $temp2) = $string =~ /(\([\w,]+\))/;
> $temp1 =~ tr/,/¿/;
> $string =~ s/$temp2/$temp1/;
> }
>
>@Array = split (/,/, $string);
>
>foreach $element (@Array)
> {
> $element =~ tr/¿/,/;
> print "$element\n";
> }
>
>exit;
>
>
>PRINTED RESULTS:
>_________________
>
>a
>b
>c
>def(g,h,i)
>jk
>lmn(o,p,q)
>r
>stu(v,w)
>xyz
>(1,2,3)
>4
>5
>6(7,8,9)
------------------------------
Date: Tue, 20 Feb 2001 20:10:04 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Difficult Split Question
Message-Id: <3A933F9C.40284FD1@stomp.stomp.tokyo>
Christopher Burke wrote:
> Godzilla! wrote:
> > Christopher Burke wrote:
> Thanks all - another Perl guru has suggested I change all the , to
> something else if they are in the (). Do a normal split, then change the
> 'something else' back after.
> Ends up being 3 lines - no loops, so I'll have to see how it goes.
If you are familiar with " do until " type looping,
this code of mine could be shorter, more efficient and
more generic. Have to be careful with do/until looping.
It is very easy to create an infinite loop resulting
in an eventual perl core dump in your script directory.
I tend not to post do/until scripts for this reason.
Logic is simple,
Do (swap commas inside () for something else)
Until (string does not match this regex in my code)
You probably should add a counter during testing on
something like this, until perfected. This will
prevent a run-away script and core dump. Simply
enclose a do/until inside a counter with ample
count for your do/until to finish.
You might consider while type looping as well,
although this involves a bit of coding and
presents the same risks as do/until looping.
Godzilla!
------------------------------
Date: Wed, 21 Feb 2001 04:10:49 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Difficult Split Question
Message-Id: <slrn996fu8.311.tjla@thislove.dyndns.org>
I was shocked! How could Christopher Burke <craznar@hotmail.com>
say such a terrible thing:
>No its not, because I want to keep the stuff outside the quotes and the
>quotes. It was different enough to me to ask if there was an easy way of
>doing it... I have worked out a 'brute force' way.
Huh? Quotes? What are you talking about? Your example uses comma's to
separate the fields except when inside brackets. It doesn't mention
anything about quotes. The only difference between your example and the
FAQ is that you have to look for '(' and ')' instead of just '"'.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Life sucks, except when it bites.
------------------------------
Date: Wed, 21 Feb 2001 04:12:25 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Difficult Split Question
Message-Id: <slrn996g18.311.tjla@thislove.dyndns.org>
I was shocked! How could Christopher Burke <craznar@hotmail.com>
say such a terrible thing:
>Thanks all - another Perl guru has suggested I change all the , to
>something else if they are in the (). Do a normal split, then change the
>'something else' back after.
Yes well, anyone that takes Godzilla's advice get's all they deserve.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
AAAAAAAAAaaaaaaaaaaaaaaaccccccccckkkkkk!!!!!!!!!
You brute! Knock before entering a ladies room!
------------------------------
Date: Tue, 20 Feb 2001 20:42:01 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Difficult Split Question
Message-Id: <3A934719.18CCC667@stomp.stomp.tokyo>
Gwyn Judd wrote:
> I was shocked! How could Christopher Burke <craznar@hotmail.com>
> say such a terrible thing:
> >Thanks all - another Perl guru has suggested I change all the , to
> >something else if they are in the (). Do a normal split, then change the
> >'something else' back after.
> Yes well, anyone that takes Godzilla's advice get's all they deserve.
Oh dear.
"Yes, well, anyone whom takes Godzilla's advice gets all they deserve."
Most often, people don't get what they deserve from me.
However, there are some, a few, who get what they need.
Godzilla!
--
Although use of "who" in place of "whom" as related to a
preposition or as related to an object of a verb, is quite
popular amongst the unwashed masses, there are those of us
whom object to this contemptuous communication style.
Use of a demonstrative pronoun, such as "that" when addressing
or referring to a person or persons, is considered to be in
rather poor taste.
"get's" LIKE DUH!!!!
------------------------------
Date: Tue, 20 Feb 2001 08:54:41 +0200
From: "Ofir" <ofirb@jdc.org.il>
Subject: Forms Simple Question
Message-Id: <96t4bi$2el$1@news.netvision.net.il>
Hi all,
I'm adding a TEXTARE form field to my html, so users can submit their
answers.
I want to use the logged answers later from within Excel, so I'm doing a CSV
file, delimited with the pipe (|).
When I got the answers, I realized that when users typed a sentence into the
TEXTAREA and hit RETURN to write the next sentence (inside the TEXTAREA), it
results with a CR code.
This is confusing the data import to Excel.
How can I avoid these CD codes?
I tried using the WRAP=VIRTUAL in the HTML code, but it doesn't help.
Do I have to write some script to clear the CRs before/after submitting?
If so - How do I do it?
Thanks for any input!
Ofir
------------------------------
Date: Wed, 21 Feb 2001 17:08:16 +1300
From: Dave Watkins <dave@snorks.dyndns.org>
Subject: Re: How do you check for cursor keys?
Message-Id: <3A933F30.A131BF4A@snorks.dyndns.org>
Tony Curtis wrote:
> >> On Mon, 19 Feb 2001 18:25:16 +1300,
> >> Dave Watkins <dave@snorks.dyndns.org> said:
>
> > Basically I have a FTP Client written and working.. I
> > would like to add a history fuction whereby pressing
> > up/down arrows you can scroll through your previous
> > command (much like BASH), but can't find anyway to
> > moniter the cursor keys
>
> Go to http://search.cpan.org/ and look for "readline".
>
I'm already using Term::Complete module (with some hacking) and really
just want to add the support into that eithout having to use another
module
Thanks
------------------------------
Date: Wed, 21 Feb 2001 02:59:09 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Need help creating a simple class.
Message-Id: <x78zn0kagy.fsf@home.sysarch.com>
>>>>> "CM" == Craig Manley <c.manley@chello.nl> writes:
CM> If $dbh->{AutoCommit} == 0 and then you go and set it to 1, you'll cause
CM> a database commit to be executed and you'll therefore be impressed. If I
CM> could have figured out how the DBI does it then I wouldn't have posted
CM> my question.
prove that. without tying, there is no way that any perl code will ever
be executed just by setting a hash element. also if you do that, you are
breaking OO rules as you expose the hash implementation to the outside
world. i don't think you understand OO perl well nor how to code
dbi. show the source and reference of code like yours that actually does
a commit. autocommit is a dbi flag and not an operation.
also read object oriented perl to learn all about OOP from a master.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Wed, 21 Feb 2001 03:11:24 GMT
From: sjs@linux.ca (Steven Smolinski)
Subject: Re: Need help creating a simple class.
Message-Id: <slrn996h36.68h.sjs@ragnar.stevens.gulch>
Uri Guttman <uri@sysarch.com> wrote:
> >>>>> "CM" == Craig Manley <c.manley@chello.nl> writes:
>
> CM> If $dbh->{AutoCommit} == 0 and then you go and set it to 1, you'll cause
> CM> a database commit to be executed and you'll therefore be impressed. If I
> CM> could have figured out how the DBI does it then I wouldn't have posted
> CM> my question.
>
> prove that. without tying, there is no way that any perl code will ever
> be executed just by setting a hash element.
An odd statement in the DBI manpage section for AutoCommit may have
something to do with this. It demonstrates changing the variable by
simple assignment:
$h->{AutoCommit} = ...;
Then annotates some sentences later:
Changing AutoCommit from off to on should issue the commit entry
elsewhere in this document in most drivers.
Personally, without a method to change AutoCommit, I couldn't figure out
a way to hang code off of an assignment to a blessed hashref.
> also if you do that, you are
> breaking OO rules as you expose the hash implementation to the outside
> world.
... which is why--even if I could figure out how to do it--I wouldn't do
it that way. There's also the Principle of Least Surprise here:
assignment should be assignment; methods should be code.
> also read object oriented perl to learn all about OOP from a master.
This is good advice for anyone. I'm halfway in, and loving every tasty
morsel. Conway astounds.
Steve
--
Steven Smolinski => http://www.steven.cx/
------------------------------
Date: 21 Feb 2001 03:18:04 GMT
From: egwong@netcom.com
Subject: Re: Need help creating a simple class.
Message-Id: <96vc1c$26bi$1@newssvr06-en0.news.prodigy.com>
Craig Manley <c.manley@chello.nl> wrote:
> I read the perltoot but it doesn't explain how to access class variables
> as in my example. I don't want to use accessor methods, but a sort
> of $dude->{'age'} = 10; thingy just as in the DBI when you say
> $dbh->{AutoCommit} = 1; Setting $dbh->{AutoCommit} in the DBI causes
> multiple statements to be executed instead of just setting a class
> variable.
Please put your replies *underneath* the quoted text -- it makes
it easier for people to follow.
My guess is that you want to read up on tie-ing a hash in perltie.
If you want to see how DBI does it, just read the source.
------------------------------
Date: Wed, 21 Feb 2001 03:27:01 GMT
From: sjs@linux.ca (Steven Smolinski)
Subject: Re: Need help creating a simple class.
Message-Id: <slrn996hrk.69p.sjs@ragnar.stevens.gulch>
I, Steven Smolinski <sjs@linux.ca> wrote:
> Personally, without a method to change [a class variable], I couldn't
> figure out a way to hang code off of an assignment to a blessed hashref.
Well, slap my ass and call me an amateur, I've just found perltie.
After a quick perusal, I kind of feel like paraphrasing Arthur C. Clarke:
"My God, it's full of magic!"
Steve
--
Steven Smolinski => http://www.steven.cx/
------------------------------
Date: Wed, 21 Feb 2001 04:26:50 GMT
From: "joe" <htmailing.no.spam@yahoo.com>
Subject: Problems with Net::DNS 0.19 and Digest::MD5 2.12
Message-Id: <esHk6.544$Nh3.28837@newsread1.prod.itd.earthlink.net>
Hi,
Please bear with me since I'm pretty new to Perl. I'm trying to get a
script to use Net::DNS under NT.
None of the scripts work, not even the examples provided by the Net::DNS.
It always comes back with query timed out. (regular nslookups work
perfectly).
I search the NG and found the following wich suggested to use the
development version of Net::DNS under NT:
http://groups.google.com/groups?hl=en&lr=&safe=off&ic=1&th=cee7db37b247f898&
seekd=999478330#999478330
Now Net::DNS 0.19 requires Digest::MD5 2.12. I downloaded 2.12 but when
trying to makefile it comes back with:
Testing alignment requirements for U32... The name specified is not
recognized as an internal or external command, operable program or batch
file.
Can't compile test program
Writing Makefile for Digest::MD2
Writing Makefile for Digest::SHA1
Writing Makefile for Digest::MD5
Anybody know how to get this to install correctly?
TIA !
------------------------------
Date: Wed, 21 Feb 2001 04:07:45 GMT
From: Mindfield <mindfield@badgers.emulationnet.com>
Subject: Re: Re: PERL Request
Message-Id: <qhf69t465042c6m2a5cfeqtmp135pbn97o@4ax.com>
On Sun, 18 Feb 2001 22:58:26 -0600, "Charles K. Clarkson"
<c_clarkson@hotmail.com> drooled an embarassing wet spot in his lap as
he typed:
> You didn't mention your operating system. If you are using *nix
>you should be able to run a file using a setting in '.htaccess' each
>time a particular file(s) is requested. You should first try posting
>your question in a usenet group concerned with your operating
>system.
> While an awful lot of CGI is written in Perl, it is not your only
>option. You could fill your needs with something your more
>familiar with and have it run through .htaccess or something
>similar. Usenet has a number of groups that would be more
>appropriate than c.l.p.misc. Try posting to a CGI group,
>you may find someone who has actually done this before.
I tried. Unfortunately the only CGI newsgroup my ISP gets is
comp.infosystems.www.authoring.cgi, and that appears to either be a
dead group, or a group that has essentially been removed by my ISP,
and just hasn't gotten round to disappearing yet, because I posted the
same question there, and no new headers showed up for days -- not even
my own post. :-/
>
>HTH,
>Charles K. Clarkson
>
>[SNIP]
>
>
--
Almost there...
"Ignorance breeds confidence more often than does knowledge." -Darwin
The Emulation Newbie FAQ: http://www.emulationnet.com/emufaq.html
Remove the badgers before E-Mailing.
------------------------------
Date: 20 Feb 2001 22:35:00 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: SW processes don't finish, HELP!!!
Message-Id: <96vghk$7ue$1@boomer.cs.utexas.edu>
In article <96u64p$td5$1@vaimaca.rau.edu.uy>,
andres mackiewicz <mackiew@seciu.edu.uy> wrote:
>I have a Perl program that creates parallel processes.
>During its execution some of these processes get the "SW" state, what I see
>executing the "ps" command.
What operating system are you using? I'm using Solaris, and according
to "man ps", there is no "SW" state.
Anyway, one thing you might try doing is to use a tracing tool (like
"truss" or "strace") to connect to the process and figure out what it's
doing. It might be making a system call that's blocking, and one of
those programs should tell you what call it's making, and with what
arguments.
- Logan
--
my your his her our their *its*
I'm you're he's she's we're they're *it's*
------------------------------
Date: Wed, 21 Feb 2001 03:30:07 -0000
From: Eric Provence <infinityzone@hotmail.com>
Subject: Whats wrong with this????
Message-Id: <t96dhve0over8a@corp.supernews.com>
Okay, I'm writing a message board, and I've run into an error. Whats the
error you ask? I don't know! When I go to write a file, it won't write.
And no, i didn't open it as read. Heres the code:
#!/usr/bin/perl
use strict;
use CGI qw(:standard);
# Variables
my $uname = param('cname');
my $pass = param('pass');
my $state = param('state');
my $rname = param('tname');
my $i = 0;
if ($state eq "view") {
print header;
print "<HTML><HEAD><TITLE>Main Board</TITLE>\n";
print "<style type=text/css>A:active {COLOR: gray; TEXT-DECORATION: none}
\n";
print "A {COLOR: gray; TEXT-DECORATION: none}\n";
print "A:hover {COLOR: #ffffff; TEXT-DECORATION: none}\n";
print "A:link {COLOR: gray; TEXT-DECORATION: none}\n";
print "A:visited {COLOR: gray; TEXT-DECORATION: none}\n";
print "</style>\n";
print "</HEAD>\n";
print "<BODY TOPMARGIN=10 LEFTMARGIN=10 BGCOLOR=\"black\">\n";
print "<table border=\"0\" width=100% bgcolor=\"#000000\" cellspacing=0
cellpadding=0>\n";
print "<tr>\n";
print "<td valign=top width=\"15%\">\n";
print "<table border=\"0\" bgcolor=\"#000000\">\n";
print "<tr>\n";
print "<td bgcolor=\"#181818\" valign=\"top\">\n";
print "<font face=\"Verdana\" COLOR=\"white\">$uname</font>\n";
print "</td></tr>\n";
print "<tr>\n";
print "<td bgcolor=\"#2F2F2F\" valign=\"top\" width=\"15%\">\n";
print "<font face=\"Verdana\">\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A
HREF=\"linktosomewhere\">Link</A><BR><BR><BR><BR><BR><BR><BR>\n";
print "</font>\n";
print "</td></tr></table>\n";
print "</td>\n";
print "<td valign=top>\n";
print "<DIV ALIGN=\"center\">\n";
print "<font face=\"Verdana\"><A HREF=\"mainboard.cgi?
cname=$uname&pass=$pass&state=npost\">New Post</A></font>\n";
print "<table border=\"0\" bgcolor=\"#000000\" width=\"80%\">\n";
print "<tr valign=top>\n";
print "<td bgcolor=\"#181818\" valign=\"top\">\n";
print "<center><font face=\"Verdana\"
color=\"white\">Post</font></center>\n";
print "</td><td bgcolor=\"#181818\" valign=\"top\"><center><font
face=\"Verdana\" color=\"white\">By</font></center></td></tr>\n";
open (READIN, "mainboard.txt") or die "Can't Open File: $!\n";
my $list = <READIN>;
close (READIN);
my @posts = split /÷/, $list;
my $numelements = @posts;
foreach $i (0 .. $numelements-1) {
my @thispost = split /€/, $posts[$i];
print "<tr>\n";
print "<td bgcolor=\"#2F2F2F\" valign=\"top\">\n";
print "<font face=\"Verdana\" color=\"white\" size=2>\n";
print "<A HREF=\"mainboard.cgi?
cname=$uname&pass=$pass&state=vpost&tname=$thispost[0]\">$thispost[0]
</A>\n";
print "</td>\n";
print "<td bgcolor=\"#2F2F2F\" valign=\"top\">\n";
print "<font face=\"Verdana\" color=\"white\" size=2>$thispost[1]
</font>\n";
print "</td></tr>\n";
}
print "</table>\n";
print "</div>\n";
print "</td></tr></table>\n";
print "<BR><BR><center><font size=1 face=\"Verdana\"
color=\"red\">Copyright info goes here(that is if SD has any)
</font></center>\n";
print "</BODY>\n";
print "</HTML>\n";
} elsif($state eq "npost") {
my $subject = param('subject');
my $msg = param('msg');
if ($subject eq "") {
print header;
print "<HTML><HEAD><TITLE>Main Board - New Post</TITLE>\n";
print "<style type=text/css>A:active {COLOR: gray; TEXT-DECORATION: none}
\n";
print "A {COLOR: gray; TEXT-DECORATION: none}\n";
print "A:hover {COLOR: #ffffff; TEXT-DECORATION: none}\n";
print "A:link {COLOR: gray; TEXT-DECORATION: none}\n";
print "A:visited {COLOR: gray; TEXT-DECORATION: none}\n";
print "</style>\n";
print "</HEAD>\n";
print "<BODY TOPMARGIN=10 LEFTMARGIN=10 BGCOLOR=\"black\">\n";
print "<table border=\"0\" width=100% bgcolor=\"#000000\" cellspacing=0
cellpadding=0>\n";
print "<tr>\n";
print "<td valign=top width=\"15%\">\n";
print "<table border=\"0\" bgcolor=\"#000000\">\n";
print "<tr>\n";
print "<td bgcolor=\"#181818\" valign=\"top\">\n";
print "<font face=\"Verdana\" COLOR=\"white\">$uname</font>\n";
print "</td></tr>\n";
print "<tr>\n";
print "<td bgcolor=\"#2F2F2F\" valign=\"top\" width=\"15%\">\n";
print "<font face=\"Verdana\">\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A
HREF=\"linktosomewhere\">Link</A><BR><BR><BR><BR><BR><BR><BR>\n";
print "</font>\n";
print "</td></tr></table>\n";
print "</td>\n";
print "<td valign=top>\n";
print "<DIV ALIGN=\"center\">\n";
print "<table border=\"0\" bgcolor=\"#000000\" width=\"80%\">\n";
print "<tr valign=top>\n";
print "<td bgcolor=\"#181818\" valign=\"top\">\n";
print "<center><font face=\"Verdana\" color=\"white\">New
Post</font></center></td></tr>\n";
print "<tr>\n";
print "<td bgcolor=\"#2F2F2F\" valign=\"top\">\n";
print "<font face=\"Verdana\" color=\"white\" size=2>\n";
print "<form action=\"mainboard.cgi\">\n";
print "<INPUT TYPE=\"hidden\" NAME=\"cname\" VALUE=\"$uname\"><INPUT
TYPE=\"hidden\" NAME=\"pass\" VALUE=\"$pass\"><INPUT TYPE=\"hidden\"
NAME=\"state\" VALUE=\"npost\">\n";
print " Subject: <INPUT TYPE=\"text\"
NAME=\"subject\" SIZE=18><BR>\n";
print " Message:<BR>\n";
print " <TEXTAREA COLS=30 ROWS=9
NAME=\"msg\"></TEXTAREA><BR>\n";
print " <A HREF=\"smiles.html\" TARGET=new>SD Smiles</A><BR>\n";
print "<center><INPUT TYPE=\"submit\" VALUE=\"Post\"> <INPUT
TYPE=\"reset\" VALUE=\"Clear\"></center>\n";
print "</form>\n";
print "</td></tr></table>\n";
print "</div>\n";
print "</td></tr></table>\n";
print "<BR><BR><center><font size=1 face=\"Verdana\"
color=\"red\">Copyright info goes here(that is if SD has any)
</font></center>\n";
print "</BODY>\n";
print "</HTML>\n";
}else {
open (NEWPOST, ">$subject");
print NEWPOST "<table border=\"0\" bgcolor=\"#000000\" width=\"80%\">\n";
print NEWPOST "<tr valign=top>\n";
print NEWPOST "<td bgcolor=\"#181818\" valign=\"top\">\n";
print NEWPOST "<center><font face=\"Verdana\"
color=\"white\">$subject</font></center></td></tr>\n";
print NEWPOST "<tr>\n";
print NEWPOST "<td bgcolor=\"#2F2F2F\" valign=\"top\">\n";
print NEWPOST "<font face=\"Verdana\" color=\"white\" size=2>\n";
print NEWPOST "$msg\n";
print NEWPOST "</font></td></tr>\n";
close (NEWPOST);
open (ADDPOST, ">>mainboard.txt") or die "Can't open file: $!\n";
print ADDPOST "$subject€$uname÷";
close (ADDPOST);
print header;
print "<HTML><HEAD><TITLE>Main Board - Post Added</TITLE>\n";
print "<style type=text/css>A:active {COLOR: gray; TEXT-DECORATION: none}
\n";
print "A {COLOR: gray; TEXT-DECORATION: none}\n";
print "A:hover {COLOR: #ffffff; TEXT-DECORATION: none}\n";
print "A:link {COLOR: gray; TEXT-DECORATION: none}\n";
print "A:visited {COLOR: gray; TEXT-DECORATION: none}\n";
print "</style>\n";
print "</HEAD>\n";
print "<BODY TOPMARGIN=10 LEFTMARGIN=10 BGCOLOR=\"black\">\n";
print "<table border=\"0\" width=100% bgcolor=\"#000000\" cellspacing=0
cellpadding=0>\n";
print "<tr>\n";
print "<td valign=top width=\"15%\">\n";
print "<table border=\"0\" bgcolor=\"#000000\">\n";
print "<tr>\n";
print "<td bgcolor=\"#181818\" valign=\"top\">\n";
print "<font face=\"Verdana\" COLOR=\"white\">$uname</font>\n";
print "</td></tr>\n";
print "<tr>\n";
print "<td bgcolor=\"#2F2F2F\" valign=\"top\" width=\"15%\">\n";
print "<font face=\"Verdana\">\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A
HREF=\"linktosomewhere\">Link</A><BR><BR><BR><BR><BR><BR><BR>\n";
print "</font>\n";
print "</td></tr></table>\n";
print "</td>\n";
print "<td valign=top>\n";
print "<DIV ALIGN=\"center\">\n";
print "<table border=\"0\" bgcolor=\"#000000\" width=\"80%\">\n";
print "<tr valign=top>\n";
print "<td bgcolor=\"#181818\" valign=\"top\">\n";
print "<center><font face=\"Verdana\" color=\"white\">Post
Added</font></center></td></tr>\n";
print "<tr>\n";
print "<td bgcolor=\"#2F2F2F\" valign=\"top\">\n";
print "<font face=\"Verdana\" color=\"white\" size=2>\n";
print "Your post was added. Thank you for posting on the <B>Main
Board</B>, please post again.<BR>\n";
print "<CENTER><A HREF=\"mainboard.cgi?
cname=$uname&pass=$pass&state=view\"><<Return>></A>\n";
print "</td></tr></table>\n";
print "</div>\n";
print "</td></tr></table>\n";
print "<BR><BR><center><font size=1 face=\"Verdana\"
color=\"red\">Copyright info goes here(that is if SD has any)
</font></center>\n";
print "</BODY>\n";
print "</HTML>\n";
}
} elsif($state eq "vpost") {
my $rname = param('tname');
print header;
print "<HTML><HEAD><TITLE>Main Board - $rname</TITLE>\n";
print "<style type=text/css>A:active {COLOR: gray; TEXT-DECORATION: none}
\n";
print "A {COLOR: gray; TEXT-DECORATION: none}\n";
print "A:hover {COLOR: #ffffff; TEXT-DECORATION: none}\n";
print "A:link {COLOR: gray; TEXT-DECORATION: none}\n";
print "A:visited {COLOR: gray; TEXT-DECORATION: none}\n";
print "</style>\n";
print "</HEAD>\n";
print "<BODY TOPMARGIN=10 LEFTMARGIN=10 BGCOLOR=\"black\">\n";
print "<table border=\"0\" width=100% bgcolor=\"#000000\" cellspacing=0
cellpadding=0>\n";
print "<tr>\n";
print "<td valign=top width=\"15%\">\n";
print "<table border=\"0\" bgcolor=\"#000000\">\n";
print "<tr>\n";
print "<td bgcolor=\"#181818\" valign=\"top\">\n";
print "<font face=\"Verdana\" COLOR=\"white\">$uname</font>\n";
print "</td></tr>\n";
print "<tr>\n";
print "<td bgcolor=\"#2F2F2F\" valign=\"top\" width=\"15%\">\n";
print "<font face=\"Verdana\">\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A HREF=\"linktosomewhere\">Link</A><BR>\n";
print "-<A
HREF=\"linktosomewhere\">Link</A><BR><BR><BR><BR><BR><BR><BR>\n";
print "</font>\n";
print "</td></tr></table>\n";
print "</td>\n";
print "<td valign=top>\n";
print "<DIV ALIGN=\"center\">\n";
open (READIT, "$rname");
my $thispost = <READIT>;
close (READIT);
print "$thispost";
print "</table>\n";
print "</div>\n";
print "</td></tr></table>\n";
print "<BR><BR><center><font size=1 face=\"Verdana\"
color=\"red\">Copyright info goes here(that is if SD has any)
</font></center>\n";
print "</BODY>\n";
print "</HTML>\n";
}
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: Wed, 21 Feb 2001 04:15:48 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Whats wrong with this????
Message-Id: <slrn996g7j.311.tjla@thislove.dyndns.org>
I was shocked! How could Eric Provence <infinityzone@hotmail.com>
say such a terrible thing:
>Okay, I'm writing a message board, and I've run into an error. Whats the
>error you ask? I don't know! When I go to write a file, it won't write.
>And no, i didn't open it as read. Heres the code:
No idea at all. You might have more luck if you trimmed it down to the
code that is failing. And actually *pointing out* which of the numerous
file read/writes is filing could help as well.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
It is your destiny.
- Darth Vader
------------------------------
Date: Tue, 20 Feb 2001 20:18:17 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Whats wrong with this????
Message-Id: <3A934189.F5BF3C2A@stomp.stomp.tokyo>
Eric Provence wrote:
> Okay, I'm writing a message board, and I've run into an error. Whats the
> error you ask? I don't know! When I go to write a file, it won't write.
> And no, i didn't open it as read. Heres the code:
(snipped)
Primary problem with your code is it does not load
and run. You are lacking a content type print. After
a content type print is added, your script produces
zero data, a blank page and a message,
"Document contained no data. Contact server admin... etc."
My suggestion is you work with a script which actually
loads and runs, before deciding you have problems.
* laughs *
Godzilla!
------------------------------
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 V10 Issue 324
**************************************