[16752] in Perl-Users-Digest
Perl-Users Digest, Issue: 4164 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 29 14:05:40 2000
Date: Tue, 29 Aug 2000 11:05:24 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <967572323-v9-i4164@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 29 Aug 2000 Volume: 9 Number: 4164
Today's topics:
Re: another "why doesn't this work?" question. <philipg@atl.mediaone.net>
confining a search to a part one part of a text file techhead99324@my-deja.com
Executing Shell Commands in Perl <nail.uenlue@freesurf.ch>
Re: Executing Shell Commands in Perl <yanoff@yahoo.com>
Re: Executing Shell Commands in Perl (Tony L. Svanstrom)
Re: File handles with scalar value <tim@ipac.caltech.edu>
Re: Get own machine's dial-up IP address? mexicanmeatballs@my-deja.com
Re: Getting slices of this ...(not pizza) (Keith Calvert Ivey)
Getting the greedy RegEx, wanting the Lazy - help? ptomsic@my-deja.com
Re: hour difference between localtime and POSIX::mktime steinra@my-deja.com
Re: How do I manipulate each element of an array? (Colin Keith)
Re: How to Unzip a .tar.gz file (Keith Calvert Ivey)
Re: How to Unzip a .tar.gz file <bart.lateur@skynet.be>
Re: Is perl powerful enough to create cybermoney? <armingaud@noos.fr>
Re: making sure input is a certain way i.e. starting an (Colin Keith)
Re: making sure input is a certain way i.e. starting an <star@sonic.net>
Re: making sure input is a certain way i.e. starting an <tim@ipac.caltech.edu>
Re: making sure input is a certain way i.e. starting an <tim@ipac.caltech.edu>
method="get" <e.hofstra@student.utwente.nl>
Re: method="get" <mcnultya@NOSPAMnortelnetworks.com>
Re: method="get" <tom.kralidis@ccrs.nrcan.gcDOTca>
Re: method="get" (Greg Bacon)
Re: method="get" (Tony L. Svanstrom)
Re: MIME Mail help on NT - no sendmail! eryq@zeegee.com
Re: MySQL and perl (Colin Keith)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 29 Aug 2000 13:45:20 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: another "why doesn't this work?" question.
Message-Id: <Q7Pq5.71$gg.55089@typhoon.southeast.rr.com>
James Lee <jameslee@cse.buffalo.edu> wrote in message
news:8ofl3q$ro$1@prometheus.acsu.buffalo.edu...
> Sorry, it's been a while since I've touched perl, and I'm running short on
> time. Any way, I'm trying to do convert all tabs to spaces in my c
programs
> using the following code:
>
> ---begin perl code (windows NT platform)
>
> @ARGV = glob ("*") unless @ARGV;
>
> while (@ARGV)
> {
> s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
> print $_;
> }
>
Use "for" not "while" here.
hth,
Philip
------------------------------
Date: Tue, 29 Aug 2000 17:43:06 GMT
From: techhead99324@my-deja.com
Subject: confining a search to a part one part of a text file
Message-Id: <8ogsn4$ond$1@nnrp1.deja.com>
Okay, here I go. I have a perl script currently that is being used to
search two different text files. One text file is a people directory
and one file is a department directory. I need the search to only
search the first three or four characters in the text files. I am at
the end of my knowledge of perl, so I need help. Below is a snippet of
code that does the searches. Anybody want to venture a hint on how to
accomplish this?
#!/usr/bin/perl
require "/home/domains/wwc/cgi/cgi-lib.pl";
print &PrintHeader;
&ReadParse;
$sSearch=$in{'searchme'};
$sDataSet=$in{'dataset'};
#$in{'searchme'}=~tr/a-z/A-Z/;
########## M A I N
if ($in{'dataset'} eq "Departments") {
# &header;
&searchagain;
&deptsearch;
# &footer;
}
else {
# &header;
&searchagain;
&peopsearch;
# &footer;
}
sub peopsearch {
open(FILE, "dir1.txt");
$found="N";
$header="N";
while(<FILE>) {
if (/$in{'searchme'}/i) {
if ($header eq "N") {
print "Search Results:";
print "<PRE> Last Name First Name
Phone Bldg Dept";
print "<BR>";
print " ----------------------------------------------------
---------";
print "<BR>";
$header="Y";
}
print " ";
print;
print "<BR>";
}
}
if ($header eq "N") {
¬found;
}
}
sub deptsearch {
open(FILE, "depts.txt");
$found="N";
$header="N";
while(<FILE>) {
if (/$in{'searchme'}/i) {
if ($header eq "N") {
print "Search Results:";
print "<PRE>";
print " Departmental
Listing Phone Mail Box\n";
print " ---------------------------------
---------------------------------------\n";
print "<BR>";
$header="Y";
}
print " ";
print;
print "<BR>";
}
}
if ($header eq "N") {
¬found;
}
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 29 Aug 2000 18:36:16 +0200
From: "Nail Ünlü" <nail.uenlue@freesurf.ch>
Subject: Executing Shell Commands in Perl
Message-Id: <8ogoqm$avo$1@news.imp.ch>
Hi folks,
i tried to write some shell commands with "exec" in perl
and it didn't work. I changed the options in apache conf
for allowing SSI but it didn't work....
i also use STDOUT to read the output but no way....
is there another way to execute commands like
rup $computername
in perl???
Thx in advance,
nail
------------------------------
Date: Tue, 29 Aug 2000 12:20:01 -0500
From: Scott Yanoff <yanoff@yahoo.com>
To: Nail =?iso-8859-1?Q?=DCnl=FC?= <nail.uenlue@freesurf.ch>
Subject: Re: Executing Shell Commands in Perl
Message-Id: <39ABF0C1.B1FDADE6@yahoo.com>
"Nail Ünlü" wrote:
> i tried to write some shell commands with "exec" in perl
> and it didn't work. I changed the options in apache conf
> for allowing SSI but it didn't work....
> i also use STDOUT to read the output but no way....
>
> is there another way to execute commands like
>
> rup $computername
>
> in perl???
Is your Perl script a CGI program?
One way to try to execute another program in Perl is with the "system"
command.
Make sure that you are using the full pathname to the program you are
trying to execute. Also make sure that whatever user your server is
running as also has permission to execute the program you are trying to
call with the "system" command.
If this is a CGI program, you want to be careful if you are passing the
system call any user input.
Good luck,
-Scott
------------------------------
Date: Tue, 29 Aug 2000 19:22:26 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Executing Shell Commands in Perl
Message-Id: <1eg54g7.1ee997z1vgh13N%tony@svanstrom.com>
Nail Ünlü <nail.uenlue@freesurf.ch> wrote:
> i tried to write some shell commands with "exec" in perl and it didn't
> work. I changed the options in apache conf for allowing SSI but it didn't
> work....
> i also use STDOUT to read the output but no way....
>
> is there another way to execute commands like
>
> rup $computername
$::rup = qx(rup $computername);
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
on the verge of frenzy - i think my mask of sanity is about to slip
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©99-00 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Tue, 29 Aug 2000 10:37:55 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: File handles with scalar value
Message-Id: <39ABF4F3.E396744C@ipac.caltech.edu>
QarnoS wrote:
> When working with the CGI module, if the submitted form contains a file
> upload, the CGI::param method will return a scalar which doubles as a
> filename and a file handle.
>
> Ie. I can do this:
> $file = $cgi->param('uploadedfile');
> print "Contents of $file:";
> print <$file>;
>
> I was just wondering how the CGI module achieves this.
Cool, isn't it? First realize that $file is an object reference, then read the
'overload' docs. Especially look for the sections on 'conversion' (stringifying)
and iteration (<>).
--
-- Tim Conrow tim@ipac.caltech.edu 626-395-8435
------------------------------
Date: Tue, 29 Aug 2000 16:34:31 GMT
From: mexicanmeatballs@my-deja.com
Subject: Re: Get own machine's dial-up IP address?
Message-Id: <8ogoml$jdc$1@nnrp1.deja.com>
In article <MPG.14147162c4575c0c9898f1@news.onlynews.com>,
Randall Parker <rgparker@west.net> wrote:
> Suppose a machine has a permanent (or even dynamic) IP address it uses
on
> a local network. But suppose in addition it gets a dynamic IP address
> handed to it every time it does dial-up to an ISP using a phone modem
or
> cable modem or DSL modem.
>
> Okay, the question is, how to find out what that second IP address is?
>
> My goal is to have some machine sitting at home that is connected via
> auto-dial phone modem or cable modem at a certain time of the day
> (using a Perl script of course) to connect to the internet, find out
its
> dynamic IP address, and then connect to a machine I have at work (that
> has a static IP address) and tell it what the dynamic IP address is.
>
> If possible I'd like to do this in a portable way that will work
across
> Linux, OS/2, and NT. A friend has an OS/2 box and he and I both want
to
> do this.
>
After some experimentation the only way I could get the IP address
from my machine here (Linux/LAN based) without parsing
ifconfig/ipconfig was this, not very clean I'm afraid:
use Socket;
socket(IN, PF_INET, SOCK_DGRAM, IPPROTO_IP);
connect(IN, sockaddr_in(0, 0));
($port, @addr) = unpack_sockaddr_in(getsockname(IN));
print inet_ntoa($addr[0]);
This is pretty grim I only post it because I couldn't find another way.
(Probably staring me in the face)
I haven't tried this with the dial up configuration you described,
but since the @addr array is an array I guess it would hold all the
addresses relating to the socket.
> Alternatively: Suppose the home machine just went and made the socket
> connection to the work machine. Then could the work machine see from
the
> socket connection object what IP address it is coming from?
> Even if the latter would work I'd still like a better way to find out
a
> machine's own IP address(es).
recv(from) returns the remote ip address, so you could do it like that
but you should be able to get your own address without jumping through
hoops, I'm sure someone will know how to do it.
--
Jon
perl -e '$_="MrqEdunhuClqdph1frp"; print map {chr(ord($_)-3)} split //;'
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 29 Aug 2000 14:40:26 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Getting slices of this ...(not pizza)
Message-Id: <39aec9ad.53002724@news.newsguy.com>
newsgroups@ckeith.clara.net (Colin Keith) wrote:
>$_->{epost} ? push(@no_email, $_) : push(@have_email, $_) for(@student_rec);
Or
push @{ $_->{epost} ? \@no_email : \@have_email }, $_
for @student_rec;
>my($year) = (localtime(time()))[5];
Too much typing, and you're setting assigning a scalar to a list
(which works in this case but isn't a good habit to get into).
Try this:
my $year = (localtime)[5];
Of course, as you've implied, that should probably be
my $year = (localtime)[5] + 1900;
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Tue, 29 Aug 2000 16:17:50 GMT
From: ptomsic@my-deja.com
Subject: Getting the greedy RegEx, wanting the Lazy - help?
Message-Id: <8ognmn$i73$1@nnrp1.deja.com>
I'm getting the wrong part (actually, getting nothing) of a regEx, and
I'm wondering if someone could shed some light...
I've got the following:
############################################
#!/usr/local/bin/perl -w
use strict;
open(FILE, "test.txt") || die "$!";
my $cont = join("", <FILE>);
close(FILE)||die "$!";
$cont =~ s/(\n|\r|\t|\f)+/ /g;
$cont =~ s/^.*<!-+.*BEGIN.*STUFF.*-+>(.*)<!-+.*STOP.*STUFF.*-+>.*/$1/i;
print "\n$cont\n";
############################################
and test.txt is as follows:
------------------------------------------------------------
<TD><testing="one">FIRST</testing></TD><test ing="two">SECOND </test
ing></TD>MORE<TD><b>b </b><a href="one.html">This</a>-<!-BEGIN-><a
href="two.html
">that</a> the other<!-END->boing<TD><font>font</font><!---BEGIN STUFF--
->HEre
is a
little TEST
<!--END CONTENT HERE--->
<!--STOP STUFFxxx---------->bingo
bango
testingonetweetergoods
----------------------------------------------------------------------
I'm actually looking to return the text
HEre is a little TEST <!--END CONTENT HERE--->
But I'm returning nothing.
Help would be greatly appreciated.
Thx.
PJT
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 29 Aug 2000 17:37:17 GMT
From: steinra@my-deja.com
Subject: Re: hour difference between localtime and POSIX::mktime
Message-Id: <8ogsca$o3a$1@nnrp1.deja.com>
In article <slrn8qmuad.9dk.vek@pharmnl.ohout.pharmapartners.nl>,
vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse) wrote:
> Not sure you what your mistake is supposed to be. I tried to run your
> program and find no problems.
>
> If ctime, mktime and localtime does not all handle summer and winter
> time properly I would call that a bug.
>
> #!/usr/local/bin/perl
>
> use POSIX;
>
> $time = time;
>
> print "Date = ", POSIX::ctime($time);
>
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
> localtime($time);
>
> $newtime = POSIX::mktime( $sec,$min,$hour,$mday,$mon,$year );
> print qq( $sec,$min,$hour,$mday,$mon,$year ), "\n";
>
> print "Date = ", POSIX::ctime($newtime);
>
> print "Hour: $hour\n";
>
> $time_t = POSIX::mktime( 0, 30, 10, 31, 00, 100 );
> print "Date = ", POSIX::ctime($time_t);
>
> $time_t = POSIX::mktime( 13, 29, 0, 29, 7, 100 );
> print "Date = ", POSIX::ctime($time_t);
>
> $time_t = POSIX::mktime( 13, 29, 1, 29, 7, 100 );
> print "Date = ", POSIX::ctime($time_t);
>
> __END__
> And my results.
>
> Date = Tue Aug 29 10:46:00 2000
> 0,46,10,29,7,100
> Date = Tue Aug 29 10:46:00 2000
> Hour: 10
> Date = Mon Jan 31 10:30:00 2000
> Date = Tue Aug 29 00:29:13 2000
> Date = Tue Aug 29 01:29:13 2000
>
> --
> Villy
My main mistake was that I forgot I was in daylight savings time and
need to set the flag to mktime appropriately. Anywhere where daylight
savings time is not used this would have worked just fine. So I am glad
I caught it now rather than coding the program and getting hit with a
problem in spring when daylight savings time kicks in.
Thank you for you input!
Randy
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 29 Aug 2000 13:06:53 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: How do I manipulate each element of an array?
Message-Id: <NzOq5.8$05.102955@nnrp2.clara.net>
In article <8od8tj$hd$1@qnsgh006.europe.nortel.com>, "Lincoln Marr" <lincolnmarr@nospam.europem01.nt.com> wrote:
>I'm having a little trouble at getting at all elements of an array at the
>same time.... I'm no perl wizard so this is probably pretty simple.
>
>All I want to do is say 'foreach element of @array, if the element is empty
>then set it to otherwise leave it as it is'.
>
>Simple enough??
Uh huh. That's one of the advantages of Perl, its syntax is pretty English
like, so if you understand that then you have an advantage. Translate what
you said:
foreach $element (@array){
if($element eq ""){
$element = ' ';
}
}
You were only 1 word ('of') away from writing it in text :)
Of course, if you want to show off:
@array = map { $_ ? $_ : ' ' } @array;
>$x =1;
>foreach (@array) {
> if ($array[$x] eq "") { $array[$x] = " " ; }
>++$x;
>}
Ahh, you're mixing for() and foreach() styles. If you want to use an index
try for() instead:
for($i=0; $i<@array; $i++){
if($array[$x] eq ''){
$array[$x] = ' ';
}
}
But that's very 'unperl like'. That is, not to say that it is wrong, but
that you can do this in a more efficient manner. (Less memory, and better,
less typing:)
>but then what happens once you've reached the end of the array? Any
That's where you scream "Finished!" and nip off down the pub :) Seriously,
nothing happens, it just gets to then end of the array and continues
executing your program. You've changed the values as you stepped through the
elements, you don't need to go back and do anything else. Try it :)
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Tue, 29 Aug 2000 13:38:11 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: How to Unzip a .tar.gz file
Message-Id: <39acbbeb.49480110@news.newsguy.com>
dennis100@webtv.net (BUCK NAKED1) wrote:
>> gellyfish@gellyfish.com
>> (Jonathan Stowe) wrote:
>>> On Sun, 27 Aug 2000 22:20:46 GMT >> What A Man ! wrote:
>> <!doctype html public "-//w3c//dtd html
>> 4.0 transitional//en">
>> *plonk*
>> /J\
>
>Don't know what your problem is? I did not post in HTML.
Did anyone say you did? Or are you now posting as "What A
Man !" as well as "BUCK NAKED1" and following up to your
own posts? (I didn't go to the trouble of reading the HTML
post.)
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Tue, 29 Aug 2000 14:50:28 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How to Unzip a .tar.gz file
Message-Id: <ocjnqs86eicfalvhhi1pagebvqlk9231pl@4ax.com>
Keith Calvert Ivey wrote:
>Did anyone say you did? Or are you now posting as "What A
>Man !" as well as "BUCK NAKED1" and following up to your
>own posts? (I didn't go to the trouble of reading the HTML
>post.)
Apparently he did.
The original text in the followup starts with:
|I forgot to add that I have also tried the following codes on my webserver
|to no avail:
--
Bart.
------------------------------
Date: Tue, 29 Aug 2000 18:21:14 +0200
From: FDA <armingaud@noos.fr>
Subject: Re: Is perl powerful enough to create cybermoney?
Message-Id: <39ABE2FA.A6BA7BE@noos.fr>
pohanl@my-deja.com a écrit :
> What does this mean? This means that money is subjective. Its
> not real. Its based on demand. Like the government printing new
> money, the companies are creating stocks that may end up creating
> more money (if there is demand that drives up the prices) or sucking
> up money (if no demand and the prices drop).
I fail to see the relation of all this to Perl, but the law of supply and
demand has been a well-known thing for centuries. Also, stocks
do not "create" money. They just take money from people who
are willing to buy them, which is something different. The money
is just transferred, not created at all.
------------------------------
Date: Tue, 29 Aug 2000 13:37:02 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: making sure input is a certain way i.e. starting and ending with double quotes
Message-Id: <20Pq5.10$05.103792@nnrp2.clara.net>
In article <B5CF49AD.6F9A%star@sonic.net>, arthur <star@sonic.net> wrote:
>end with double quotes. How can I check that and put up a warning message if
>they have not started and ended in double quotes.
my($cgi) = CGI->new();
if($cgi->param('name') !~ /^\".+\"$/){
print $cgi->header(),
$cgi->start_html(),
$cgi->p('Oi goober, I said within " " :p'),
$cgi->end_html();
}
Btw, if you're testing this on the command line, you'll need to put the "'s
in as %22 (name=%22bob%22) Otherwise CGI.pm will strip them off (It confused
me:)
Er, one note about the below, why do you use '$name' ? As in the you're
naming the field '$name' not 'whatever_the_value_of_name_is'. Its
consistent, but unless you *have* to use a text string that contains
characters that aren't letters, numbers or an underscore, don't.
> "The name of your game is: ",textfield('$name'),
.
> "The name is: ",em(param('$name')),
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Tue, 29 Aug 2000 16:38:14 GMT
From: arthur <star@sonic.net>
Subject: Re: making sure input is a certain way i.e. starting and ending with double quotes
Message-Id: <B5CFE37B.74DE%star@sonic.net>
> In article <B5CF49AD.6F9A%star@sonic.net>, arthur <star@sonic.net> wrote:
>
>> end with double quotes. How can I check that and put up a warning message if
>> they have not started and ended in double quotes.
>
> my($cgi) = CGI->new();
> if($cgi->param('name') !~ /^\".+\"$/){
> print $cgi->header(),
> $cgi->start_html(),
> $cgi->p('Oi goober, I said within " " :p'),
> $cgi->end_html();
> }
>
> Btw, if you're testing this on the command line, you'll need to put the "'s
> in as %22 (name=%22bob%22) Otherwise CGI.pm will strip them off (It confused
> me:)
>
Thanks when I put that in I get -- CGI=HASH(0x81d8bd8)Content-Type:
text/html
Oi goober, I said within " " :p
which means no-thing to me--sorry. I understand the humorous part "Oi
goober..."
I am on a Macintosh so no worries about the command line.
Actually I used what Mr. Stowe suggested --a regular expression. But I do
like what you are aiming at because it will change the whole page (a strong
warning) but that can wait.
I am still trying to figure out how to copy a file and save it with a
different name. I will try and explain it again.
--------------------------
The name dat.html can not change, (that name is used in another program) but
I want people to be able to change the data in dat.html and save the changed
file as 'name' This way they can
change the data and save it so it can be used latter. Otherwise it would be
erased when someone else fills out the form.
In order to do that I think the script below this one will have to be
inserted into this one.
------
#!/usr/bin/perl -w
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use IO File;
use strict;
use File::Copy;
print header;
print start_html('A Simple Example'),
start_form,
"The name of your game is: ",textfield('name'),
p,
"What are your questions? ",textfield('question'),
p,
submit,
end_form,
hr;
if (param()) {
print
"The name is: ",em(param('name')),
p,
"Your questions are: ",em(param('question')),
p,
open (HOPE, ">/home/www_pages/star/dat.html") || die print "cant open:$!\n";
(my $question = param('question')) =~ s/,/","/g;
print HOPE $question;
close HOPE;
print end_html;
}
---------
#this is the second script
use File::Copy;
#that is in the above script
copy($origfile, $mycopy) || die "Content-Type: text/plain\n\nUh oh - $!";
#The '$origfile' is 'dat.html' and '$mycopy' is '$name' I think?
chown($uid_of_copier, $gid_of_copier, $mycopy);
#now do I insert star which is my uid? or do I leave '$uid_of_copier' and
# do I leave $gid_of_copier or what? and is $mycopy changed to $name?
open(FH, ">>$mycopy") || die "Content-Type: text/plain\n\nUh oh - $!";
#this should be: open(HOPE, ">>$mycopy") || die ........ (I think?)
print FH "updated information...\n";
#Should it be: 'print HOPE
---------------
I appreciate all the help!!!!!!!!!!
~arthur
star@sonic.net
------------------------------
Date: Tue, 29 Aug 2000 10:42:26 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: making sure input is a certain way i.e. starting and endingwith double quotes
Message-Id: <39ABF602.29C9AB40@ipac.caltech.edu>
arthur wrote:
> That works fine, thanks :+)
> How could I get the program to quit after it prints "No quotes\n" if
> there are not quotes around $question
% perldoc -f quit
No documentation for perl function `quit' found
% perldoc -f stop
No documentation for perl function `stop' found
% perldoc -f leave
No documentation for perl function `leave' found
% perldoc -f depart
No documentation for perl function `depart' found
% perldoc -f exit
... aha!
--
-- Tim Conrow tim@ipac.caltech.edu 626-395-8435
------------------------------
Date: Tue, 29 Aug 2000 10:52:45 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: making sure input is a certain way i.e. starting and endingwith double quotes
Message-Id: <39ABF86D.C3A23034@ipac.caltech.edu>
arthur wrote:
> That works fine, thanks :+)
> How could I get the program to quit after it prints "No quotes\n" if
> there are not quotes around $question
Let's take a walk down RTFM lane, shall we?
% perldoc -f quit
No documentation for perl function `quit' found
% perldoc -f stop
No documentation for perl function `stop' found
% perldoc -f leave
No documentation for perl function `leave' found
% perldoc -f depart
No documentation for perl function `depart' found
% perldoc -f exit
... aha !!!
Even better:
% perldoc -f terminate
No documentation for perl function `terminate' found
% perldoc -f kill
... no, that's not it ...
% perldoc -f expire
No documentation for perl function `expire' found
% perldoc -f eliminate
No documentation for perl function `eliminate' found
% perldoc -f die
... that's the ticket!
--
-- Tim Conrow tim@ipac.caltech.edu 626-395-8435
------------------------------
Date: Tue, 29 Aug 2000 17:09:22 +0200
From: "Erik" <e.hofstra@student.utwente.nl>
Subject: method="get"
Message-Id: <8ogjj5$4p7$1@dinkel.civ.utwente.nl>
How can i read the values from a form that is sent
with method="get" in Perl?
Erik
------------------------------
Date: 29 Aug 2000 16:21:17 GMT
From: Antony <mcnultya@NOSPAMnortelnetworks.com>
Subject: Re: method="get"
Message-Id: <8ogntt$lrn$1@qnsgh006.europe.nortel.com>
Try this :
read(STDIN, $incoming, $ENV{'CONTENT_LENGTH'});
Reads the info into $incoming
That's the easiest way I know. Anyone know of an easier way ?
Antony
"Erik" <e.hofstra@student.utwente.nl> wrote:
>How can i read the values from a form that is sent
>with method="get" in Perl?
>
>
>Erik
>
>
------------------------------
Date: Tue, 29 Aug 2000 12:28:20 -0400
From: "Tom Kralidis" <tom.kralidis@ccrs.nrcan.gcDOTca>
Subject: Re: method="get"
Message-Id: <8ogob5$ifc15@nrn2.NRCan.gc.ca>
Read in your incoming values from the $ENV{'QUERY_STRING'} variable.
..Tom
--
=================================
Tom Kralidis
GIS / Systems Specialist
Canada Centre for Remote Sensing
Tel: (613) 947-1828
http://www.nrcan.gc.ca/~tkralidi/
=================================
"Erik" <e.hofstra@student.utwente.nl> wrote in message
news:8ogjj5$4p7$1@dinkel.civ.utwente.nl...
> How can i read the values from a form that is sent
> with method="get" in Perl?
>
>
> Erik
>
>
------------------------------
Date: Tue, 29 Aug 2000 17:11:41 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: method="get"
Message-Id: <sqnrmd2fc5d81@corp.supernews.com>
In article <8ogjj5$4p7$1@dinkel.civ.utwente.nl>,
Erik <e.hofstra@student.utwente.nl> wrote:
: How can i read the values from a form that is sent
: with method="get" in Perl?
Please read the documentation for the standard CGI module.
Greg
--
>I need to programmatically reboot a Windows NT 4.0 server using Perl.
Any command in NT has a certain chance to reboot the machine, hasn't it?
-- Abigail in <7a01hc$lvb$1@client2.news.psi.net>
------------------------------
Date: Tue, 29 Aug 2000 19:19:27 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: method="get"
Message-Id: <1eg54a5.4ua88u3wsfnsN%tony@svanstrom.com>
Antony <mcnultya@NOSPAMnortelnetworks.com> wrote:
> "Erik" <e.hofstra@student.utwente.nl> wrote:
> >How can i read the values from a form that is sent
> >with method="get" in Perl?
> Try this :
>
> read(STDIN, $incoming, $ENV{'CONTENT_LENGTH'});
>
> Reads the info into $incoming
> That's the easiest way I know. Anyone know of an easier way ?
I don't understand how you can think that that's an easy way to get
get-values, when what it does is taking posted values...
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
on the verge of frenzy - i think my mask of sanity is about to slip
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©99-00 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Tue, 29 Aug 2000 15:24:39 GMT
From: eryq@zeegee.com
Subject: Re: MIME Mail help on NT - no sendmail!
Message-Id: <8ogkis$e2o$1@nnrp1.deja.com>
Two quick observations:
First, you should upgrade to MIME-tools 5.x, since that has
far better integration with the mail-sending capabilities
of MailTools, as well as more-consistent "stringification"
methods for flattening messages and their bodies.
Second, you should upgrade to MIME-tools 5.x because it's
faster and less-buggy. :-)
Eryq
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 29 Aug 2000 13:13:17 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: MySQL and perl
Message-Id: <NFOq5.9$05.103157@nnrp2.clara.net>
In article <39AA61A3.CC1E0EB0@inlander.es>, Abel Almazan <abel@inlander.es> wrote:
>I have DBI installed. What's the name of the next module i have to
>install??
msql-mysql DBI interface module.
Download it from CPAN <http://www.cpan.org/modules>
>And when i install the modules, perl automaticxally connects to the
>database or i need to do something more with the mysql or perl
>configuration??
Perl is a language, it has no concept of anything (except perhaps being
extremely cool :), so it knows nothing about your database a module isn't
going to hard code information about 'your database' because you might have
multiple databases on multiple machines. If you look at the documentation
you'll see examples of using the DBI interface methods connect(), prepare(),
execute() and fetch* methods.
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4164
**************************************