[18449] in Perl-Users-Digest
Perl-Users Digest, Issue: 617 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 3 14:06:10 2001
Date: Tue, 3 Apr 2001 11:05:22 -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: <986321121-v10-i617@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 3 Apr 2001 Volume: 10 Number: 617
Today's topics:
Any good way to split a very large string? <tung@turtle.ee.ncku.edu.tw>
Re: Any good way to split a very large string? <uri@sysarch.com>
Re: Any good way to split a very large string? <pillgrim@mail.ru>
array control issues (danny webster)
Re: array control issues (Anno Siegel)
Re: array control issues (Tad McClellan)
Re: Call a script from a script (Tad McClellan)
Re: Call a script from a script <ubl@schaffhausen.de>
Cannot connect using DBD::Sybase <vladikx@yahoo.com>
COM Objects <syarbrou@nospam.enteract.com>
Re: COM Objects <ubl@schaffhausen.de>
Re: COM Objects <syarbrou@nospam.enteract.com>
Re: Disguising Perl scripts <camerond@mail.uca.edu>
Re: Disguising Perl scripts <uri@sysarch.com>
Re: Disguising Perl scripts <zkent@together.net>
help calling sub routines in perl on NT <james@kcnet.com>
Re: help calling sub routines in perl on NT nobull@mail.com
Re: help page refresh runs the script again ! nobull@mail.com
HTML charsets <pillgrim@mail.ru>
IF YOU KNOW THE ANSWER... <zkent@together.net>
Intermediate DBI/CGI books/examples/etc.? (Jesse Sheidlower)
Re: Multiple checkboxes <nap@illx.org>
Multithreaded scripts on Win32 platforms. <niry@bandwiz.com>
Re: Multithreaded scripts on Win32 platforms. <dan@tuatha.sidhe.org>
Re: Newbies welcome <tccoyle@chorus.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 Apr 2001 16:01:36 GMT
From: Chung-Kie Tung <tung@turtle.ee.ncku.edu.tw>
Subject: Any good way to split a very large string?
Message-Id: <9acs50$56l$1@news2.ncku.edu.tw>
In mail message parsing, it is always necessary to devide the whole
message into serveral blocks with the mime boundary string.
In C, we can split the original message by filling NULL char into
the position where the boundary is to get those devided blocks.
No more memory is required.
When using perl split() to handle the same case, ex: a 20MB message,
the original message will stay and the resulting blocks take another
20MB memory..... Even worse, the resulting blocks may need to be devided
further if the mime attachments are recursively in deep levels.
Is ther any way that I can get devided blocks directly from the
original message?
tung
------------------------------
Date: Tue, 03 Apr 2001 17:14:44 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Any good way to split a very large string?
Message-Id: <x73dbpvraz.fsf@home.sysarch.com>
>>>>> "CT" == Chung-Kie Tung <tung@turtle.ee.ncku.edu.tw> writes:
CT> In mail message parsing, it is always necessary to devide the whole
CT> message into serveral blocks with the mime boundary string.
CT> In C, we can split the original message by filling NULL char into
CT> the position where the boundary is to get those devided blocks.
CT> No more memory is required.
CT> When using perl split() to handle the same case, ex: a 20MB message,
CT> the original message will stay and the resulting blocks take another
CT> 20MB memory..... Even worse, the resulting blocks may need to be devided
CT> further if the mime attachments are recursively in deep levels.
CT> Is ther any way that I can get devided blocks directly from the
CT> original message?
don't use split. do a
while( $long_string =~ /(some_regex_that_matches_section)/g ) {
process $1 ;
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Tue, 3 Apr 2001 20:57:34 +0300
From: "Aleksandr Guidrevitch" <pillgrim@mail.ru>
Subject: Re: Any good way to split a very large string?
Message-Id: <9ad30v$4iujk$1@ID-82007.news.dfncis.de>
Uri Guttman <uri@sysarch.com> writes:
> while( $long_string =~ /(some_regex_that_matches_section)/g ) {
>
> process $1 ;
And try to use pointers.
Best regards
Aleks
------------------------------
Date: Tue, 03 Apr 2001 14:23:47 GMT
From: dsw@naughty.onetel.net.uk (danny webster)
Subject: array control issues
Message-Id: <slrn9cjmr8.dfa.dsw@naughty.onetel.net.uk>
Hi there.
I posted yesterday, but I had no joy wqith the response.
What im trying to do, is pull out or add a virtualhost to a file (httpd.conf)
A vhost entry starts with <VirtualHost domain.com>
and ends with </VirtualHost>
I need to read in the top line, then the config between, up to the
</VirtualHost> part.
There may be hundreds of them, or just a few. Then I need to add each one to
a separate array, which I can thne manipulate etc.
How can I go about this?
I was doing something like:
if ($conf[$i] =~ /^<VirtualHost \D+>/i) {
while ($conf[$i] !~ /^<\/VirtualHost/i) {
# stuff.
}
}
But I was having problems skipping thru the lines before the </VirtualHost>
(as in reading them into a new array).
I'll then need to either put them into the httpd.conf file, or pull them out.
I suppose it comes down to array control? which i'm pretty shite at!!
Can anyone help me please?
Ta!
Dan.
--
+--------------------------0x44 0x41 0x4E 0x4E 0x59+
| danny webster |
| unix systems engineer One.Tel |
| dwebster@onetel.net.uk |
+----------------0x57 0x45 0x42 0x53 0x54 0x45 0x52+
------------------------------
Date: 3 Apr 2001 14:38:57 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: array control issues
Message-Id: <9acna1$rk2$1@mamenchi.zrz.TU-Berlin.DE>
According to danny webster <dsw@naughty.onetel.net.uk>:
> Hi there.
>
> I posted yesterday, but I had no joy wqith the response.
>
> What im trying to do, is pull out or add a virtualhost to a file (httpd.conf)
>
> A vhost entry starts with <VirtualHost domain.com>
> and ends with </VirtualHost>
I did something similar setting $/ to "</VirtualHost>", then trimming
away leading garbage before "<VirtualHost>". The approach is useable,
but not very robust.
Anno
------------------------------
Date: Tue, 03 Apr 2001 16:51:15 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: array control issues
Message-Id: <slrn9cjron.dcf.tadmc@tadmc26.august.net>
danny webster <dsw@naughty.onetel.net.uk> wrote:
>
>I posted yesterday,
If this is related to some other thread then it should be _in_
some other thread.
Please don't start new threads about the same thing. It breaks stuff.
Followup in the same thread instead.
>but I had no joy wqith the response.
^^^^^^^^^^^^^^^^^^^^^^^^^
What does that mean?
It does not work? (looks to me like it should).
>I suppose it comes down to array control? which i'm pretty shite at!!
This is a family newsgroup, please refrain from unwarranted vulgarity.
>Can anyone help me please?
Looks to me as if you have *already* been helped.
What, exactly, was wrong with the response that you got?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 3 Apr 2001 07:19:55 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Call a script from a script
Message-Id: <slrn9cjcer.cn8.tadmc@tadmc26.august.net>
NOSPAM@mail.ru <NOSPAM@mail.ru> wrote:
>
>Inside a perl script, I want call another one.
perldoc -f system
>(I don't need to go back to the first script after)
perldoc -f exec
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 03 Apr 2001 16:10:38 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Call a script from a script
Message-Id: <3AC9E7EE.2B339005@schaffhausen.de>
NOSPAM@mail.ru schrieb:
>
> Hi,
>
> Inside a perl script, I want call another one.
>
> (I don't need to go back to the first script after)
>
> How can I do by a simple way ?
>
> Thanks
require "file";
------------------------------
Date: Tue, 03 Apr 2001 10:16:10 -0400
From: Vladislav Tolmach <vladikx@yahoo.com>
Subject: Cannot connect using DBD::Sybase
Message-Id: <3AC9DB2A.9ACB5CE6@yahoo.com>
*** post for FREE via your newsreader at post.newsfeeds.com ***
Dear sir / madam:
I am trying to use DBD::Sybase library on Linux to
connect to a MS SQL Server. Supposedly, it should
work (according to Mark Schaal at
http://www.freetds.org/faq.html#34) However, I am
getting connection failure. When I tried to trace it,
I got the following output:
====================================================================
DBI 1.14-nothread dispatch trace level set to 4
Note: perl is running without the recommended perl
-w option
-> DBI->connect(dbi:Sybase:server=sql-2000dev, sa,
****, HASH(0x80c8554))
-> DBI->install_driver(Sybase) for perl=5.00503
pid=12803 ruid=504 euid=504
syb_init() -> DBD::Sybase 0.91 initialized
OpenClient version: `ãÿ¿Âb
install_driver: DBD::Sybase loaded (version
0.91)
New DBI::dr (for DBD::Sybase::dr, parent=, id=)
dbih_setup_handle(DBI::dr=HASH(0x816245c)=>DBI::dr=HASH(0x819f840),
DBD::Syb
ase::dr, 0, Null!)
dbih_make_com(Null!, DBD::Sybase::dr, 84)
<- install_driver= DBI::dr=HASH(0x816245c)
-> connect for DBD::Sybase::dr
(DBI::dr=HASH(0x816245c)~0x819f840 'server=sq
l-2000dev' 'sa' **** HASH(0x81447e0))
New DBI::db (for DBD::Sybase::db,
parent=DBI::dr=HASH(0x819f840), id=)
dbih_setup_handle(DBI::db=HASH(0x819f7a4)=>DBI::db=HASH(0x819f7e0),
DBD::Syb
ase::db, 815fc84, Null!)
dbih_make_com(DBI::dr=HASH(0x819f840),
DBD::Sybase::db, 1720)
<- connect= undef at DBI.pm line 408.
-> errstr in DBD::_::common for DBD::Sybase::dr
(DBI::dr=HASH(0x816245c)~0x8
19f840)
<- errstr= '' at DBI.pm line 409.
DBI->connect(server=sql-2000dev) failed: at
t/mytest.pl line 9
DBI->connect(server=sql-2000dev) failed:
<> DESTROY ignored for outer handle
DBI::db=HASH(0x819f7a4) (inner DBI::db=H
ASH(0x819f7e0))
-> DESTROY for DBD::Sybase::db
(DBI::db=HASH(0x819f7e0)~INNER)
DESTROY for DBI::db=HASH(0x819f7e0) ignored -
handle not initialised
<- DESTROY= undef at mytest.pl line 11.
dbih_clearcom 0x819f7a4 (com 0x81a0140, type 2)
done.
Can't call method "errstr" on an undefined value at
t/mytest.pl line 11.
-- DBI::END
-> disconnect_all for DBD::Sybase::dr
(DBI::dr=HASH(0x816245c)~0x819f840)
<- disconnect_all= 1 at DBI.pm line 450.
-> DESTROY in DBD::_::common for DBD::Sybase::dr
(DBI::dr=HASH(0x819f840)~IN
NER)
<- DESTROY= undef during global destruction.
dbih_clearcom 0x816245c (com 0x8138510, type 1)
done.
<> DESTROY for DBI::dr=HASH(0x816245c) ignored
(inner handle gone)
=========================================================================
Here is the script that I am trying to run:
=========================================================================
#! /usr/local/bin/perl
use lib "blib/lib";
use lib "blib/arch";
use DBI;
DBI->trace(4);
$hd = DBI->connect("dbi:Sybase:server=sql-2000dev",
"sa", "", { PrintError => 1,
RaiseError => 0});
print "Error: ", $hd->errstr(), "\n";
print "Connected!!!\n";
===========================================================================
Please, let me know why it does not connect and how I
can fix it. I really appreciate your help.
Thank you in advence,
Vlad Tolmach
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 90,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Tue, 03 Apr 2001 10:17:17 -0500
From: Steve . <syarbrou@nospam.enteract.com>
Subject: COM Objects
Message-Id: <39qjct0kunf23b1ot3o69h322hnumd24g9@4ax.com>
Is it possible to use COM Objects like Word's save as html COM Object
thru Perl? To make things more difficult, I'm trying to use them on a
UNIX based system, specifically Solaris. THanks.
Steve
Newsgroup replies preferred. Remove nospam when replying thru email.
------------------------------
Date: Tue, 03 Apr 2001 17:46:33 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: COM Objects
Message-Id: <3AC9FE68.4332FF1D@schaffhausen.de>
"Steve ." schrieb:
>
> Is it possible to use COM Objects like Word's save as html COM Object
> thru Perl? To make things more difficult, I'm trying to use them on a
> UNIX based system, specifically Solaris. THanks.
If the answer is that, than it probably includes a hint towards the Win32
modules available at CPAN.
->malte
------------------------------
Date: Tue, 03 Apr 2001 12:28:37 -0500
From: Steve . <syarbrou@nospam.enteract.com>
Subject: Re: COM Objects
Message-Id: <at1kcto8icch2ggbipmm7kjck49jlmrgc5@4ax.com>
Thanks. I was looking at the win32::ole modules and before I get into
it to much, considering it's called win32, wouldn't you need to be in
a Windows environment to use this? From the documentation, it doesn't
seem to ask where the com objects are located, so I'd imagine it's
pulling them out of the registry, which obviously Solaris doesn't
have. Thanks.
Steve
On Tue, 03 Apr 2001 17:46:33 +0100, Malte Ubl <ubl@schaffhausen.de>
wrote:
>"Steve ." schrieb:
>>
>> Is it possible to use COM Objects like Word's save as html COM Object
>> thru Perl? To make things more difficult, I'm trying to use them on a
>> UNIX based system, specifically Solaris. THanks.
>
>If the answer is that, than it probably includes a hint towards the Win32
>modules available at CPAN.
>
>->malte
------------------------------
Date: Tue, 03 Apr 2001 08:42:04 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Disguising Perl scripts
Message-Id: <3AC9D32C.5CFE4A84@mail.uca.edu>
Anno Siegel wrote:
>
> According to Peter J. Acklam <jacklam@math.uio.no>:
> > mark.warnes@limecs.com (Mark Warnes) writes:
> >
> > > I have a Perl script that I have developed that is going to
> > > be sold commercially. The problem I have is that I need to
> > > disguise the Perl source so that it cannot be copied.
> >
> > When I need to disguise my Perl programs, I usually just
> > draw glasses and mustaches on them.
>
> Amateur! Rubber masks and natural-hair wigs are state of the art.
>
> Anno
But, remember, TIMTOWTDI. I find that setting the monitor to project a
silhouette and a simple voice scrambler is usually all I need.
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Tue, 03 Apr 2001 16:57:44 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Disguising Perl scripts
Message-Id: <x766glvs3b.fsf@home.sysarch.com>
>>>>> "CD" == Cameron Dorey <camerond@mail.uca.edu> writes:
CD> Anno Siegel wrote:
>>
>> According to Peter J. Acklam <jacklam@math.uio.no>:
>> > mark.warnes@limecs.com (Mark Warnes) writes:
>> >
>> > > I have a Perl script that I have developed that is going to
>> > > be sold commercially. The problem I have is that I need to
>> > > disguise the Perl source so that it cannot be copied.
>> >
>> > When I need to disguise my Perl programs, I usually just
>> > draw glasses and mustaches on them.
>>
>> Amateur! Rubber masks and natural-hair wigs are state of the art.
>>
>> Anno
CD> But, remember, TIMTOWTDI. I find that setting the monitor to project a
CD> silhouette and a simple voice scrambler is usually all I need.
then how about either blue dotting the code whenever it appears on a
monitor. or doing that block pixel stuff. now all you have to do it
create a program that detects any displaying of the script code and
grabbing the frame buffer to do the right obscuring algorithm. i leave
that coding as an exercise to the OP.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Tue, 3 Apr 2001 13:12:41 -0400
From: "Zachary Kent" <zkent@together.net>
Subject: Re: Disguising Perl scripts
Message-Id: <ftny6.2032$jc2.794838@nntp2.onemain.com>
"Uri Guttman" <uri@sysarch.com> wrote in message
news:x766glvs3b.fsf@home.sysarch.com...
> >>>>> "CD" == Cameron Dorey <camerond@mail.uca.edu> writes:
>
> CD> Anno Siegel wrote:
> >>
> >> According to Peter J. Acklam <jacklam@math.uio.no>:
> >> > mark.warnes@limecs.com (Mark Warnes) writes:
> >> >
> >> > > I have a Perl script that I have developed that is going to
> >> > > be sold commercially. The problem I have is that I need to
> >> > > disguise the Perl source so that it cannot be copied.
> >> >
> >> > When I need to disguise my Perl programs, I usually just
> >> > draw glasses and mustaches on them.
> >>
> >> Amateur! Rubber masks and natural-hair wigs are state of the art.
> >>
> >> Anno
>
> CD> But, remember, TIMTOWTDI. I find that setting the monitor to project
a
> CD> silhouette and a simple voice scrambler is usually all I need.
>
> then how about either blue dotting the code whenever it appears on a
> monitor. or doing that block pixel stuff. now all you have to do it
> create a program that detects any displaying of the script code and
> grabbing the frame buffer to do the right obscuring algorithm. i leave
> that coding as an exercise to the OP.
>
> uri
>
no, no, no... C'mon guys.. DUCT TAPE is the answer! Duct tape not only
_fixes_ your program but makes it totally unrecogizable! Yeesh, any of you
born in the south!?
Zach
------------------------------
Date: Tue, 3 Apr 2001 11:00:15 -0500
From: "James Nelson" <james@kcnet.com>
Subject: help calling sub routines in perl on NT
Message-Id: <9acs1q$vml$1@news3.kcnet.com>
I am in the process of writing my first perl script on NT and have come
across a problem I am not being able to find info on in the man pages.
When I try and run my simple script I get the following error:
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
syntax error at
D:\Inetpub\secure.someserver.com\somedirectory\cgi-bin\regform.pl line 43,
near "sub step_1 "
syntax error at
D:\Inetpub\secure.someserver.com\somedirectory\cgi-bin\regform.pl line 108,
near "}"
Execution of
D:\Inetpub\secure.someserver.com\somedirectory\cgi-bin\regform.pl aborted
due to compilation errors.
The following is how I call the sub routine:
&step_1();
Now here is the subroutine:
sub step_1 { # line 43
print header;
&print_header();
print <<END;
<p align="left"><b><font face="Arial" size="4">Account
Registration<br>
END
&print_footer();
} # line 108
I removed the some lines from the print <<END for purposes of reability
Thanks in advance for your help, please email me at james@kcnet.com
------------------------------
Date: 03 Apr 2001 17:56:23 +0100
From: nobull@mail.com
Subject: Re: help calling sub routines in perl on NT
Message-Id: <u91yr9udl4.fsf@wcl-l.bham.ac.uk>
"James Nelson" <james@kcnet.com> writes:
> Subject: help calling sub routines in perl on NT
'help' is implicit you need not say it.
'in Perl' is implicit you need not say it.
'on NT' is probably irrelevant unless you have reason to suspect you
are doing something platform specific somewhere.
'calling sub routines' is not accurate as you are apparently getting an
error in the compilation the subroutine definition not in the call.
Your total score: -1 / 10.
> I am in the process of writing my first perl script on NT and have come
> across a problem I am not being able to find info on in the man pages.
Error messages are documented in perldiag:
syntax error
(F) Probably means you had a syntax error. Common
reasons include:
A keyword is misspelled.
A semicolon is missing.
A comma is missing.
An opening or closing parenthesis is missing.
An opening or closing brace is missing.
A closing quote is missing.
Often there will be another error message associated
with the syntax error giving more information.
(Sometimes it helps to turn on -w.) The error message
itself often tells you where it was in the line when
it decided to give up. Sometimes the actual error is
several tokens before this, because Perl is good at
understanding random input. Occasionally the line
number may be misleading, and once in a blue moon the
only way to figure out what's triggering the error is
to call `perl -c' repeatedly, chopping away half the
program each time to see if the error went away. Sort
of the cybernetic version of 20 questions.
Just in case you didn't understand that consider the non sentence "The
cat ate the mouse is brown."
What I actually meant to say "The cat ate. The mouse is brown."
However if you read it one word at a time you don't see anything is
wrong until you get to the word "is". Programming lanuage compilers
usually work like this. If they detect an error they tell you where
they _deltected_ the error, this may not be the same place as you made
the error.
With that in mind go back and look at the code.
> The following is how I call the sub routine:
>
> &step_1();
BTW: Why are you explicitly suppressing the prototype handling?
> Now here is the subroutine:
No use to us as the error is almost certainly in the perceding code?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 03 Apr 2001 17:36:25 +0100
From: nobull@mail.com
Subject: Re: help page refresh runs the script again !
Message-Id: <u94rw6szxy.fsf@wcl-l.bham.ac.uk>
"novastar" <root@novastar.dtds.net> writes:
> Subject: help page refresh runs the script again !
Yes it does.
This has nothing to do with Perl.
> I have a web based script which sends email with Net::SMTP . The problem is
> that when the user sends the email and for some reason refresh the screen
> then an other one mail is being send. How can I stop this naughty behaviour
> ?
If you call the script using a POST HTTP request rather than a GET
request then some browsers will ask the user if they are sure they
want to submit the request again.
This has nothing to do with Perl.
Another approach is to dynamically generate the page that links to the
script and have it call the script with some sort of unique session ID
(in the URL or in a hidden field). Use this session ID to lookup in
some sort of database (file or directory or whatever) if the current
session has already sent mail.
This has nothing to do with Perl.
CGI::Persistent may help in implementing the above in Perl.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 3 Apr 2001 20:52:29 +0300
From: "Aleksandr Guidrevitch" <pillgrim@mail.ru>
Subject: HTML charsets
Message-Id: <9ad2nl$4p9hl$1@ID-82007.news.dfncis.de>
Hi All !
How to encode text from/to different charsets
(particulary to/from unicode)
Sincerely
Aleks
------------------------------
Date: Tue, 3 Apr 2001 13:08:40 -0400
From: "Zachary Kent" <zkent@together.net>
Subject: IF YOU KNOW THE ANSWER...
Message-Id: <upny6.2030$jc2.794499@nntp2.onemain.com>
"Zachary Kent" <zkent@together.net> wrote in message
news:4y5y6.1430$Cx5.398309@nntp3.onemain.com...
> "wayne.keenan" <wayne.keenan@ntlworld.com> wrote in message
> news:3AC8DA52.320E5FBA@ntlworld.com...
> >
> > Zachary Kent wrote:
> >
> > >
> > > I don't know what to do with the line:
> > > echo /usr/bin/mimencode $filename
> > >
> >
> > use backticks to capture the output of the command, so it becomes:
> >
> > print MAIL `/usr/bin/mimencode $filename`;
> >
>
> Thanks wayne,
>
> However, I am still having trouble with the script in general. The print
> content-type statements are just printing and thats all. This is the body
> of the email I am recieving from the program:
>
> Content-Type: multipart/mixed;
>
Boundary="sendfile-attachment-boundary"--sendfile-attachment-boundaryContent
> -Type: text/plain; charset=us-asciiThis is a MIME encoded message. If your
> mail softwarecannot properly handle the attached file, you may needto get
a
> MIME-aware mailer.--sendfile-attachment-boundaryContent-Type:
> application/octet-stream; name="test.log"Content-Transfer-Encoding:
> base64Content-Disposition: attachment;
> filename="test.log"--sendfile-attachment-boundary--
>
> How do I print those content-types and boundaries so that sendmail *does
> stuff* rather than *print stuff*?
>
> And, please if there are other errors in the script, let me know. I do
not
> know much about sendmail (other than the basics) and not much about
> mime-types.
>
> Thanks Perl-gurus,
> Zach
>
>
------------------------------
Date: 3 Apr 2001 13:41:45 -0400
From: jester@panix.com (Jesse Sheidlower)
Subject: Intermediate DBI/CGI books/examples/etc.?
Message-Id: <9ad20p$4lk$1@panix2.panix.com>
It seems that there is a gap of information that might be
useful to many people writing Perl programs that access databases
over the Web. The _Programming the Perl DBI_ book is very helpful
in understanding the workings of the DBI and what it can do, but
it doesn't have much example code that would help in setting up
actual Web-based databases.
People have posted before that you can't write a really advanced
book on general DBI issues, since it's too dependent on the
particular driver. But it seems to me that there are a lot of
tasks that are pretty common but not driver-dependent, such as
dynamically generating SQL queries, dynamically displaying the
results of SQL queries, doing various types of updates or inserts
from forms, displaying N records at a time, linking to fuller
versions of records, etc.
I appreciate that these might be felt to be straightforward to
many people, but as a relatively novice programmer who needs to
do some of this stuff, it's been very frustating; I've had to
either borrow bits of code where possible, or write what is
almost certainly slow, kludgy code that took me twenty times
longer than it should have.
I assume that if there were a book covering some of this (a
Perl Cookbook-like thing would be ideal), it would have been
mentioned here before, but is there at least a decent site that
would have examples of working databases that do some of these
things? I'm sure many people have the same questions and would
welcome help.
Jesse Sheidlower
<jester@panix.com>
------------------------------
Date: Tue, 03 Apr 2001 09:09:55 -0700
From: Nick Pinckernell <nap@illx.org>
Subject: Re: Multiple checkboxes
Message-Id: <3AC9F5D3.8040504@illx.org>
To get their names use the param() in CGI
use CGI;
$q = new CGI;
print $q->header();
@fields = $q->param();
print @fields;
foreach $value (@fields) {
print $q->param($value);
}
FYI: perldoc CGI
_nick
wayne.keenan wrote:
> I'm pretty sure there's a way to enumerta the form items in CGI.
> if thats not actually the case and I plucked that from the air, if
you are
> creating
> the form in the first place, at the expense of space and time, why not
> add a hidden element with the list of names?
>
> John Plaxton wrote:
>
>
>> Hi there,
>>
>> A problem that I can't get my mind around!
>>
>> I have got multiple checkboxes (50+) on a form with names pulled from a
>> datasource which means they could be anything.
>>
>> How can I run through each element when the form is submitted and
check if
>> they are checked or not?
>>
>> I am using CGI.
>>
>> I can do this if I know what their name properties
>>
>> foreach $field (@fields) {
>> ${$field} = $q->param($field);
>> }
>>
>> where @fields contains a list of names, but I don't know what the
names are
>> going to be.
>>
>> Thanks in advance
>>
>> John
------------------------------
Date: Tue, 3 Apr 2001 15:37:15 +0200
From: "Nir Yurman" <niry@bandwiz.com>
Subject: Multithreaded scripts on Win32 platforms.
Message-Id: <3ac9d1a3@news.barak.net.il>
I tried to program a small multi-threaded script under Active-state Perl for
Win32 (version "5.6.0 built for MSWin32-x86-multi-thread").After invoking
the perl interpreter I have received the following error : "No thread in
this Perl in line ...."
Are multithreaded scripts supported in Perl ? Are they supported under Win32
platforms ?
Help appreciated.
niry@bandwiz.com
------------------------------
Date: Tue, 03 Apr 2001 15:23:45 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Multithreaded scripts on Win32 platforms.
Message-Id: <5Wly6.81245$Ok4.6599703@news1.rdc1.ct.home.com>
Nir Yurman <niry@bandwiz.com> wrote:
> I tried to program a small multi-threaded script under Active-state Perl for
> Win32 (version "5.6.0 built for MSWin32-x86-multi-thread").After invoking
> the perl interpreter I have received the following error : "No thread in
> this Perl in line ...."
> Are multithreaded scripts supported in Perl ? Are they supported under Win32
> platforms ?
Yes, and eys but not with ActiveState perl. You'll need to build your own
or find a build of perl with 5.005 threads enabled. (You'll lose the
ability to fork on WIn32, though)
Dan
------------------------------
Date: Tue, 3 Apr 2001 08:20:28 -0500
From: "Tracy Coyle" <tccoyle@chorus.net>
Subject: Re: Newbies welcome
Message-Id: <9acic7$daq$1@news.chorus.net>
Chris Stith wrote in message ...
>>>Do not ever be afraid of asking a question...
>
>Except when it's already answered for you.
$t = "SELECT * FROM sessiontable WHERE pageID = $page";
I apologize for using a php/mysql example but I spent 3 hours trying to find
out why this query was not working. I reviewed both php and mysql
documentation til my head hurt. First rule of programming...if it doesn't
work, check the syntax (but that is not in the FAQ...)
>> who was the brain that thought giving programmers access to manipulating
>> memory directly was a good idea??!! Moved to Java....someone
recommended
>
>Those who _need_ to access memory directly in programs, such as
>driver programmers, OS programmers, embedded device programmers, etc
>think dirct memory access is a good idea.
So you would agree giving that type of memory access to someone on a remote
machine is not a good idea? I believe that manipulating memory on the
machine the code resides on is acceptable, sometimes desirable, even
occasionally necessary.
>> This newsgroup, like the others crossposted are excellant places to learn
>> and teach.
>
>To learn and teach what is not already taught in the FAQs. When you
>learn at a university, there arer these things called `prerequisite
>courses', but I guess for you that means universities are bad places
>to learn.
I am unsure how you make this assumption (remote memory manipulation maybe!)
but I think universities are fine places to learn. Unfortunately, many
people have lives and responsibilities and can not return to school to learn
new tasks/skills. When I was in college, they taught COBOL and RPG II.
Java, C did not exist and the internet was still in its not-so-public
infancy.
And despite the excellant resources I have found for working with mysql and
php, my experience is that the simplist questions are "so obvious" that no
one addresses them formally. And you miss the point of FAQ's (frequently
asked questions)...they don't teach anything....they answer specific
questions....what if you don't know the right question...??
>> To those that answer, thank you. To those that post, there are
>> others just like you out here, to those that lurk and learn, no question
is
>> stupid to the 50 others with the same question...
>
>The questions in the FAQs aren't stupid. No one says they are, otherwise
>they'd probably not be in the FAQ. It's perfectly acceptable to not know
>the answer to a question that's in a FAQ list. What's not acceptable is
>to ask several hundred or a few thousand people to answer the same
>question that was answered yesterday or that was answered on your hard
>drive all along.
Even you suggest 'stupid' questions "probably not be in the FAQ"....how do
you know a stupid question? You know the answer? Sorry, but freshmen do
not always know as much as seniors....if you don't like the questions
freshmen ask....don't read them.
>I have set followups to where this thread belongs: alt.dev.null;
>I would have used alt.horse.dead.beating, but StuporNews doesn't
>seem to carry that.
Obviously you have missed the intent of the thread...to welcome newbies....
Tracy
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 617
**************************************