[15467] in Perl-Users-Digest
Perl-Users Digest, Issue: 2877 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 27 09:08:55 2000
Date: Thu, 27 Apr 2000 06:05:12 -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: <956840712-v9-i2877@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 27 Apr 2000 Volume: 9 Number: 2877
Today's topics:
Re: 5.6.0 make Problem exhacker@my-deja.com
Re: changing first character of string to upper case <billy@arnis-bsl.com>
Re: changing first character of string to upper case <jb@datatap.com>
Re: changing first character of string to upper case <wyzelli@yahoo.com>
Re: changing first character of string to upper case exhacker@my-deja.com
Converting MS Excel to ASCII or HTML <mflaherty2@earthlink.net>
Re: Extracting part of a string <ben@leedsnet.com>
File Parsing scarey_man@my-deja.com
Re: File Parsing <billy@arnis-bsl.com>
Re: File Parsing exhacker@my-deja.com
Re: File Parsing nobull@mail.com
Re: File Parsing <billy@arnis-bsl.com>
Finally <yaqoota@emirates.net.ae>
Re: Finally exhacker@my-deja.com
Re: form to email <you.will.always.find.him.in.the.kitchen@parties>
Re: form to email <tfm@sei.cmu.edu>
help needed for array of hashes comparison <Igor@fiveonline.com>
Re: help needed for array of hashes comparison <rhomberg@ife.ee.ethz.ch>
Re: help needed for array of hashes comparison nobull@mail.com
Re: HELP PLEASE!!! 2 strange problems with HTTP::Reques exhacker@my-deja.com
Re: Installing Perl <you.will.always.find.him.in.the.kitchen@parties>
Re: Internal Error? Possible answer exhacker@my-deja.com
is there sendmail on Win32 platform <ya_hsiung@ms2.url.com.tw>
Re: is there sendmail on Win32 platform <brilliance201@hotmail.com>
Re: Mail::Sender module problem <you.will.always.find.him.in.the.kitchen@parties>
Perl and odbc:win32 <epuente@alum.di.uc3m.es>
Re: Perl compiler exhacker@my-deja.com
Re: Posting MIME articles from scripts <flavell@mail.cern.ch>
Q: ipc example <robert@ling.gu.se>
Q: Script for searching a web site <john.paul.jones@dial.pipex.com>
Re: Script for searching a web site <mflaherty2@earthlink.net>
Re: searching database fields exhacker@my-deja.com
Re: Sort on xx-st piece of array (Bart Lateur)
Re: TCP/IP transfer timeout exhacker@my-deja.com
Updating perl <holger.vankoll@swisscom.com>
Re: URGENT help needed exhacker@my-deja.com
Re: Weird locale error opening file <fw@lanvision.nl>
Win32:ODBC - Delete + Drop problem robconvery@bigfoot.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 27 Apr 2000 11:09:35 GMT
From: exhacker@my-deja.com
Subject: Re: 5.6.0 make Problem
Message-Id: <8e9757$j2c$1@nnrp1.deja.com>
Maybe your paths did not update. You said you have both 5.6 and an
earlier version.
% perl -v
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 10:26:01 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: changing first character of string to upper case
Message-Id: <8e94je$gd2$1@nnrp1.deja.com>
In article <V%TN4.25$u4.613@news.enterprise.net>,
"Tony" <anthony@nexus.uk.com> wrote:
> Hi all,
>
> I need to get a word from a strig and use it twice:
>
> I use the orginal all lower case version for something else, and I duplicate
> it into another $string for browser display.
>
> I want to change the first character to Upper case but I can't seem to get
> it.
>
...skipped...
Why not to RTFM ?
Try perldoc perlfunc !
The function you need is ucfirst.
$string_with_first_uppercase = ucfirst $original_string;
Good luck.
Ilja.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 04:30:46 -0700
From: "jb" <jb@datatap.com>
Subject: Re: changing first character of string to upper case
Message-Id: <sgg8udlaqtj116@corp.supernews.com>
It's rather amusing and frustrating that the obvious doesn't work in this
situation... cut and paste the following and you can see... the last is
correct. AHEM for any guru's reading this ... why doesn't the obvious work
?
#!/usr/bin/perl
$string = "tony";
print " 1 $string\n";
$string =~ tr/a-z/A-Z/; # this should give you all caps ok...
print "$string\n";
$string = "markanthony";
print " 1.1 $string\n";
$string =~ tr/^[a-z]/[A-Z]/; # this should give you first letter capped...
but no
# it actually increments the letters by one value then capitalizes all of
them... ???
print "$string\n";
$string = "antimony";
print " 2 $string\n";
$string =~ s/^[a-z]/\ua/; # this should give you only first capped. the \u
forces the next character to caps...
print $string, "\n";
$string = "antithesis";
print " 3 $string\n";
$string =~ s/^[a-z]/\u[A-Z]/; # this should give you only first capped and
you would think it does but no.
print $string, "\n";
$string = "antonio";
print " 4 $string\n";
$string =~ s/^([a-z])/\u\1/; # this should give you only first capped.
# because the \u forces the next character to caps...
# and the \1 remembers what was surrounded by the ().
print $string, "\n";
> >
Tony <anthony@nexus.uk.com> wrote in message
news:V%TN4.25$u4.613@news.enterprise.net...
> Hi all,
>
> I need to get a word from a strig and use it twice:
>
> I use the orginal all lower case version for something else, and I
duplicate
> it into another $string for browser display.
>
> I want to change the first character to Upper case but I can't seem to get
> it.
>
> I can search for it, but not replace it, I get results like
>
> [A-Z]tring,
>
> and when I use the e modifier to have it read the right side as an
> expression, it won't
> run at all, I'm sure there's a simple answer, anyone know it??
>
> Thanks
>
> Anthony
>
> NEXUS NEW MEDIA
> "DEDICATED TO INTERNET & MULTIMEDIA DESIGN"
> Web: http://www.nexusnewmedia.co.uk
> Tel: +44 (0)161 872 6842
> Fax: +44 (0)161 877 3374
> Email: anthony@nexusnewmedia.co.uk
>
> IMPORTANT NOTICE:
> This email is confidential, may be legally privileged,
> and is for the intended recipient only. Access, disclosure,
> copying, distribution, or reliance on any of it by anyone
> else is prohibited and may be a criminal offence. Please
> delete if obtained in error and email confirmation to
> the sender.
> -----------------------------------------------------
>
------------------------------
Date: Thu, 27 Apr 2000 21:46:15 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: changing first character of string to upper case
Message-Id: <mcWN4.6$VK6.885@vic.nntp.telstra.net>
jb <jb@datatap.com> wrote in message
news:sgg8udlaqtj116@corp.supernews.com...
> It's rather amusing and frustrating that the obvious doesn't work in this
> situation... cut and paste the following and you can see... the last is
> correct. AHEM for any guru's reading this ... why doesn't the obvious
work
> ?
>
<SNIP of much rubbish>
Maybe because it aint obvious? :)
Try RTFM as the OP should have and specifically look up the ucfirst
function.
While you are at it (hint look at perlfunc) check out lcfirst (why not uc
and lc as well...) and maybe you will see why all that was a waste of
effort.
Wyzelli
------------------------------
Date: Thu, 27 Apr 2000 12:10:21 GMT
From: exhacker@my-deja.com
Subject: Re: changing first character of string to upper case
Message-Id: <8e9an5$mp4$1@nnrp1.deja.com>
> AHEM for any guru's reading this ... why doesn't the obvious work
> ?
> $string =~ tr/a-z/A-Z/; # this should give you all caps ok...
this does mean increment and change case...
read the man on tr (unix)
% man tr
tr is not meant for single-character replacements in
this context. To accomplish the task at hand, you
must use regex (s/)
exhacker
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 12:06:22 GMT
From: "Mike Flaherty" <mflaherty2@earthlink.net>
Subject: Converting MS Excel to ASCII or HTML
Message-Id: <23WN4.89$x4.4543@newsread1.prod.itd.earthlink.net>
I was told that Perl had a way to convert MS Excel files into ASCII. Is
anyone familiar with this? How is it done? I need to be able to do this
from a command line so that our search engine (Alkaline - www.vestris.com)
can index XLS files.
Thanks as Always,
Mike
------------------------------
Date: 27 Apr 2000 12:10:23 GMT
From: <ben@leedsnet.com>
Subject: Re: Extracting part of a string
Message-Id: <8e9anf$pte$1@supernews.com>
Eric Bohlman <ebohlman@netcom.com> wrote:
> About 15 years ago, I read a story describing two (possibly apocryphal)
> doctor-patient interactions:
> 1) A man consulted the doctor about excessive underarm sweating. The
> doctor gave him a prescription for aluminum salts and told him "wipe this
> under you arms every morning." A few weeks later, the patient called the
> doctor's office and reported that a) the problem was still occurring and
> b) he needed a new copy of the prescription because the old one had
> become badly smudged from being wiped in his armpits.
In the U.K. this kind of mix-up is known as 'I meant the balls on
the ground', after an original which I also heard from a medical man
(perhaps Doctors are sensitive to innocent misinterpretation of
instruction), whose way to the house of a wealthy female patient
was barred by a savage dog at play.
I'm afraid the story is too rude to reproduce here.
Ben.
------------------------------
Date: Thu, 27 Apr 2000 10:14:25 GMT
From: scarey_man@my-deja.com
Subject: File Parsing
Message-Id: <8e93tp$fob$1@nnrp1.deja.com>
If I have a file with the following line:
aaaa bbbb cccc dddd
how can I read the line into an array using split, even though the
field separators are different lengths each time e.g. 4 spaces, and
then 2 spaces?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 10:36:53 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: File Parsing
Message-Id: <8e9584$h0g$1@nnrp1.deja.com>
In article <8e93tp$fob$1@nnrp1.deja.com>,
scarey_man@my-deja.com wrote:
> If I have a file with the following line:
> aaaa bbbb cccc dddd
> how can I read the line into an array using split, even though the
> field separators are different lengths each time e.g. 4 spaces, and
> then 2 spaces?
>
@array = split ' ', $line;
See perldoc -f split for details.
Ilja.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 10:46:39 GMT
From: exhacker@my-deja.com
Subject: Re: File Parsing
Message-Id: <8e95qc$hjt$1@nnrp1.deja.com>
open (FH,"<filename");
while(<FH>) {
foreach(split/[\sTAB]*/) {
push(@array);
}
}
###############
This should open the file "filename", and read in every line.
On each line, it will split the line on white space and tabs
(TAB is there because of my browser, replace with a tab)
and put those items into your array.
Reply if this does not help.
In article <8e93tp$fob$1@nnrp1.deja.com>,
scarey_man@my-deja.com wrote:
> If I have a file with the following line:
> aaaa bbbb cccc dddd
> how can I read the line into an array using split, even though the
> field separators are different lengths each time e.g. 4 spaces, and
> then 2 spaces?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 27 Apr 2000 12:22:43 +0100
From: nobull@mail.com
Subject: Re: File Parsing
Message-Id: <u9purbrdoc.fsf@wcl-l.bham.ac.uk>
The aptly named scarey_man@my-deja.com writes:
> If I have a file with the following line:
> aaaa bbbb cccc dddd
> how can I read the line into an array using split, even though the
> field separators are different lengths each time e.g. 4 spaces, and
> then 2 spaces?
Please do not post questions about how to use a specific Perl function
until you have read the manual entry for that function.
perldoc -f split
You will note that the field separator argument to split is a PATTERN
(i.e. a regex) not a string.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 27 Apr 2000 11:56:12 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: File Parsing
Message-Id: <8e99sn$lsf$1@nnrp1.deja.com>
In article <8e95qc$hjt$1@nnrp1.deja.com>,
exhacker@my-deja.com wrote:
> open (FH,"<filename");
What about error checking ???
> while(<FH>) {
> foreach(split/[\sTAB]*/) {
No-no-no!
You have at least three mistakes: 1. First, TAB symbol is written as '\t',
not as a TAB or as a literal tabulation (as you suggest later).
2. Why do you put * in regexp ? I guess you mean +, am I right ?
With * you will end up with line split in separate characters.
3. But (IMHO) the right way is to read perldoc -f split and
then use something like split ' ', $line to elimitate leading spaces.
See my previous posting and script below.
> push(@array);
> }
> }
> ###############
> This should open the file "filename", and read in every line.
> On each line, it will split the line on white space and tabs
> (TAB is there because of my browser, replace with a tab)
> and put those items into your array.
>
I'd suggest the following:
#!/usr/bin/perl -w
use strict;
my $filename = 'some_file';
open FH, $filename or die "cannot open $filename: $!\n";
my @array = ();
while (<FH>)
{
chomp;
push @array, split;
}
# just for test
$, = '+';
print @array;
# that's all
Ilja.
PS. BTW, IMO the OP's question was about parsing line by line,
not about collecting all input to one array ... but here I cannot be sure.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 15:41:34 +0400
From: "Quaid Joher" <yaqoota@emirates.net.ae>
Subject: Finally
Message-Id: <8e98tn$5sq9@news.emirates.net.ae>
Finally I have been able to install gd graphic module. (I still think so)
:{
Every thing now seems to be working. The demo provided in the program was
run with the following error message:
Cann't locate object method "new" via package
"GD::Image" at gd_example.cgi line 8.
Following is the complete script:
#!/usr/bin/perl
use lib 'usr/www/home/lib'; #I am hiding my home for security
#use GD;
print "Content-type: image/png\n\n";
# create a new image
$im = new GD::Image(100,100);
# allocate some colors
$white = $im->colorAllocate(255,255,255);
$black = $im->colorAllocate(0,0,0);
$red = $im->colorAllocate(255,0,0);
$blue = $im->colorAllocate(0,0,255);
# make the background transparent and interlaced
$im->transparent($white);
$im->interlaced('true');
# Put a black frame around the picture
$im->rectangle(0,0,99,99,$black);
# Draw a blue oval
$im->arc(50,50,95,75,0,360,$blue);
# And fill it with red
$im->fill(50,50,$red);
binmode STDOUT;
# Convert the image to PNG and print it on standard output
print $im->png;
Do you still think there is a problem with installation?
QUAID
------------------------------
Date: Thu, 27 Apr 2000 12:19:06 GMT
From: exhacker@my-deja.com
Subject: Re: Finally
Message-Id: <8e9b7e$nbu$1@nnrp1.deja.com>
[snip]
> The demo provided in the program was
> run with the following error message:
>
> Cann't locate object method "new" via package
> "GD::Image" at gd_example.cgi line 8.
>
> Following is the complete script:
> #!/usr/bin/perl
> use lib 'usr/www/home/lib'; #I am hiding my home for security
> #use GD;
[snip]
I think you should try un-commenting the third line...
#use GD
Hope this helps.
exhacker
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 28 Apr 2000 00:29:35 +1200
From: "Tintin" <you.will.always.find.him.in.the.kitchen@parties>
Subject: Re: form to email
Message-Id: <956838529.412596@shelley.paradise.net.nz>
"[@@]~" <a@b.com> wrote in message news:8e8664$8krei$1@fu-berlin.de...
> thanks for the tip. Do you know of any resources inparticular that you
have
> found useful?
Try http://cgi-resources.com/
------------------------------
Date: Thu, 27 Apr 2000 08:30:08 -0400
From: Ted Marz <tfm@sei.cmu.edu>
Subject: Re: form to email
Message-Id: <390832D0.EF7E744D@sei.cmu.edu>
At my work they provide a script called WebResponder. I do not know
it's source or cost. You may want to try a search using this name.
Actually, a Google search returns a lot. It is available at
http://www.extropia.com/scripts/form_processor.html
http://www.fukada.com/selena/scripts/form_processor.html
more generally try
http://www.hotscripts.com/Perl/Scripts_and_Programs/Form_Processors/
Ted
Tom Phoenix wrote:
>
> On Wed, 26 Apr 2000, [@@]~ wrote:
>
> > Anyone point me in the right direction to a free form to email script?
>
> If you're wishing merely to _find_ (as opposed to write) programs,
> this newsgroup may not be the best resource for you. There are many
> freeware and shareware archives which you can find by searching Yahoo
> or a similar service. Hope this helps!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 27 Apr 2000 12:35:35 +0100
From: "Igor" <Igor@fiveonline.com>
Subject: help needed for array of hashes comparison
Message-Id: <%BVN4.188$Px3.3744@news2-win.server.ntlworld.com>
I have two arrays, one normal (productids) and the other one an array of
hashes ({id=>...).
Say $rArray and $rArrayHash are the references to them. I wish to delete all
values from $rArrayHash
that do not have a corresponding value in $rArray.
So if the arrays were (1,2,3) and ({id=>1},{id=>2},{id=>4}) I need to delete
the last element of the second
array. What is an example of some code that does that?
thanks
------------------------------
Date: Thu, 27 Apr 2000 14:36:10 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: help needed for array of hashes comparison
Message-Id: <3908343A.8665E136@ife.ee.ethz.ch>
Igor wrote:
>
> I have two arrays, one normal (productids) and the other one an array of
> hashes ({id=>...).
> Say $rArray and $rArrayHash are the references to them. I wish to delete all
> values from $rArrayHash
> that do not have a corresponding value in $rArray.
>
> So if the arrays were (1,2,3) and ({id=>1},{id=>2},{id=>4}) I need to delete
> the last element of the second
> array. What is an example of some code that does that?
Read
perldoc -q unique
perldoc -q difference
to see some examples how to compare two arrays
Or try this untested code:
my %valid = map {$_=>1} @$rArray;
$valid{$rArrayHash->{$_}} || delete $rArrayHash->{$_} for keys
%$rArrayHash;
- Alex
------------------------------
Date: 27 Apr 2000 12:45:34 +0100
From: nobull@mail.com
Subject: Re: help needed for array of hashes comparison
Message-Id: <u9n1mfracg.fsf@wcl-l.bham.ac.uk>
"Igor" <Igor@fiveonline.com> writes:
> I have two arrays, one normal (productids) and the other one an array of
> hashes ({id=>...).
> Say $rArray and $rArrayHash are the references to them. I wish to delete all
> values from $rArrayHash
> that do not have a corresponding value in $rArray.
>
> So if the arrays were (1,2,3) and ({id=>1},{id=>2},{id=>4}) I need to delete
> the last element of the second
> array. What is an example of some code that does that?
First you need to make a hash containing all the ids to keep:
my %keep_id;
@keep_id{@$rArray} = ();
The following does an inplace edit of @$rArrayHash using splice, which
is strictly what you asked for but looks a bit C-ish:
for (my $i = $#$rArrayHash; $i >= 0 ; $i-- ) {
splice @$rArrayHash, $i, 1
unless exists $keep_id{$rArrayHash->[$i]{id}};
}
The following replaces the contents of @$rArrayHash with a new list,
which is almost the same and more readable at the expense of creating
a temporary copy of the array:
@$rArrayHash = grep { exists $keep_id{$_->{id}} } @$rArrayHash;
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 27 Apr 2000 11:02:18 GMT
From: exhacker@my-deja.com
Subject: Re: HELP PLEASE!!! 2 strange problems with HTTP::Request class; one solved, the other one.... somebodyy have an idea?
Message-Id: <8e96nk$ioa$1@nnrp1.deja.com>
In article <3907f354_1@news.telnetwork.it>,
"Federico" <artax@shineline.it> wrote:
> Hi all,
>
> I have a very strange problem with the http:request class when I
use it
> to interrogate the remote search engine of Amazon, and an other one
II thing
> I ihave solved.
>
> The problem I have solved is this: the form of the search engine
of
> Amazon is the follow:
>
> 1) url: htp://amazon.com/exec/obidos/external-search
> 2) method: GET
> 3) environment variables:
> mode=Books&keyword=~write_here~&tag=genialcomparison&Go=Go
>
# OK, here I would say
@temp=("http://amazon.com/exec/obidos/external-search?",
"mode=Books&",
"keyword=blah&",
"tag=genialcomparison&",
"Go=Go");
$url = join("",@temp);
# joins the array into a string with no separation
@temp=();
# clear the array
I do this because I have had strange problems with making requests to
CGI scripts over http, and this has been my fix for most of these
problems, but I will continue reading....
> where instead of ~write_here~ you have to put the keywords and
substitute
> every space with the sequence %20.
Yes, that's right
> If you use the classes Response and
> Requeste defining the variable of the form with the Request class
function
> "content(...)" the answer of the request will be an error page from
Amzon.
Well, I have never tried Response and Request. I use the LWP module
Simple, like this
use LWP::Simple;
$page = get "http://amazon.com/";
> I
> don't know why;have any idea?), BUT I KNOW that if you codify the cgi
> environment variables manually ie if you write
>
> $temp=HTTP::Request-> new('GET' =>
> 'htp://amazon.com/exec/obidos/external-search?
mode=Books&keyword=~write_here
> ~&tag=genialcomparison&Go=Go');
>
> it will work correctly!!!!!!!!!!!!!!!
>
> But the real problem is another one: this form sended by a perl
scrip
> with some sequence of keywords doesn't work correctly. For example it
always
> work if you use just ONE word ... if you use 2 words or more it
depends
> from which words. But if you copy-and-paste all the url and
variables in
> the URL field of your browser using a sequence off keywords that with
the
> script has generated and error ... with the broswer it will work
> perfectly!!!!! SO ... I DON'T KNOW WHAT I CAN THINK NOW .... IS THERE
> SOMEBODY WHO HAVE AN IDEA????????????????????????????????
Let's ask a few questions...
How are you inputting and keeping track of your keywords?
Are you printing %20 after the last keyword?
>
> Sorry for my terrible English, PLEASE if yoiu have an idea write
me;
> thank you all very much, from italy
>
> Federico.
>
> PS: you can try with the keywords:
>
> 1) Fifty Ferrari Grand Prix that DON'T work with perl script but
work with
> the browser!
> 2) Fifty Ferrari work correctly!!!!
>
>
I will look at any replies to this message
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 28 Apr 2000 00:31:24 +1200
From: "Tintin" <you.will.always.find.him.in.the.kitchen@parties>
Subject: Re: Installing Perl
Message-Id: <956838638.568076@shelley.paradise.net.nz>
"Marcus" <mouimet@direct.ca> wrote in message
news:PdJN4.178108$Dv1.2147315@news1.rdc1.bc.home.com...
> I have a dedicated server with Red Hat Linux 6.1 and I need to install
> perl to work with my /home/httpd/cgi-bin directory. I have no idea where
to
> start.... Is perl a free program? I have only previously edited scripts
and
> uploaded them to a cgi-bin. Any help would be very appreciated.
Are you sure you don't have Perl installed? If you did a default RH
install, you will see /usr/bin/perl
------------------------------
Date: Thu, 27 Apr 2000 12:25:18 GMT
From: exhacker@my-deja.com
Subject: Re: Internal Error? Possible answer
Message-Id: <8e9bj2$nnm$1@nnrp1.deja.com>
In article <pDQN4.18121$H7.1138055@brie.direct.ca>,
"Marcus Ouimet" <mouimet@direct.ca> wrote:
> I am getting an internal server error when running my script for my
web
> browser.
Try checking the permissions on the file...
%ls -g
make sure that a web-based user can see the file.
..oO(( Maybe I'm wrong here. If the permissions ))
(( were set so that only superuser could see ))
(( the file, would you get 404 or 500 ... ))
exhacker
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 20:07:05 +0800
From: "netnews" <ya_hsiung@ms2.url.com.tw>
Subject: is there sendmail on Win32 platform
Message-Id: <8e9af8$lgg@netnews.hinet.net>
as title. so that I use it to send mail and receive mail in my perl script
running on win98.
------------------------------
Date: Thu, 27 Apr 2000 14:11:23 +0200
From: Philip Monitor <brilliance201@hotmail.com>
Subject: Re: is there sendmail on Win32 platform
Message-Id: <4hbggsga6d050pl72kf5u936979v14t039@4ax.com>
On Thu, 27 Apr 2000 20:07:05 +0800, "netnews"
<ya_hsiung@ms2.url.com.tw> wrote:
>as title. so that I use it to send mail and receive mail in my perl script
>running on win98.
>
I'd check out Blat by Tim Charon. I use it and it seems to work
great.
http://www.interlog.com/~tcharron/
------------------------------
Date: Fri, 28 Apr 2000 00:34:37 +1200
From: "Tintin" <you.will.always.find.him.in.the.kitchen@parties>
Subject: Re: Mail::Sender module problem
Message-Id: <956838832.225420@shelley.paradise.net.nz>
"Ȳ¼±Àç" <wolman@hanmail.net> wrote in message
news:0sMN4.2$mw2.309@news2.bora.net...
> Hi.
> I need some help. I use Mail::Sender module. And i want to send html file
with some images.
> I saw the html file with some images in the MS Outlook-Express or Netscape
Messenger normally.
> But i don't saw the same html file in the free e-mail provided site.
>
> Example)
> i send the html-file with some image => where => free e-mail provided
site.
>
> => I got the html-file using POP3 in the free e-mail provide site
with MS Outlook Express.
>
> => the html-file is normally (with some images)
>
> but i login free e-mail provide site => and i saw the broken html file
(html-file and some images
>
> is separate ... some images-file is saw attached files)
>
> ...please give me the hlep......
>
>
> ---- below is my send e-mail source ----
>
> $sender = new Mail::Sender { smtp => "Mail server host address"};
>
> if($sender->OpenMultipart({from=>'my_email_address', to=>
'who_email_address',
> subject=>'Title',
subtype=>'related',
> boundary => 'boundary-test-1',
b_ctype => 'text/html; charset=
> us-ascii, b_encoding=>'7bit' } )
> 0) {
>
> // this subscribe HTML-FILE
> $sender->SendFile( {description => 'html body', ctype =>
'text/html; charset=euc-kr',
> encoding=>'7bit',
disposition=>'NONE', file => 'real_mail_form.html' });
>
> // this subscribe IMAGE-FILE in the HTML-FILE.
> $sender->SendFile( {description => 'ed\'s gif', ctype =>
'image/gif', encoding=>'base64',
> disposition=>"inline;
>
filename=\"mail_form_img1.gif\";\r\nContent-ID: <ed1>",
> file=>'mail_form_img1.gif' });
> }
> /////////////////////////////////////////////////
> ------ below is html-file source is link some images -----
>
> <img src="cid:ed1">
This is not a Perl issue. It is an issue with your free email site not
being able to handle CID's.
------------------------------
Date: Thu, 27 Apr 2000 14:32:28 +0200
From: Enrique Puente Buenestado <epuente@alum.di.uc3m.es>
Subject: Perl and odbc:win32
Message-Id: <3908335C.8CDA3F13@alum.di.uc3m.es>
I need help. I'm doing my first program. If I execute my cgi, the
browser say:
CGI Error
The specified CGI application misbehaved by not returning a complete set
of HTTP headers. The headers it did return are:
Can't call method "Sql" without a package or object reference at
d:\inetpub\wwwroot\quique\cgi-bin\conexion.cgi line 5.
If I execute this program in the server (COMMAND), OK it's successfully
WHY I can`t call to Sql from a Web???
thanks and sorry my english... ;)
------------------------------
Date: Thu, 27 Apr 2000 09:55:50 GMT
From: exhacker@my-deja.com
Subject: Re: Perl compiler
Message-Id: <8e92r1$ek9$1@nnrp1.deja.com>
I am trying to use ActiveState Perl (latest
release) under Win95C to compile a Perl script.
The script in question uses LWP::Simple to
download webpages. Is there any hope?
The only thing (other than c code) the command
perlcc sample.pl
spits out is
ERROR: In generating code for sample.pl!
I have seen only negative things about
ActiveState's implementation of perlcc. I'm
hoping that one day we will live in a society
where Perl Scripters will rise to the status of
Perl Programmers :-)
Harley
In article <3907C234.CCC91F42@yahoo.com>,
harish mahindrakar <harris_m@yahoo.com> wrote:
> I use Perl on NT from ActiveState.
> The Perl compiler which comes with binary
distribution simply does not
> work! It is puzzling why this non functional
compiler is distributed.
> Any way if you are using NT don't waste your
time.
> Harris
> Ravinder Kumar wrote:
>
> > How effective it is, can someone share
his/her experience.
> > Where can I find "perlcc" ?.
> >
> > Thanks
> > Ravi
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 13:21:42 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Posting MIME articles from scripts
Message-Id: <Pine.GHP.4.21.0004271313490.5727-100000@hpplus01.cern.ch>
On 27 Apr 2000, CUESTA CUESTA wrote:
> But most news readers support reading and posting mime articles.
> SMTP didn't used to be MIME till it was.
With mail, you are addressing a limited number of recipients. If they
can't or don't wish to handle your format, they can complain, or just
silently dump the stuff in the trash.
When you post to usenet, you are addressing a world-wide audience,
most of whom are lurkers. Even if 95% of them had MIME-supporting
client software, that still leaves a very large number who don't. If
they all posted complaints about your netiquette-violating postings,
there wouldn't be much room left for the technical discussions.
So, you aren't comparing like with like. Sure, my news client can
handle MIME, but that doesn't make me want to get it from usenet.
You best continue to conform to the published netiquette, unless and
until the consensus agrees to change it. If you want the netiquette to
change, it's of only infinitesimal benefit to try to convince the
participants of c.l.p.misc about it. Get thee to the news.admin.*
groups and join the discussion there.
------------------------------
Date: 27 Apr 2000 14:20:46 +0200
From: Robert Andersson <robert@ling.gu.se>
Subject: Q: ipc example
Message-Id: <ytfzpurbhh0h.fsf@panini.cling.gu.se>
Hi all!
I am intrested in do some bidirectional process communication
like. Now I tried that example in the IPC::Open2/3 perldoc, I also
read FMTYEWTKAFHIUTENMCNKÖU(whatever) but that one said the same thing
really.
So what is my problem? -- ah, yes my problem is that when
running this program it seems that cat on Solaris 7 does not behave
the same way that eg Linux 2.2. It rather behaves like sort, that is
-- keeping all the output until it flushes (buffered that is).
In the manual it is said that this Comm.pl program might be the
solution for this. I can not find that module anywhere (not on CPAN
anyhow).
I would appreciate any help that I can get from anyone on this. Maybe
someone could even help me fix this small example file that comes with
the perldoc. So that it can handle IPC::open2 even from programs like
sort.
Yours,
/Robert
#!/usr/bin/perl -w
use strict;
use IPC::Open2;
use FileHandle;
my $pid = open2(*RDR, *WTR, "cat -u -n");
WTR->autoflush;
print WTR "apa\n";
my $got = <RDR>;
print $got;
--
Computational Linguistics
Department of Linguistics
Göteborg University
------------------------------
Date: Thu, 27 Apr 2000 13:48:38 +0100
From: "John Paul Jones" <john.paul.jones@dial.pipex.com>
Subject: Q: Script for searching a web site
Message-Id: <8e9d7h$ikt$1@lure.pipex.net>
Hi,
Can anybody suggest a script for searching my own web site for keywords?
Thanks in advance
John
------------------------------
Date: Thu, 27 Apr 2000 13:00:29 GMT
From: "Mike Flaherty" <mflaherty2@earthlink.net>
Subject: Re: Script for searching a web site
Message-Id: <NRWN4.153$x4.7867@newsread1.prod.itd.earthlink.net>
I use Alkaline and highly recommend it. You can find it at www.vestris.com.
It is free for non commercial use and is very feature rich. I like it
because it can index more than just text or HTML if you instal the right
filter (converter). For example, we index several MS Word documents. Note.
It really isn't a script because you get binaries and no source code.
John Paul Jones <john.paul.jones@dial.pipex.com> wrote in message
news:8e9d7h$ikt$1@lure.pipex.net...
> Hi,
>
> Can anybody suggest a script for searching my own web site for keywords?
>
> Thanks in advance
>
> John
>
>
------------------------------
Date: Thu, 27 Apr 2000 10:25:25 GMT
From: exhacker@my-deja.com
Subject: Re: searching database fields
Message-Id: <8e94ib$gcu$1@nnrp1.deja.com>
In article <3907C7C8.5CF8A1F@home.com>,
Michael Carman <mjcarman@home.com> wrote:
> Todd Anderson wrote:
> >
> > I'm using the routine below to match line in a database, and it
> > automatically defaults to the "else" (not finding the match). If
> > I comment out the "else" it finds the right match.
> > Is perl just lazy or am I missing something?
>
> [code snipped.]
>
At your "if" statement, you're saying
if ($variable != "")
I would instead say
if (length($variable))
this will only fail if $variable contains absolutely nothing.
another way (i think) is to say
if ($variable != "^$")
, where there are no characters between the beginning and end of the
string (given that the variable contains a string :-)
> BTW, chomp() is better than chop() for removing newlines. chop()
removes
> the last char regardless of what it is, chomp() only removes it if it
> matches $/
>
> -mjc
>
I have found that removing newlines with chomp and chop is not as
powerful as some of the code below.
$variable =~ s/\n//;
#removes a single newline from the string
$variable =~ s/\n//g;
#removes all newlines (careful with this one)
Sometimes, internet line returns show up in hex as \r\n\n\r
FYI
Hope this helps
Harley
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 10:20:00 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Sort on xx-st piece of array
Message-Id: <3908058e.2546982@news.skynet.be>
Penpal International wrote:
>I have an array loaded from a file (I've attached it). All fields are
>splitted by a \| . The last one of them must also be splitted with <|>
>(< or >). Does anyone know how to sort the lines of the file?
Sort according to what?
This must be otally off-topic, but I noticed that some of your fields
look like HTML. Broken HTML, that is.
<a href=Thomas Geever, Vioolbouwer>http://viool.searchy.net/</a>
This is completely wrong. The thing between "href=" and ">" is not
acceptable as an attribute for any form of HTML (or SGML, methinks), and
it doesn't look like an URL. My guess is that you have your description
and your URL swapped.
<a href="http://viool.searchy.net/">Thomas Geever, Vioolbouwer></a>
I also think that you're making your own life complicated, by putting
too much in one field. I would split the URL and the description into
two fields, as the whole column looks like it has the same format.
http://viool.searchy.net/|Thomas Geever, Vioolbouwer
As for the last column... there's too much data stuffed in there. Either
you add some redundancy, keep this column as it is, for output only and
add an extra sorting column, with a raw text ("Good") or numeric
appreciation grade. Or, you can forgo this this column, and replace it
by just a grade, and add the HTML formatting on output. I assume that
"Good" will always come out with font color "#00CC00", for example.
--
Bart.
------------------------------
Date: Thu, 27 Apr 2000 11:14:08 GMT
From: exhacker@my-deja.com
Subject: Re: TCP/IP transfer timeout
Message-Id: <8e97dn$jc6$1@nnrp1.deja.com>
In article <8e8pbs$1a29$1@news1.md.xaxon.ne.jp>,
"Akihabara" <akihabara@denno.gumi.com> wrote:
> Hi,
>
> I have been tring creating a very simple http client with perl.
>
> If my client get data from WWW server which respond slowly,
> sometimes the transfer stop and the transfer will not complete
forever.
>
> Then,I want to equip timeout.
>
> How can I do so?
>
> The following is my code now.
>
> ------
> print SOCKET "GET $pass HTTP/1.0\r\n\r\n";
> while (<SOCKET>){
> print;
> }
>
> ------
>
>
You might be reinventing the wheel here. The LWP Modules have a Simple
command that does what you're trying to do.
i.e.
use LWP::Simple
$file = get "http://www.yahoo.com:80/";
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 14:53:10 +0200
From: Holger van Koll <holger.vankoll@swisscom.com>
Subject: Updating perl
Message-Id: <39083836.33552ABE@swisscom.com>
Hi,
I have several hosts (aix) where old versions of perl (4.x etc.) are in
use.
I would like to update those hosts to perl 5.005 ; however, I dont know
anything
regarding backwards-compatibily of 5.005.
Can I expect that all scripts that run under 4.x will run under 5.005
too?
Did you ever had any problems after upgrading perl?
Thx a lot for any information!
Holger
------------------------------
Date: Thu, 27 Apr 2000 10:36:58 GMT
From: exhacker@my-deja.com
Subject: Re: URGENT help needed
Message-Id: <8e9589$h0h$1@nnrp1.deja.com>
I may be way out of context here, but if you are trying to parse an
html file for hidden fields, and then turn around and request another
file with those fields, make sure that you don't have an ampersand
after the question mark (in your cgi request). That was the source of
many a http/500 ISE's for me.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 15:01:20 +0200
From: Frank van Wensveen <fw@lanvision.nl>
Subject: Re: Weird locale error opening file
Message-Id: <e1eggs8a6ttud9s5pm43bhc3q6csggb6d6@4ax.com>
On 26 Apr 2000 18:34:37 +0100, nobull@mail.com wrote:
> > I have a weird problems that seems to be related to locale files being
> > not present.
> I doubt it.
Interesting. Why? :-)
> > It looks like my program tries to open some locale libc
> > file that isn't there, but I have no idea why my program tries to open
> > it,
> Probably because your perl executable is linked against a C run-time
> library that supports locale dependant text for OS error descriptions.
Then why:
- does $! report an 'invalid argument'?
- does this only happen while my second program has the tied file
opened for writing?
If the 'tie' always tries to read locale files (as I would expect it
to happen, either always or never), then the 'tie' should fail as well
when the other program isn't running.
> > and why the resulting $! mumbles about an invalid argument.
> > This works well, except while another Perl program is running in the
> > background which updates the same file, i.e. has it open for writing,
> What error would you like to see in this case?
One that clarifies the nature of the error (i.e. an attempt to open a
locale file that can't be found) and that hints at the cause (i.e.
that explains why this is related to another program having the same
tied file open, or at least points me in the right direction without
having to do an strace to find out what's happening.
So the question remains: WHY is the opening of locale files related to
the tied file being shared?
FVW
------------------------------
Date: Thu, 27 Apr 2000 10:44:53 GMT
From: robconvery@bigfoot.com
Subject: Win32:ODBC - Delete + Drop problem
Message-Id: <8e95n2$hi6$1@nnrp1.deja.com>
I have a Perl cgi script that is comunicating to an access database
using the Win32:ODBC module. I am able to create tables , insert strings
but I cannot delete items from a table or drop a table.
The file is not read only, i have tried both exclusive and non-exlusive
access but this seems to have no effect
The script can be found at
"http://johnson.cs.nott.ac.uk/scripts/request.pl.txt"
I have highlighted the bit that does not work.
I would be very grateful for anyone's help as it is cause a major
problem for me.
Many thanks
Rob
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 2877
**************************************