[22009] in Perl-Users-Digest
Perl-Users Digest, Issue: 4231 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 7 21:05:55 2002
Date: Sat, 7 Dec 2002 18:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 7 Dec 2002 Volume: 10 Number: 4231
Today's topics:
[OT] Re: Future of Perl as an application server langua (Simon)
ANNOUNCE: HTML::BarGraph - bar graphs in HTML <vlad@podgurschi.org>
backreference behavior and other weirdness, what's happ <afb107@REMOVEIThotmail.com>
Re: backreference behavior and other weirdness, what's <tassilo.parseval@post.rwth-aachen.de>
Re: backreference behavior and other weirdness, what's <eric.ehlers@btopenworld.com.spamoff>
Re: Future of Perl as an application server language? (Randal L. Schwartz)
Re: Getting a script to run properly <ellem@optonline.net>
Re: Getting a script to run properly <ellem@optonline.net>
Re: Getting a script to run properly <tony_curtis32@yahoo.com>
Re: io::socket::inet / tcp question <smackdab1@hotmail.com>
Re: io::socket::inet / tcp question <goldbb2@earthlink.net>
Re: Multi-dimensional hash question <tassilo.parseval@post.rwth-aachen.de>
Re: Need help with file output/editing - newbie btam01@ccsf.edu
Re: Need help with file output/editing - newbie (Tad McClellan)
Re: Need help with file output/editing - newbie (unixfox)
Newbie help please !! <wenglennSPAM@ozemail.com.au>
Re: Newbie help please !! <nobody@dev.null>
Re: Newbie help please !! <bbwolf@magiclix.com>
Re: ssh using net::telnet problem <crb@wedesigns.com>
Re: ssh using net::telnet problem <crb@wedesigns.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 7 Dec 2002 13:32:38 -0800
From: simonf@simonf.com (Simon)
Subject: [OT] Re: Future of Perl as an application server language?
Message-Id: <3226c4d3.0212071332.1f483f9c@posting.google.com>
"Alan J. Flavell" <flavell@mail.cern.ch> wrote in message news:<Pine.LNX.4.40.0212071630560.16301-100000@lxplus071.cern.ch>...
> On Dec 7, Simon inscribed on the eternal scroll:
>
> > merlyn@stonehenge.com (Randal L. Schwartz) wrote
>
> [...]
>
> > Randalph,
>
> ITYM "Gandalf". SCNR.
Apologies to Randal for the misspelling.
I will definitely be killfiled by him after this posting.
Should not Gandalf be White or Gray, and not Black? :)))
Simon
------------------------------
Date: Sat, 07 Dec 2002 16:26:55 GMT
From: Vlad Podgurschi <vlad@podgurschi.org>
Subject: ANNOUNCE: HTML::BarGraph - bar graphs in HTML
Message-Id: <3df220c4$1_6@news.teranews.com>
Hello all,
New module on CPAN:
HTML::BarGraph - generate multiset bar graphs with plain HTML
Features:
- it can display more than one data set on the same graphic
- one can change the direction of the bars (vertical, horizontal) by
simply changing one parameter
- when used in plain HTML mode, the graphic (and the module) is
completely independent - it doesn't require any graphic or graphic
library
- when used in plain HTML mode, the graphic is entirely included in
the page, so by saving the webpage, the whole graphic is saved with it
- highly customizable
- graphics for web polls and such simple data sets can be quickly
created, without the overhead implied by "on the fly" graphic
generation
man page:
http://search.cpan.org/author/PODGURSV/HTML-BarGraph-0.5/BarGraph.pm
sample output:
http://search.cpan.org/src/PODGURSV/HTML-BarGraph-0.5/sample.html
Comments, suggestions etc welcome.
Thank you,
vlad
------------------------------
Date: Sat, 07 Dec 2002 12:22:38 -0700
From: Allen B <afb107@REMOVEIThotmail.com>
Subject: backreference behavior and other weirdness, what's happening?
Message-Id: <fch4vug0habrjqhr5midng9b6hcbc26pnr@4ax.com>
I've been using Perl off and on for over a year now, and while I'm no
hands-down expert at reg expressions, I still can pretty much get what
I want, even if I have to consult the Camel book to help.
So here's what's happening. I have a text file with rows of data in
it. I want to open the text file, read the entries, write the ones I
want to keep to a new file and the ones I want to remove to another
new file. Here is some example data:
AC#24,N8552,87%,12Hr,IFR,01:53:44,07:00:58,100,F,7770,CYKZ,07:53:44,13:00:58,090,F,7771,CYHZ
AC#26,N37072,84%,6Hr,IFR,02:09:36,04:05:15,330,F,4853,DTTZ,05:09:28,07:05:07,320,F,4854,LEBZ
AC#26,N36968,100%,8Hr,IFR,00:49:10,03:58:44,300,F,5309,KFFZ,04:49:03,07:58:37,290,F,5310,KRYY
AC#2,N31152,14%,8Hr,IFR,01:17:42,04:14:55,140,F,9222,ZSFZ,05:17:35,08:14:48,130,F,9223,ZKPY
AC#21,N35256,43%,12Hr,VFR,04:14:11,09:26:16,095,F,9436,EPRZ,10:14:06,15:26:11,085,F,9437,LFPY
AC#4,N8888,59%,12Hr,IFR,05:18:47,10:13:04,260,F,6542,HEAX,11:19:03,16:13:20,270,F,6541,UUYY
AC#7,N38080,16%,24Hr,IFR,06:26:01,17:30:43,300,F,6070,KLAX,18:26:01,05:30:43,290,F,6071,LOWW
AC#5,N1304,93%,8Hr,IFR,02:47:42,05:56:01,320,F,1355,KALW,06:47:42,09:56:01,310,F,1356,KAFW
AC#3,N33552,57%,8Hr,IFR,00:06:55,03:09:59,300,F,2412,KLAX,04:06:55,07:09:59,290,F,2413,KHOU
AC#30,N89480,8%,12Hr,IFR,00:30:46,03:47:06,120,F,0632,KSUX,06:30:51,09:47:11,130,F,0631,KMSY
AC#26,N79936,92%,12Hr,VFR,01:08:02,05:44:07,305,F,5348,TISX,07:08:07,11:44:12,315,F,5347,SBFZ
AC#17,N56984,18%,6Hr,VFR,01:36:41,03:51:45,125,F,0330,KCXY,04:36:41,06:51:45,115,F,0331,CYMX
.. and here is the code I wrote...
----------------------------------------------
#!/usr/bin/perl -w
open(INPUT, "mydata.txt");
open(OUTPUT, ">mydata_new.txt");
open(SAVED, ">clipped_data.txt");
while (<INPUT>) {
s/^(AC#(?:3|4|5|6|7|8|9|10|11),.+\n)//;
print SAVED $1;
print OUTPUT $_;
}
close(INPUT);
close(OUTPUT);
close(SAVED);
----------------------------------------------
When I run this, I get what I want. Which for the above example would
be to put rows 6 thru 9 in clipped_data.txt and all the other rows in
mydata_new.txt. However, I get these kinds of messages when I run the
script:
Use of uninitialized value ... at line 9... in <INPUT> line 6
Use of uninitialized value ... at line 9... in <INPUT> line 7
Use of uninitialized value ... at line 9... in <INPUT> line 8
Use of uninitialized value ... at line 9... in <INPUT> line 9
Meaning that the interpreter is saying $1 is uninitalized? How can
that be?
I thought maybe this was some kind of behavior a-la using the -w flag.
So I tried dropping the flag. I got an error saying:
bad interpreter: no such file or directory
meaning I assume that without the -w flag it can't seem to locate the
perl interpreter even though a "which perl" command gives the result
/usr/bin/perl
I am running this on Mandrake Linux 9.0 using Perl v5.8.0
Any guesses as to what is causing this behavior?
Thanks!
Allen
P.S. - I also had to change a portion of the reg ex from .* to .+
because I was also getting at error saying something to the effect
that I was improperly using the concatention operator.
------------------------------
Date: 7 Dec 2002 19:34:41 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: backreference behavior and other weirdness, what's happening?
Message-Id: <astigh$m18$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Allen B:
> I've been using Perl off and on for over a year now, and while I'm no
> hands-down expert at reg expressions, I still can pretty much get what
> I want, even if I have to consult the Camel book to help.
>
> So here's what's happening. I have a text file with rows of data in
> it. I want to open the text file, read the entries, write the ones I
> want to keep to a new file and the ones I want to remove to another
> new file. Here is some example data:
[...]
> .. and here is the code I wrote...
>
> ----------------------------------------------
>
> #!/usr/bin/perl -w
>
> open(INPUT, "mydata.txt");
> open(OUTPUT, ">mydata_new.txt");
> open(SAVED, ">clipped_data.txt");
>
> while (<INPUT>) {
> s/^(AC#(?:3|4|5|6|7|8|9|10|11),.+\n)//;
> print SAVED $1;
> print OUTPUT $_;
> }
You use the digit-variables without prior checking that the match was
succesful. If it was not, they are undefined. Also, you don't need a
substitution for that. A simple match will do:
if (/^(AC#(?:[3-9]|10|11),/) {
print SAVED $1;
} else {
print OUTPUT;
}
It is also more logical since your algorithm should behave like a
switch: When match, write extracted string to file 1, otherwise put
whole string into file 2. The above if/else code makes this clearer
IMHO.
The lesson you should learn: *never* use the digit variables without
being sure that your matching succeeded. This can lead to subtle bugs
because $1, $2 ... can contain stuff from previous matchings and you
wonder why your program behaves oddly.
> When I run this, I get what I want. Which for the above example would
> be to put rows 6 thru 9 in clipped_data.txt and all the other rows in
> mydata_new.txt. However, I get these kinds of messages when I run the
> script:
>
> Use of uninitialized value ... at line 9... in <INPUT> line 6
> Use of uninitialized value ... at line 9... in <INPUT> line 7
> Use of uninitialized value ... at line 9... in <INPUT> line 8
> Use of uninitialized value ... at line 9... in <INPUT> line 9
>
> Meaning that the interpreter is saying $1 is uninitalized? How can
> that be?
Because you did not check whether anything got matched at all.
> I thought maybe this was some kind of behavior a-la using the -w flag.
> So I tried dropping the flag. I got an error saying:
>
> bad interpreter: no such file or directory
Good that this happened. Switching off -w to shut up perl is a bad idea.
Instead, fix the offending code and keep the -w.
> meaning I assume that without the -w flag it can't seem to locate the
> perl interpreter even though a "which perl" command gives the result
> /usr/bin/perl
That probably happens because you have an odd line-ending on the shebang
line (unprintable character ^M below).
#! /usr/bin/perl -w^M
works ok since the interpreter itself is not affected.
#! /usr/bin/perl^M
Oups, your OS tries to execute the script with /usr/bin/perl^M which
does not exist. Run your script through dos2unix or so. Probably the
above happened in an ftp-transaction where you forgot to set the
transfer-mode to ascii.
> P.S. - I also had to change a portion of the reg ex from .* to .+
> because I was also getting at error saying something to the effect
> that I was improperly using the concatention operator.
This is odd. Perhaps a parser bug? Can you give the exact message along
with how the line looked?
Tassilo
--
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;
------------------------------
Date: Sat, 7 Dec 2002 23:22:22 +0000 (UTC)
From: "eric" <eric.ehlers@btopenworld.com.spamoff>
Subject: Re: backreference behavior and other weirdness, what's happening?
Message-Id: <astvre$dk4$1@knossos.btinternet.com>
> if (/^(AC#(?:[3-9]|10|11),/) {
> print SAVED $1;
> } else {
> print OUTPUT;
> }
this crashes because the parenthesis are mismatched. if you add the missing
closing parenthesis, $1 just contains "AC#4," whereas i think the aim is to
capture the entire line, you could do that with
if (/^(AC#(?:[3-9]|10|11),.*)$/s) {
where .* captures the rest of the line and the s modifier tells . to pick up
the newline as well.
eric
------------------------------
Date: 07 Dec 2002 08:48:23 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Future of Perl as an application server language?
Message-Id: <86hedp22so.fsf@red.stonehenge.com>
>>>>> "Simon" == Simon <simonf@simonf.com> writes:
Simon> It's not the question of which technology is the best. It's the
Simon> question of which technology is *perceived* to be the best, and here
Simon> the managers' opinion counts. And the bookstore shelves provide a
Simon> rough approximation of the crowd's perception. Perl does not look good
Simon> there. (And the whole thing about Perl 6 breaking the old syntax and
Simon> Perl 5 internals being messy does not help, even though the transition
Simon> a good technical decision. Believe me - I heard people say that,
Simon> comparing Perl to Python which "was not broken to begin with".)
Simon> To other readers - please do not flame me on the above paragraph. I am
Simon> simply stating the perception of Perl that a lot of people have.
Simon> I dearly hope that Perl will not lose because of the stupid perception
Simon> issues. However, I believe that the danger is sufficiently real and
Simon> great to merit some action. Without either a strong open-source
Simon> standard-based app server or a viable commercial product Perl will
Simon> always be on the fringe in the managers' minds. IMHO.
This is precisely why I established The Perl Institute, funded with
royalties from the Camel and Llama book, many years ago. It's also
why I was on the founding board of The Perl Mongers, and have spent a
lot of my time performing Perl advocacy.
We live in a marketplace, where ideas do not get equal footing
strictly on technical merit. Commercial history shows time and time
again that good ideas sometimes get buried by marketing and bad
management decisions (VHS vs Beta, for example).
Luckily, Perl solutions seem to be good enough that people "sneak Perl
in" to organizations, and the nature of free software means we don't
need to have a budget to aquire software or get support.
It's not a trivial problem, but it's also not as impossible as some
paint it. Please help us. Be sure you're not increasing the amount
of FUD. Point people at www.perl.org's success stories, and
apache.perl.org's big design wins. Be aware of how Perl improves
productivity. Be ready to point *others* to those sites. Join your
local PM group, and help produce technical meetings to share the
knowledge. Advocacy takes work, but it's worth it.
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Sun, 08 Dec 2002 00:05:00 GMT
From: Lou Moran <ellem@optonline.net>
Subject: Re: Getting a script to run properly
Message-Id: <s335vu4jv9m7casrd5v5e9o5ls2motfnmu@4ax.com>
On Fri, 06 Dec 2002 22:58:25 GMT, Uri Guttman <uri@stemsystems.com>
wrote a glowing report about my Usenet practices:
>>>>>> "LM" == Lou Moran <lou.moran@gellerandwind.com> writes:
>
>
> LM> #! /usr/local/bin/perl
>
>why is there a space after the #!?
>
I read In DuBois "MySQL & Perl For The Web" that the space was a good
idea. It never seemed to bother anything else.
>uri
--
Lou Moran
(P3 850)
Guinness _has_ affected this post
------------------------------
Date: Sun, 08 Dec 2002 00:08:59 GMT
From: Lou Moran <ellem@optonline.net>
Subject: Re: Getting a script to run properly
Message-Id: <ub35vukn7e3sinea3d1884pifc1575oj6u@4ax.com>
On Sat, 7 Dec 2002 10:20:56 +1100, "Tintin" <me@privacy.net> wrote a
glowing report about my Usenet practices:
>> barney ellem ~/code $ more uptime.pl
>>
>> #! /usr/local/bin/perl
>
>There's your problem. The she bang line has the be the on very first line.
In emacs it is Line Number 1
I did remove the space.
It's not that important I guess.
Thanks everyone.
--
Lou Moran
(P3 850)
Guinness _has_ affected this post
------------------------------
Date: Sat, 07 Dec 2002 18:15:26 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Getting a script to run properly
Message-Id: <87d6odcqn5.fsf@limey.hpcc.uh.edu>
>> On Sun, 08 Dec 2002 00:08:59 GMT,
>> Lou Moran <ellem@optonline.net> said:
> On Sat, 7 Dec 2002 10:20:56 +1100, "Tintin"
> <me@privacy.net> wrote a glowing report about my Usenet
> practices:
>> barney ellem ~/code $ more uptime.pl
>>> <-------------- here
>> #! /usr/local/bin/perl
>> There's your problem. The she bang line has the be
>> the on very first line.
> In emacs it is Line Number 1
> I did remove the space.
There appears to be a blank line before the shebang line
("here").
What does "ls -l uptime.pl" say? Also do
cat -v uptime.pl | head -4
to see if there are any non-printing characters lurking
in the file.
hth
t
------------------------------
Date: Sat, 07 Dec 2002 23:57:58 GMT
From: "smackdab" <smackdab1@hotmail.com>
Subject: Re: io::socket::inet / tcp question
Message-Id: <aWvI9.13830$jf7.517182@news2.west.cox.net>
>
> The book is correct. TCP/IP does not have any provisions for polling
> both sides of the connection, which is why many programs incorporate,
> within their internal protocol, a ping-pong command or so.
>
> If that is not feasible in your situation, then another alternative is
> to assume (or make) the client always send you something within X amount
> of time. The server then keeps track of when was the last time they've
> heard from a client, and drop the inactive ones.
>
Thanks, do you know if can_write() works this way also? How would it
know the other side can be written to without sending or checking somehow?
If that is the case, can I tell when the process died this way? (I guess
you
couldn't tell the diff between it doing work and having died...but I could
use
a timer for that...)
(I read the manpage of select, but it didn't say what happens with this
call...)
thanks!!
------------------------------
Date: Sat, 07 Dec 2002 21:00:59 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: io::socket::inet / tcp question
Message-Id: <3DF2A7DB.5D7639DF@earthlink.net>
smackdab wrote:
>
> I have a non-blocking client/server program. Since I do "stuff" while
> waiting for commands, I use $select->can_read(0) to see if I need to
> process network commands.
>
> So, will I always know if the remote connection died by using this
> technique?
That depends on what you mean, "died".
If the server program closes the connection, or exits/gets killed, then
the connection will become readable, and the next sysread will produce
an EOF.
If your modem disconnects, or your router (or any other router in
between the client and the server) dies, or the other machine crashes...
there isn't really any "instant" way to tell that the connection is no
longer valid.
> (I can only test on my local machine right now...which seems to work
> as expected)
>
> I have been reading Effective TCPIP Programming and it says that TCP
> is not polled, but the author doesn't really address the can_read
> function. If the client exits cleanly or the OS cleans up after a
> program crash, I should always be able to tell, right?
Correct.
> Same thing if the client machine loses power?
Sorry, no.
> Or does the server not get notified and have to timeout? (the book
> talkes about LONG timeouts of 9 minutes, etc...)
Right -- if you expect to get stuff from your client every few seconds,
and nothing happens for 9 minutes, you can assume that there's something
wrong with the client program or the client program's machine, and can
decide to abort the connection.
Just do $sel->can_read(9*60), and if this returns an indication of
unwritability, then abort that connection. If you are multiplexing
multiple clients, you may need to do a bit of bookkeeping, so that if
your server gets a continuous stream from one client, and nothing from
another, it has to realize that that other client is dead. This can be
done by keeping track of when each client last sent you something...
then do something like:
# %clients has as keys, stringified IO::Socket objects, and
# as values, hashrefs.
my $t1 = min( map $_->{time_of_last_message}, values %clients );
my $t2 = (time() - $t1) - 9*60;
my @ready = $sel->can_read($t2);
for( @ready ) {
$client{$_}{time_of_last_message} = time();
# handle request.
}
while( my( $socket_as_string, $info ) = each %client ) {
if(time() - $info->{time_of_last_message} > 9*60) {
close $info->{socket}; # abort connection.
delete $client{$socket_as_string};
# use %$info to restart client.
}
}
Another possibility is to set the SO_KEEPALIVE option; in this case, a
special packet (called a "keepalive probe") is sent every X seconds (by
default 2 hours, but this is supposedly modifyiable), and if no ACK is
recieved, then the socket becomes "readable", and the next sysread fails
with some particular error in errno/$! (I think net unreachable, or
somesuch).
> I am looking for a general technique to restart a client if it
> "crashes". And am wondering if I would have to use a different
> technique if the client and server are on
> different machines...
This is not really a perl question -- try consulting a socket faq:
http://www.unixguide.net/network/socketfaq/
--
$..='(?:(?{local$^C=$^C|'.(1<<$_).'})|)'for+a..4;
$..='(?{print+substr"\n !,$^C,1 if $^C<26})(?!)';
$.=~s'!'haktrsreltanPJ,r coeueh"';BEGIN{${"\cH"}
|=(1<<21)}""=~$.;qw(Just another Perl hacker,\n);
------------------------------
Date: 7 Dec 2002 19:22:56 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: Multi-dimensional hash question
Message-Id: <asthqg$lc3$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Ben Morrow:
> Mina Naguib <spam@thecouch.homeip.net> wrote:
>>The way to get around that if you have a fancy data collection, is to
>>store a reference to it. Since references are smple scalar strings, you
>>can store them as hash keys (or values) without a problem.
>
> Sorry for being pedantic, but having just corrected someone else with this
> problem, references are not 'simple scalar strings'. They _are_ SVs, ie.
> Scalar Values, but they are not strings. Hash values hold an SV, so you
> can store a ref in a hash; hash keys _are_ simple scalar _strings_, so you
> can't key a hash on a reference and expect to be able to deref the key.
To be even more pedantic, references are not SVs but RVs (Reference
Values). From an internal standpoint, you could however argue that
practically anything is a SVish value in Perl...they are all derived
from SvNULL. That allows to only have on macro for dereferncing using a
typecast to the approriate type:
HV *hash = (HV *) SvRV(ref);
AV *arry = (AV *) SvRV(ref);
SV *scal = (SV *) SvRV(ref);
...
Tassilo
--
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;
------------------------------
Date: Sat, 7 Dec 2002 11:52:36 -0800
From: btam01@ccsf.edu
Subject: Re: Need help with file output/editing - newbie
Message-Id: <Pine.HPX.4.44.0212071151560.26755-100000@hills.ccsf.cc.ca.us>
On 7 Dec 2002, unixfox wrote:
> Hello perl gurus...
>
> I have a data file that I would like the output to be displayed
> in a nice neat format. I can make the fields of the file display
> on one line at a time but how do I make those fields display the
> way I really want them? In other words, the following code displays
> like this:
>
> First Name: --------------
> Middle Name: -------------
> Last Name: ----------------
>
> I would like it to display it like this:
>
> First Name: ------------ Middle Name: ------------- Last Name: ----------
>
>
>
> print "<tr valign=top><td>First Name:</td><td><input type=text name=\"fname\" v
> alue=\"$fname\" size=35></td></tr>\n";
>
> print "<tr valign=top><td>Middle Name:</td><td><input type=text name=\"mname\"
> value=\"$mname\" size=35></td></tr>\n";
>
> print "<tr valign=top><td>Last Name:</td><td><input type=text name=\"lname\" va
> lue=\"$lname\" size=35></td></tr>\n";
>
>
> Thanks all for the help in advance.
print <<EOF;
<tr valign=top>
<td>First Name: <input type=text name="fname" value="$fname" size=20> Middle Name: <input type=text name="mname" value="$mname" size=20> Last Name: <input type=text name="lname" value="$lname" size=20>
</td>
</tr>
EOF
------------------------------
Date: Sat, 7 Dec 2002 17:55:38 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Need help with file output/editing - newbie
Message-Id: <slrnav52jq.3em.tadmc@magna.augustmail.com>
unixfox <unixfox@planetlink.net> wrote:
> In other words, the following code displays
> like this:
>
> First Name: --------------
^^^
^^^
> Middle Name: -------------
^^^
^^^
> Last Name: ----------------
>
> I would like it to display it like this:
>
> First Name: ------------ Middle Name: ------------- Last Name: ----------
So you don't want those 2 newlines that I've underlined...
> print "<tr valign=top><td>First Name:</td><td><input type=text name=\"fname\" v
> alue=\"$fname\" size=35></td></tr>\n";
^^
^^
> print "<tr valign=top><td>Middle Name:</td><td><input type=text name=\"mname\"
> value=\"$mname\" size=35></td></tr>\n";
^^
^^
...and there they are.
If you don't want them, then take them out.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 7 Dec 2002 16:01:14 -0800
From: unixfox@planetlink.net (unixfox)
Subject: Re: Need help with file output/editing - newbie
Message-Id: <f914825a.0212071601.6ff1a381@posting.google.com>
Voila!! That fixed it. Thanks !!
One more question if you don't mind.
Any way to create an output table in something like FrontPage?
Otherwise I will have to change about 50 fields inside my CGI
script.
Just curious.
Thanks again.
Chris Lowth <dont@want.spam> wrote in message news:<9xrI9.1054$iz3.126273@newsfep2-win.server.ntli.net>...
> unixfox wrote:
>
> > Hello perl gurus...
> >
> > I have a data file that I would like the output to be displayed
> > in a nice neat format. I can make the fields of the file display
> > on one line at a time but how do I make those fields display the
> > way I really want them? In other words, the following code displays
> > like this:
> >
> > First Name: --------------
> > Middle Name: -------------
> > Last Name: ----------------
> >
> > I would like it to display it like this:
> >
> > First Name: ------------ Middle Name: ------------- Last Name: ----------
> >
> >
> >
> > print "<tr valign=top><td>First Name:</td><td><input type=text
> > name=\"fname\" v alue=\"$fname\" size=35></td></tr>\n";
> >
> > print "<tr valign=top><td>Middle Name:</td><td><input type=text
> > name=\"mname\" value=\"$mname\" size=35></td></tr>\n";
> >
> > print "<tr valign=top><td>Last Name:</td><td><input type=text
> > name=\"lname\" va lue=\"$lname\" size=35></td></tr>\n";
> >
>
> You have here a table of three rows and two columns. Each row starts with
> "<tr>" and ends with "</tr>", each cell in the row (hence: column) starts
> "<td>" and ends "</td>".
>
> What you appear to want is a single row of six columns - so take out all
> "<tr>" except the first one, and all "</tr>" except the last.
>
> Voila!
------------------------------
Date: Sun, 8 Dec 2002 10:25:11 +1000
From: "HelpMe" <wenglennSPAM@ozemail.com.au>
Subject: Newbie help please !!
Message-Id: <KjwI9.20$Jh5.2957@nnrp1.ozemail.com.au>
Please Help , i built a website and installed a members password management
perl script, but it needs cgi.pm installed my host doesn't seem to have it
installed and i havn't got permissions to the perl directery. and i need
help to install it , remember i havn't any idea what i am doing when you try
2 explain it to me ,thanks in advance
------------------------------
Date: Sun, 08 Dec 2002 00:39:50 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: Newbie help please !!
Message-Id: <3DF29463.60306@dev.null>
HelpMe wrote:
> Please Help , i built a website and installed a members password management
> perl script, but it needs cgi.pm installed my host doesn't seem to have it
> installed and i havn't got permissions to the perl directery. and i need
> help to install it , remember i havn't any idea what i am doing when you try
> 2 explain it to me ,thanks in advance
If you really don't have any idea, you should hire a programmer.
Short of that, try these:
1) Get a new keyboard with a shift key that works. That will make it
easier to look for CGI.pm, which is probably what you need, rather than
cgi.pm as you say.
2) Chances are, if your host allows CGIs at all (if not, you are out of
luck and you should look for another host), CGI.pm is installed on your
server. Ask your host or simply try running a script with
use CGI
in it and see if it gives you any errors.
3) If, for some inexplicable reason, your host installed Perl without
CGI.pm, see the "How do I keep my own module/library directory?" entry
in perlfaq.
------------------------------
Date: Sun, 08 Dec 2002 09:24:36 +0800
From: bbwolf <bbwolf@magiclix.com>
Subject: Re: Newbie help please !!
Message-Id: <ei75vu8vl63dbkm49ugv0eg6u6ddhr5bm8@4ax.com>
i think u can get a cgi.pm an then use "require".
and cp cgi.pm to a directery u have permissions to access.
require "path/cgi.pm"
On Sun, 8 Dec 2002 10:25:11 +1000, "HelpMe"
<wenglennSPAM@ozemail.com.au> wrote:
>Please Help , i built a website and installed a members password management
>perl script, but it needs cgi.pm installed my host doesn't seem to have it
>installed and i havn't got permissions to the perl directery. and i need
>help to install it , remember i havn't any idea what i am doing when you try
>2 explain it to me ,thanks in advance
>
------------------------------
Date: Sat, 7 Dec 2002 18:35:05 -0500
From: "a2liter" <crb@wedesigns.com>
Subject: Re: ssh using net::telnet problem
Message-Id: <4mvI9.1060$X%3.650@news.bellsouth.net>
>"Ben Morrow" <mauzo@mimosa.csv.warwick.ac.uk> wrote in message
news:astfgc$20o$1@wisteria.csv.warwick.ac.uk...
> "a2liter" <crb@wedesigns.com> wrote:
>
> This is a _very_ bad idea. You have to be _extremely_ careful about who
can
> read this script if it's got passwords in it.
>
> I would advise setting up public-key authentication for ssh, if you can,
so
> you don't need to send the password at all. This will, I guess, solve the
> problem.
>
> Ben
I agree with the password vs key thing. I am just trying to get it to work.
That is why I just put generic stuff in the post for UN/PW and IP addresses.
------------------------------
Date: Sat, 7 Dec 2002 18:51:23 -0500
From: "a2liter" <crb@wedesigns.com>
Subject: Re: ssh using net::telnet problem
Message-Id: <lBvI9.1110$X%3.1036@news.bellsouth.net>
>"Ben Morrow" <mauzo@mimosa.csv.warwick.ac.uk> wrote in message
news:astfgc$20o$1@wisteria.csv.warwick.ac.uk...
> This is a _very_ bad idea. You have to be _extremely_ careful about who
can
> read this script if it's got passwords in it.
>
> I would advise setting up public-key authentication for ssh, if you can,
so
> you don't need to send the password at all. This will, I guess, solve the
> problem.
>
> Ben
Just a little more follow up on why I am trying to do it this way. Where I
work we are about to start using SSH instead of telnet for router access. A
lot of the tools that we have written use telnet. So using a key may not be
a solution since the router cant store such information. Also the systmes
that this script is on is on an isolated network and only about 3 people
will have the ability to read the script and see the info contained with in.
and those people should know it already.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.
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 4231
***************************************