[16125] in Perl-Users-Digest
Perl-Users Digest, Issue: 3537 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 2 14:05:23 2000
Date: Sun, 2 Jul 2000 11:05:10 -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: <962561110-v9-i3537@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 2 Jul 2000 Volume: 9 Number: 3537
Today's topics:
Re: $ENV{'PATH'} in Taint mode (Decklin Foster)
Re: $ENV{'PATH'} in Taint mode <gellyfish@gellyfish.com>
Re: $ENV{'PATH'} in Taint mode <six4eight@LINUXhotmail.com>
$query->checkbox_group : Can't modify negate in scalar <abuse@localhost>
Re: $query->checkbox_group : Can't modify negate in sca <mike@stok.co.uk>
Re: Can get perl to open doc, but how do I get it to op (brian d foy)
Re: Can get perl to open doc, but how do I get it to op <star@sonic.net>
Re: Can't get Blat working on NT server <gellyfish@gellyfish.com>
Re: chmod <gellyfish@gellyfish.com>
Re: chmod <gellyfish@gellyfish.com>
Re: E-mail form <gellyfish@gellyfish.com>
Examine A Standart Logfile <fjgfjgfj@askjfsafjkslfj.ch>
Re: Examine A Standart Logfile <tony_curtis32@yahoo.com>
Re: foreach and hashes (Tad McClellan)
Re: Help with Net::NNTP <krobb7@NOhomeSPAM.com>
Re: How to open a FIFO created with C in perl? <gellyfish@gellyfish.com>
Re: HTML::Parser docs and homepage <gellyfish@gellyfish.com>
Re: Message board software (Decklin Foster)
Re: Message board software <gellyfish@gellyfish.com>
Re: Net::FTP not on CPAN <gellyfish@gellyfish.com>
Pattern Matching <dburch@teleport.com>
Re: Perl Newbie Question (Costas Menico)
Perl vs ASP/VB (Costas Menico)
Re: Problems installing perl on PC (Neil Jones)
Re: shouldn't sort return a list? <iltzu@sci.invalid>
Re: Teen Volenteers WANTED <gellyfish@gellyfish.com>
Re: Unix database for Perl <bet@rahul.net>
Uploading files via form without CGI.pm auto71426@hushmail.com
Re: Welcome to.... (Tad McClellan)
Re: Welcome to.... (Tad McClellan)
Re: where did the email my perl script sent go? <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 2 Jul 2000 16:36:15 GMT
From: fosterd@hartwick.edu (Decklin Foster)
Subject: Re: $ENV{'PATH'} in Taint mode
Message-Id: <8jnr1v$tk12$2@ID-10059.news.cis.dfn.de>
Eelke Kleijn <six4eight@NOSPAMhotmail.com> writes:
> system "/usr/bin/id >> /home/jjr/.chkchk ; /bin/date >> /home/jjr/.chkchk";
Don't do that. It makes it much harder to diagnose problems.
system "/usr/bin/id >> /home/jjr/.chkchk";
system "/bin/date >> /home/jjr/.chkchk";
You will probably want to check the exit status of each command. see
perldoc -f system.
> $ENV{'PATH'} =
> '/bin:/usr/bin:/usr/local/bin:/usr/bin/id:/bin/date:/home/jjr';
The first and second underlined items appear to be binaries, not
directories. The third appears to be a directory where your data file
lives. None are necessary. I suggest you look for a beginner's guide
to what a 'path' means, preferably something focused on *nix. This is
not the appropriate group for that.
> $path = $ENV{'PATH'}; # By the way is this line necessary ????
No. If you want to refer to your path later on in the script, just use
$ENV{'PATH'}.
--
There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)
------------------------------
Date: 2 Jul 2000 19:03:10 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: $ENV{'PATH'} in Taint mode
Message-Id: <8jo04u$bpt$1@orpheus.gellyfish.com>
On Sun, 02 Jul 2000 12:58:34 GMT Eelke Kleijn wrote:
> Hi all,
> I'm having troubles running pearl in Taint mode with my $ENV{'PATH'}
^^^^^
Shurely shome mishtake ...
> variable.
> The script uses Socket.pm and that is where it dies on (line 7)
>
> Line 7 of Socket.pm says:
>
> system "/usr/bin/id >> /home/jjr/.chkchk ; /bin/date >> /home/jjr/.chkchk";
>
> So this is how I set my path variable:
>
> $ENV{'PATH'} =
> '/bin:/usr/bin:/usr/local/bin:/usr/bin/id:/bin/date:/home/jjr';
> delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
> $path = $ENV{'PATH'}; # By the way is this line necessary ????
>
No you dont need to do that. It just means that if $ENV{PATH} was
insecure before then $path is now as well ...
> If I run the script like this is still halts at an insecure $ENV{'PATH'} at
> line 7 of Socket.pm
> What should I do to make this work?
>
One of the directories in your PATH is world writeable probably - read the
perlsec manpage for more on what checks are done in taint mode.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Sun, 2 Jul 2000 18:50:37 +0200
From: "DJ Eelke Kleijn" <six4eight@LINUXhotmail.com>
Subject: Re: $ENV{'PATH'} in Taint mode
Message-Id: <9EK75.23911$Lq5.478181@amoeba1.srv.nld.sonera.net>
"Jonathan Stowe" <gellyfish@gellyfish.com> schreef in bericht
news:8jo04u$bpt$1@orpheus.gellyfish.com...
> On Sun, 02 Jul 2000 12:58:34 GMT Eelke Kleijn wrote:
> > Hi all,
> > I'm having troubles running pearl in Taint mode with my $ENV{'PATH'}
> ^^^^^
> Shurely shome mishtake ...
Yep, that is one big stupid typo :-)
I'll check out the directories, thanks.
<SNIP>
------------------------------
Date: Sun, 2 Jul 2000 23:44:06 +0800
From: "multiplexor" <abuse@localhost>
Subject: $query->checkbox_group : Can't modify negate in scalar assignment
Message-Id: <8jnnhm$k881@imsp212.netvigator.com>
Code:
###
use strict;
use CGI;
my $query = new CGI;
print $query->checkbox_group(-name=>'group_name',
-values=>['eenie','meenie','minie','moe'],
-rows=2,-columns=>2);
###
Error:
Can't modify negate in scalar assignment at test8.pl line 7, near "2,"
Execution of test8.pl aborted due to compilation errors.
Platform:
ActivePerl perl5.00503 on Windows 98
The statement of checkbox_group comes from the CGI module documentation. It
works well if the "-rows=2,-columns=>2" is removed. Any idea?
Thanks for your time.
------------------------------
Date: Sun, 02 Jul 2000 15:58:48 GMT
From: "Mike Stok" <mike@stok.co.uk>
Subject: Re: $query->checkbox_group : Can't modify negate in scalar assignment
Message-Id: <YEJ75.3219$T%3.59516@typhoon.austin.rr.com>
In article <8jnnhm$k881@imsp212.netvigator.com>, "multiplexor"
<abuse@localhost> wrote:
> Code:
> ###
> use strict; use CGI; my $query = new CGI;
>
> print $query->checkbox_group(-name=>'group_name',
> -values=>['eenie','meenie','minie','moe'],
> -rows=2,-columns=>2);
should the -rows = 2 really be -rows => 2 ?
Hope this helps,
Mike
------------------------------
Date: Sun, 02 Jul 2000 13:59:28 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Can get perl to open doc, but how do I get it to open html on thefly?
Message-Id: <brian-ya02408000R0207001359280001@news.panix.com>
In article <B5841B71.2348%star@sonic.net>, arthur <star@sonic.net> posted:
> Thanks for the help I just spent 2 hours and could not find perldoc. I even
> telneted to my server. Where can I get them in http form?
did you try www.perl.com?
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Sun, 02 Jul 2000 17:05:50 GMT
From: arthur <star@sonic.net>
Subject: Re: Can get perl to open doc, but how do I get it to open html on thefly?
Message-Id: <B5841B71.2348%star@sonic.net>
in article slrn8ltb8m.8u0.tadmc@magna.metronet.com, Tad McClellan at
tadmc@metronet.com wrote on 7/1/00 6:46 PM:
>
> [ Please put your comments *following* the quoted text that you
> are commenting on.
>
> Jeopardectomy performed.
> ]
>
>
> On Sat, 01 Jul 2000 23:03:23 GMT, arthur <star@sonic.net> wrote:
>> in article 395E40E9.E5AC3FDA@epotec.com, James Fisher at jfisher@epotec.com
>> wrote on 7/1/00 11:06 AM:
>>
>> star@sonic.net
>>> It looks to me that you have two options...
>>>
>>> 1. Open the file and write to the std output.
>>> 2. Redirect the user to the file.
>>>
>>> JF
>>>
>>> arthur wrote:
>>>
>>>> Good Day,
>>>>
>>>> I have a script that can open and post to a file in my directory but how
>>>> can
>>>> I make that file (it is in html format) open on the web?
>>>>
>
>> Great thanks for the help! but I do not understand (ok I admit it, sometimes
>> I am thick) could someone please give me a simple example of 1 & 2
>
>
> 'perldoc' is a program for looking up stuff in the standard
> docs that you got along with perl.
>
>
> Learn to use it:
>
> perldoc perldoc
>
>
> "Open the file"
>
> perldoc -f open
>
>
> "and write to the std output"
>
> perldoc -f print
>
>
> "Redirect the user to the file"
>
> The Perl part of that question is also answered with
>
> perldoc -f print
>
> _What_ to output to cause the redirect is not a Perl question,
> it is a CGI question. There is a newsgroup for CGI questions:
>
> comp.infosystems.www.authoring.cgi
>
Thanks for the help I just spent 2 hours and could not find perldoc. I even
telneted to my server. Where can I get them in http form?
------------------------------
Date: 2 Jul 2000 16:23:33 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Can't get Blat working on NT server
Message-Id: <8jnmpl$chd$1@orpheus.gellyfish.com>
On Sun, 02 Jul 2000 01:07:42 GMT paul_work@yahoo.com wrote:
> I have moved some sites from a Unix host to an NT one and I'm having
> trouble (about 8 hours of trouble so far) getting Blat working.
>
> I am using the following command line:
>
> blat.exe e:/ctw/blattest.txt -s "sending blattest.txt" -t
> "pab@cutey.com" -f pab@cutey.com
>
> Where e:/ctw/blattest.txt is my little test file (path correct
> according to my FTP program) which does exist [as far as I can tell].
>
Does 'blat' work from the command line with the arguments you are using ?
If it does then you are doing something wrong in your Perl program.
If it doesnt then you have a problem with the setup of 'blat' or your
mailsystem in general which you would be better of asking in some group
with 'mail' in the name.
And does the Perl program work from the command line ?
If it does then it is unlikely to be a Perl problem but a problem caused
by the fact that the user your program runs as on NT does not have the
necessary rights to access the network - you will want to ask in some
group concerned with configuration of NT servers ( such as, for example,
comp.infosystems.www.servers.ms-windows).
If it doesnt then something is wrong depending on the answer to my first
question.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 2 Jul 2000 18:53:03 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: chmod
Message-Id: <8jnvhv$9qi$1@orpheus.gellyfish.com>
On Sun, 02 Jul 2000 02:53:19 -0700 peter wrote:
> Hi, I'm relatively new to cgi and i'm using the bignosebird
> guestbookscript. This script requires the cgi-scrtipt set
> to 755 by chmod, while it needs a tmp-dir set 777.However,
> when I chmod a file, ws-ftp seems to give all files and
> directorys the same settings.
> I'm doing something wrong i guess, but what?
>
Not reading the documentation for your FTP client perhaps, or using the
wrong FTP client, who knows ? It isnt really a Perl question as the same
would apply if the programs you were uploading were written in BASIC or
were compiled COBOL programs ...
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 2 Jul 2000 18:54:26 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: chmod
Message-Id: <8jnvki$a3e$1@orpheus.gellyfish.com>
On Sun, 02 Jul 2000 02:53:19 -0700 some piece of software wrote:
>
> * Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
Can someone have a word with Altavista about the line length on that ...
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 2 Jul 2000 19:09:50 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: E-mail form
Message-Id: <8jo0he$d2l$1@orpheus.gellyfish.com>
On Sun, 2 Jul 2000 13:47:32 +0200 RJ wrote:
> Hello,
>
> I'm working on a e-mail form, and therefor I use a CGI/Perl script. In the
> form that's been made in HTML, you can specifiy the recipient, just by
> typing it in the HTML tags. But I would like it if the visitor of the
> homepage could choose between a number of names and then the Perl script
> would automatically see this name as the recipient.
>
Use a drop down list - ask in an HTML or CGI group about how would do this.
If you are generating your form within your program and you are using the
CGI module then this has a method for creating drop down lists that you
can read about in the CGI manpage.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Sun, 02 Jul 2000 18:35:25 +0200
From: Markus Hediger <fjgfjgfj@askjfsafjkslfj.ch>
Subject: Examine A Standart Logfile
Message-Id: <395F6F4D.900BDE58@askjfsafjkslfj.ch>
Hello!
Does anyone know the ultimative regular expression or algorithm to split a
single line from a standart logfile into its fields?
A line looking like:
ad25-175.compuserve.com - - [02/Mar/1997:05:03:49 -0500]
"GET /selfhtml/tg.htm HTTP/1.0" 200 1788
Thanks a lot!
Original sender address: hedim@hta-bi.bfh.ch
------------------------------
Date: 02 Jul 2000 11:35:23 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Examine A Standart Logfile
Message-Id: <87ituobid0.fsf@limey.hpcc.uh.edu>
>> On Sun, 02 Jul 2000 18:35:25 +0200,
>> Markus Hediger <fjgfjgfj@askjfsafjkslfj.ch> said:
> Hello! Does anyone know the ultimative regular
> expression or algorithm to split a single line from a
> standart logfile into its fields?
It's only standard if you're talking about web servers.
> A line looking like:
> ad25-175.compuserve.com - - [02/Mar/1997:05:03:49 -0500]
> "GET /selfhtml/tg.htm HTTP/1.0" 200 1788
http://search.cpan.org/search?dist=Logfile
although strangely I didn't find a module which simply
splits logfile lines into e.g. a hash keyed on the fields
of the web server's record. Is there one?
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: Sun, 2 Jul 2000 10:15:14 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: foreach and hashes
Message-Id: <slrn8lujji.abr.tadmc@magna.metronet.com>
On Sun, 02 Jul 2000 13:43:05 GMT, Andy Smith <asmith@hsonline.net> wrote:
>Thank you! When I looked at the script this morning the problem became
>ovious. Not the first time I have stared at a block of code for hours
>to have someone else point out an obvious error the first time they
>saw it :)
I have looked at code for hours before, only to give up and
print it out for yet another scan...
... only to see the problem as the page rolls out of the printer. :-(
Killing trees seems an effective debugging method for me for
some reason...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 02 Jul 2000 15:36:00 GMT
From: Ken <krobb7@NOhomeSPAM.com>
Subject: Re: Help with Net::NNTP
Message-Id: <395F6185.BDD9EACD@NOhomeSPAM.com>
Colin Watson wrote:
> <snip>
> However, the NEWNEWS command is often disabled by news administrators,
> as it puts a lot of load on the server. Instead of your first command
> above, try:
>
> $server = Net::NNTP->new("news", Debug => 1);
>
> ... and you'll get debugging information, which may well include
> something like '502 NEWNEWS command disabled by administrator'.
Yep, that was it. Thanks for the help.
Ken
------------------------------
Date: 2 Jul 2000 18:26:41 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to open a FIFO created with C in perl?
Message-Id: <8jnu0h$4ov$1@orpheus.gellyfish.com>
On Sun, 02 Jul 2000 11:27:54 GMT st95lzd@my-deja.com wrote:
> In article <%sJ55.244$iP2.31710@news.dircon.co.uk>,
> Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>> On Mon, 26 Jun 2000 13:20:14 GMT, st95lzd@21cn.com Wrote:
>> > I created a FIFO(readFIFO) to read data from script.
>> > Script was writen by perl,How can i send data to FIFO?
>> >
>>
>> <snip irrelevant rewrite of mkfifo in C>
>>
>> >
>> > exam.pl
>> > #!/usr/bin/perl
>> > open(LOG,"|readFIFO") || die("error!!!!!!!!!!!");
>>
>> Er, should that be :
>>
>> open(LOG,">readFIFO") || die "Cant open fifo - $!\n";
>>
>> > print LOG "123456\n";
>> > close(LOG);
>> > exit;
>> >
>> >
>> > It seemes that the function open() can't open a FIFO
>> > In which way,can i send string "123456" to the FIFO?
>> > that is printf the 123456 on the STDOUT.
>> > Please post in detail,better with source code.
>> > Thanks!!
>> >
>>
>> You were opening your fifo as if it were an executable you wanted to pipe
>> to - a fifo appears largely as a normal file to your program.
>>
>
> fifo can't look as a normal file,
> when i change my program with
> open(LOG,">readFIFO") || die "Cant open fifo - $!\n";
> for the first time,the STDOUT really output the string "123456"
> then i runned "ls -a read*",i found that the readFIFO file had
> not a zero file and i runned the perl program again(the C program
> runned in backgroup),the STDOUT output nothing.
>
I dont know what you are talking about. Running your code ( after fixing
the linux/stat.h to sys/stat.h ) but *with* :
open(LOG,">readFIFO") || die("error!!!!!!!!!!!");
and it works fine just as I would expect and 'ls -l readFIFO' shows :
prw-rw-rw- 1 gellyfis gellyfis 0 Jul 2 17:13 readFIFO
just as I would expect. Of course if you remove the fifo and then run
the Perl program first then yes it will just create a plain file as one
would expect - you can fix this by testing for the fact that readFIFO exists
and is indeed a named pipe :
#!/usr/bin/perl -w
if ( -p 'readFIFO' )
{
open(LOG,">readFIFO") || die("Cannot open 'readFIFO' : $!\n");
print LOG "123456\n";
close(LOG);
}
else
{
die "readFIFO is not a Named Pipe\n";
}
Of course if there is no reader on the fifo then your program will block
until their is one if you open like this - if you dont want it to block
like this you can use sysopen() instead :
sysopen(LOG,'readFIFO', O_WRONLY | O_NONBLOCK )
|| die "Cant open fifo - $!\n";
Which will fail with ENXIO if there is no reader - you might want to do
something like :
#!/usr/bin/perl -w
use Fcntl;
use Errno qw(:POSIX);
if ( -p 'readFIFO' )
{
if( sysopen(LOG,'readFIFO', O_WRONLY | O_NONBLOCK ) )
{
print LOG "123456\n";
close(LOG);
}
else
{
if ( $! == ENXIO )
{
die "No reader\n";
}
else
{
die "Couldnt open readFIFO - $!\n";
}
}
}
else
{
die "readFIFO is not a Named Pipe\n";
}
I would also suggest that you read fifo(4) man page on your system for more
information.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 2 Jul 2000 18:40:56 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: HTML::Parser docs and homepage
Message-Id: <8jnur8$7gc$1@orpheus.gellyfish.com>
On Sun, 02 Jul 2000 11:10:54 +0200 Jan Bessels wrote:
>
> Usenet is all about sharing information. Hence I've included the text of the
> mentioned TPJ article, which is quite good actually. Enjoy.
>
>
> Parsing HTML with HTML::PARSER
> Ken MacFarlane
> Packages Used:
> HTML::Parser...............................CPAN
>
<snip the whole article>
You are aware that apart from upsetting people by unnecessarily posting
something that is available from the web you are also certainly infringing
the copyright of the author and of TPJ itself.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 2 Jul 2000 16:37:15 GMT
From: fosterd@hartwick.edu (Decklin Foster)
Subject: Re: Message board software
Message-Id: <8jnr3r$tk12$3@ID-10059.news.cis.dfn.de>
Philip Chan <philipc@i-cable.com> writes:
> I'm looking for a good message board software, any suggestions?
Yes. Ask in an appropriate newsgroup.
--
There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)
------------------------------
Date: 2 Jul 2000 18:47:56 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Message board software
Message-Id: <8jnv8c$8rb$1@orpheus.gellyfish.com>
On Sun, 2 Jul 2000 16:28:55 +0800 Philip Chan wrote:
> I'm looking for a good message board software, any suggestions?
>
Use a search engine and avoid anything that was written by, or
derived from something written by, Matt Wright ...
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 2 Jul 2000 18:32:13 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Net::FTP not on CPAN
Message-Id: <8jnuat$5r1$1@orpheus.gellyfish.com>
On Fri, 30 Jun 2000 10:38:09 -0700 Gerard Lanois wrote:
<snip a bunch of stuff about not liking search.cpan.org and the Net::FTP
manpage>
As is said regularly here, I am sure that patches would be most welcome.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Sun, 02 Jul 2000 09:14:17 -0700
From: Dan Burch <dburch@teleport.com>
Subject: Pattern Matching
Message-Id: <395F6A59.19E01350@teleport.com>
I've been working on a script on my developement box (win98 running
apache and perl5.00502). The script reads a csv txt file, splits the
line and tries to make a match to a vaiable that has been passed to it.
I use a pattern match
if ( $list[2] =~ /\b$search_name\b/ )
that works perfectly on that machine, but when I loaded it to my Unix
server(solaris running apache and perl5.00404) it it didn't make the
match. After trying many different combination(hours of banging my head
on my desk) and testing to see if $list[2] and $seacrh_name were actualy
there I took a stab in the dark and added a ?.
if ( $list[2] =~ /\b$search_name?\b/)
and it worked, but I don't understand why, and that disturbs me because
I'm not sure whats going on. I'm hoping someone can shed some light on
this for me.
Best Regards
Dan Burch
------------------------------
Date: Sun, 02 Jul 2000 17:10:05 GMT
From: costas_menico@mindspring.com (Costas Menico)
Subject: Re: Perl Newbie Question
Message-Id: <395f7451.14641038@news.bellatlantic.net>
I know this is a CGI question but I am trying to accomplish this in
Perl.
ASP/VB has an object for tracking users' variables.
The object is called the Session object. This is used for tracking
variables from one form/link to another for a particular user. So you
can say:
cust="John Smith"
Session("CustName")=cust
and then on the next form retrive this info by saying:
cust=Session("CustName")
There is an expiration time when the Session object becomes invalid.
Does Perl have an equivalent?
Costas
------------------------------
Date: Sun, 02 Jul 2000 17:17:08 GMT
From: costas_menico@mindspring.com (Costas Menico)
Subject: Perl vs ASP/VB
Message-Id: <395f7850.15664705@news.bellatlantic.net>
I am interested in possibly using Perl under Windows for web
development. I have some questions.
Why would I want to use Perl under Windows? I already understand the
cross platform advantage.
What are the advantages and disadvantages? What about speed and
concurrency issues?
Is there some site that compares Perl to ASP/VB?
Any help would be appreciated.
Costas
------------------------------
Date: Sun, 02 Jul 00 13:11:21 GMT
From: Neil@nwjones.demon.co.uk (Neil Jones)
Subject: Re: Problems installing perl on PC
Message-Id: <962543481snz@nwjones.demon.co.uk>
In article <8ji3hm$rdc$2@slb7.atl.mindspring.net>
ebohlman@netcom.com "Eric Bohlman" writes:
> Neil Jones (Neil@nwjones.demon.co.uk) wrote:
> : I have a real problem installing perl on my laptop.
> : It is active Perl from a file APi522e.exe
> : It installed fine on my desktop machine some while ago but when I went to
> : install it on the laptop today I ran into problems.
> : The first time I ran out of space on the hard disk which
> : is probably the cause of my current problems.
> : I currently have 37,502,976 bytes free after removing the failed
> : installation.
> :
> : My current problem is that it goes through the installation but
> : fails at 80% giving a message that it can not install the
> : Perl Interpreter and that it is aborting the installation.
>
> That's caused by the installer choking on leftovers from your previous
> attempt to install it. Make sure you've removed *all* files and
> directories from the previous attempt.
I did. The problem was in the registry. I was advised to run regclean.
This worked.
--
Neil Jones- Neil@nwjones.demon.co.uk http://www.nwjones.demon.co.uk/
------------------------------
Date: 2 Jul 2000 17:45:28 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: shouldn't sort return a list?
Message-Id: <962558221.4376@itz.pp.sci.fi>
In article <8jg995$qik$1@nnrp1.deja.com>, jlamport@calarts.edu wrote:
>Yep, you're missing something:
>
>scalar LIST
>
>returns the *number of items in LIST*, not the last item in LIST. In
>your code, %h contains two keys, so the list returned by keys %h contains
>two values, so scalar a() returns 2.
Not really. One of the things you'll need to learn in order to
understand contexts in Perl is that there is _really no way_ to
convert a list into a scalar.
Rather, when an expression in evaluated in scalar context, that
context will propagate until it encounters something that knows
how to return a scalar. The Perl builtins are designed so that
this will always happen one way or another.
Therefore there's no implicit way to turn a list into a scalar.
Of course, some explicit scalar values are more common than the
others. Slices and the comma operator return the final element
of the list they would've otherwise returned. Arrays, qw, keys
and many other builtins return the number of elements instead.
Yet other operators return something completely different. For
a really mindboggling example, try calling a funtion like:
sub foo { $_[0] .. $_[1] }
..in different contexts repeatedly. You'll be surprised.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method." -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: 2 Jul 2000 16:59:03 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Teen Volenteers WANTED
Message-Id: <8jnos7$jd2$1@orpheus.gellyfish.com>
On Sat, 01 Jul 2000 16:28:25 GMT Keith Calvert Ivey wrote:
> bart.lateur@skynet.be (Bart Lateur) wrote:
>
>>OTOH, I think I've read somewhere that some people actually use XML to
>>describe programs. For example, a FOR loop could be constructed like:
>>
>> <FOR VAR="I" START="1" STOP="10" STEP="2">
>> .... <!-- contents of for loop block here -->
>> </FOR>
>
> Yes, ColdFusion works that way:
>
> <CFLOOP INDEX="parameter_name"
> FROM="beginning_value"
> TO="ending_value"
> STEP="increment">
> ...
> <!-- HTML or CFML code to execute -->
> ...
> </CFLOOP>
Except of course this could be said to be said to be an XML application
rather than XML itself - XML itself doesnt have the capability - it is
down to any parser to interpret it in that way.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Sun, 2 Jul 2000 11:17:54 -0400
From: Bennett Todd <bet@rahul.net>
Subject: Re: Unix database for Perl
Message-Id: <20000702111558.A471@oven.com>
--kORqDWCi7qDJ0mEj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
2000-06-16-11:47:59 Abigail:
> But the DBD/DBI aren't the end all. There are also specific
> packages for specific databases. Like sybperl for Sybase, which
> gives you access to the Sybase provided API.
Abigail makes an important point, and this is probably a good matter
to straighten out before you go too deeply into trying to choose a
particular database.
Some database systems have a lot of functionality beyond the bare
minimum common feature set shared by pretty much all of them. And
some of _those_ have special database-specific access libraries that
make some or all of that extra functionality available to Perl.
If you want something like that, you're doing a specific sort of
searching, and the only clue I'd be able to give you is concentrate
on the oldest really big-name database systems, that's probably
where you'll find the richest load of db-specific extensions made
available to perl.
If on the other hand you want to confine your perl programming to
features that are common to most all databases, to make it as easy
as possible to switch out one database system for another with
minimal change to your code, then you want to be looking at DBI. And
in _that_ case, MySQL is distinctly likely to be the nicest choice
out there: it has a reasonably rich query language, and does a
nice job of covering the common features shared by all database
systems. If you're doing your design from the ground up, MySQL can
work great.
If you're porting an existing system the question changes again;
it'll depend on what database-specific features the existing system
depends on.
I personally like prototyping new designs with MySQL, and making
sure I port to PostgreSQL and back before I ship; the result is
pretty easy to port elsewhere. But then, I tend to really hate
RDBMSs altogether, and to design around any need for them wherever I
can.
-Bennett
--kORqDWCi7qDJ0mEj
Content-Type: application/pgp-signature
Content-Disposition: inline
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE5X10iL6KAps40sTYRAv3kAJsHppRS2N6IddE195MIptL/RLWtJwCbBmj2
3H+dGlikpU1YMcRUJbE807w=
=rM7d
-----END PGP SIGNATURE-----
--kORqDWCi7qDJ0mEj--
------------------------------
Date: Sun, 02 Jul 2000 17:10:57 GMT
From: auto71426@hushmail.com
Subject: Uploading files via form without CGI.pm
Message-Id: <8jnt2o$no$1@nnrp1.deja.com>
For educational (masochism) purposes. How would I be able to uploading a
file via a form without using CGI.pm? Any sample scripts/Help URLs/FAQs
welcomed.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 2 Jul 2000 10:11:29 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Welcome to....
Message-Id: <slrn8lujch.abr.tadmc@magna.metronet.com>
On Sun, 02 Jul 2000 14:42:49 +0100, Magic <Magic@mattnet.freeserve.co.uk> wrote:
>comp.lang.perl.lets-make-life-as-difficult-as-possible
comp.lang.perl.is.that.my.ass.or.is.that.a.hole.in.the.ground
>Thought you might be interested
I think you have managed to be wrong yet again.
>to read what I have found by reading
>this group....
Feel free to go away if you do not like it here.
> Perl is a dangerous language to attempt to learn because one wrong
>move and you erase all your files, plus probably several other peoples
>in the process.
You are confusing the programming language with the application.
It is _CGI programs_ that are dangerous, regardless of what
programming language you chose to write your program in.
Perl is actually much _safer_ than any other programming language,
due to its "taint checking", which no other language has.
> There's no such thing as a simple answer to a simple problem.
There is no such thing as a simple problem if it has anything
to do with "Security" and "CGI".
It is _CGI programs_ that are dangerous, regardless of what
programming language you chose to write your program in.
> If you're using Perl the word "Security" is synonymous with the
>words "Practical Joke".
You do not understand the technology that you are using.
Go ahead and whine.
We will all lose sleep because we have failed to win another
convert to Perl (not!).
Write your security holes in VB if you prefer.
>Have fun people, I think I should have gone with my first insting and
^^^^^^^
That doesn't look like a typo.
Do you think "insting" is a word or something?
Or did you mean "instinct" there?
It is beginning to look like you also do not understand the
(natural) language that you are using...
>stuck to searching on www.dogpile.com
Thanks oh so much for leaving.
We all appreciate it!
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 2 Jul 2000 10:45:01 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Welcome to....
Message-Id: <slrn8lulbd.aj8.tadmc@magna.metronet.com>
On Sun, 02 Jul 2000 14:42:49 +0100, Magic <Magic@mattnet.freeserve.co.uk> wrote:
>comp.lang.perl.lets-make-life-as-difficult-as-possible
> There's no such thing as a simple answer to a simple problem.
Yes there is.
simple problem:
how to replace stuff in a file?
simple answer:
Perl FAQ, part 5:
"How do I change one line in a file/
delete a line in a file/
insert a line in the middle of a file/
append to the beginning of a file?"
But you had *two* questions.
hard problem:
how to accept a filename from a cracker and not break stuff?
There's no such thing as a simple answer to a hard problem (perhaps).
> If you're using Perl the word "Security" is synonymous with the
>words "Practical Joke".
All of the "security" aspects discussed in this thread are
about the hard problem, not about the easy problem.
You can eliminate the hard problem by not allowing crackers
to enter filenames.
The source of your security problem is due to what you want
to do, not due to the programming language that you have
chosen to use.
The solution to:
how to accept a filename from a cracker and not break stuff?
will be just as complicated if you choose some other programming
language.
( likely _more_ complicated than solving it with Perl )
>Have fun people, I think I should have gone with my first insting and
>stuck to searching on www.dogpile.com
If you want to do dangerous things, then you will be exposed
to danger.
The choice of programming language has nothing at all do
do with exposing yourself to danger.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 2 Jul 2000 16:12:39 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: where did the email my perl script sent go?
Message-Id: <8jnm57$aem$1@orpheus.gellyfish.com>
On 29 Jun 2000 22:49:56 GMT yoshi wrote:
> Hello.
>
> I am working on a very simple script to send an email to someone (to be built
> upon later) through perl. It runs fine, and prints the blank screen, but the
> email never arrives. How long should it take (I have included the script
> below)?
>
> Thanks!
> yoshi
> datera@datera.com
>
> ===============================
> #!/usr/local/bin/perl -w
> print "Content-Type: text/html\n\n";
>
> use Net::SMTP;
>
> my $subject = "Subject: My test message\n\n";
> my $message = <<EOM;
> Perl sent this message. Nifty, Eh?
> EOM
>
> $smtp = Net::SMTP->new('mailhost');
> $smtp->mail($ENV{USER});
>
> $smtp->to('datera@datera.com');
I cant answer you as to where your messages are going but you might
get som clues if you set the debug mode on Net::SMTP - if you do:
$smtp = Net::SMTP->new('mailhost',Debug => 1 );
You will get scads of information relating to to the SMTP transaction
which should help you to work out what is going on - if you dont
understand what you are seeing you might want to ask in some group that
discusses SMTP as you are more likely to get helpful information there.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
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 3537
**************************************