[15466] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2876 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 27 06:08:41 2000

Date: Thu, 27 Apr 2000 03:05:08 -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: <956829907-v9-i2876@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 27 Apr 2000     Volume: 9 Number: 2876

Today's topics:
    Re: 5.6.0 make Problem <gellyfish@gellyfish.com>
        changing first character of string to upper case <anthony@nexus.uk.com>
    Re: GD: Problem in installing GD 1.20-1.27 <gellyfish@gellyfish.com>
        HELP PLEASE!!! 2 strange problems with HTTP::Request cl <artax@shineline.it>
        Is this side-effect intended or an error? <ad.brandt@nl.origin-it.com>
    Re: Is this side-effect intended or an error? <wyzelli@yahoo.com>
    Re: Is this side-effect intended or an error? nobull@mail.com
    Re: Is this side-effect intended or an error? <billy@arnis-bsl.com>
    Re: Need help understanding references, specifically wh <uri@sysarch.com>
    Re: Need info on perl modules <gellyfish@gellyfish.com>
    Re: Perl compiler <gellyfish@gellyfish.com>
    Re: Perl2EXE Reassembler <gellyfish@gellyfish.com>
        Posting MIME articles from scripts (CUESTA CUESTA)
    Re: Printing Line Numbers <gellyfish@gellyfish.com>
    Re: Put Variable Initializations In Other File <uri@sysarch.com>
    Re: Redirection with Perl and NT <hb@mediastudio.de>
    Re: script help! <gellyfish@gellyfish.com>
    Re: Sort on xx-st piece of array <gellyfish@gellyfish.com>
        TCP/IP transfer timeout <akihabara@denno.gumi.com>
    Re: URGENT help needed (Lobo)
    Re: use strict; isn't good enough <rhomberg@ife.ee.ethz.ch>
    Re: Win32::ODBC problem on ActiveState Perl james__rice@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 27 Apr 2000 07:16:33 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: 5.6.0 make Problem
Message-Id: <8e8m01$1sk$1@orpheus.gellyfish.com>

On 26 Apr 2000 10:02:29 -0500 Tony Curtis wrote:
>>> On Wed, 26 Apr 2000 14:44:20 GMT,
>>> jlsimms@hotmail.com said:
> 
>> Alright...  Perhaps those of you who have attempted the
>> 5.6.0 installation can be of some assistance.  I have
>> installed Perl dozens and dozens of times, and have been
>> programming with it for a couple of years, so I am
>> certainly not new to some of its behavior.  But
>> recently, when I tried installing 5.6.0, I had some
>> weird things happen.
> 
>> So, I took a look at line 691 of the trusty makefile,
>> and saw this:
> 
>> config.h: Bletch: How does this C preprocessor catenate
>> tokens?
> 
>> Compiler: egcs-2.91.66 Linux Kernel: 2.2.14-5.0 (RedHat)
> 
> The same as my system.
> 

Me too !

But I didnt have that problem.

I might add what happens when you cut out and (fix up to work standalone)
run the code in line 11979 - 12004 of 'Configure' ?

/J\
-- 
In old days books were written by men of letters and read by the
public. Nowadays books are written by the public and read by nobody.
-- 
fortune oscar homer


------------------------------

Date: Thu, 27 Apr 2000 10:46:27 +0100
From: "Tony" <anthony@nexus.uk.com>
Subject: changing first character of string to upper case
Message-Id: <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: 27 Apr 2000 07:23:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: GD: Problem in installing GD 1.20-1.27
Message-Id: <8e8mcq$365$1@orpheus.gellyfish.com>

On 26 Apr 2000 09:51:41 GMT Stearns25 wrote:
> hello all,
> 
> I need some help in installing the GD.pm  package in my RH 6.0 box.  Perl 5.005
> is already fully installed and functional.  We need GD in order to use the
> Barcode module.
> 
> The problem I ran into is:  perl Makefile.PL  said everything is OK, but when I
> do a make,  I got the following errors:
> 
>      In function 'XS_GD__Image-gd2':
>      'GD2_FMT_COMPRESSED' undeclared (first use in this function)
> 
> I also saw several warning about "assignment makes pointer from integer without
> a cast'.
> 
> The make session ended with  "make: *** [GD.o] Error 1.
> 
> Judging from the last message, I guess  make failed because of an undeclared
> identifier.   I tried all versions 1.20 - 1.27 with no success.
> 
> How do I resolve this to install GD?


Seek out and remove all vestiges of the libgd that comes with RedHat -
this will include some /usr/lib/libgd.(a|so.?[\d.]*) files and some
stuff in /usr/include.  You might want to use RPM to remove the package
if you are of nervous disposition. Then get the latest libgd source from
boutell.com and build and install it.  This should sort your problem -
or it did for me when I was in a similar position.

/J\
-- 
D'oh!!!
-- 
fortune oscar homer


------------------------------

Date: Thu, 27 Apr 2000 09:58:32 +0200
From: "Federico" <artax@shineline.it>
Subject: HELP PLEASE!!! 2 strange problems with HTTP::Request class; one solved, the other one.... somebodyy have an idea?
Message-Id: <3907f354_1@news.telnetwork.it>

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

where instead of ~write_here~ you have to put the keywords and substitute
every space with the sequence %20. 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. 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????????????????????????????????

    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!!!!




------------------------------

Date: Thu, 27 Apr 2000 09:16:12 +0200
From: "Ad Brandt" <ad.brandt@nl.origin-it.com>
Subject: Is this side-effect intended or an error?
Message-Id: <0E16861EE7BCD111BE9400805FE6841F0FAA2586@c1s5x001.cor.srvfarm.origin-it.com>

Hi,

If I run the following piece of code with Perl from ActiveX, the array has
changed! IMHO this is an error. Am I right or wrong?

#perl

$sequence ="aap+,noot?,mies*";
my @childs = $sequence =~ /\w+[\*\?\+]/g;

print join(',',@childs),"\n";

foreach my $kid (@childs) {
    chop $kid;
}

print join(',',@childs),"\n";
print "ERROR: the array has changed!!\n";





------------------------------

Date: Thu, 27 Apr 2000 17:58:02 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Is this side-effect intended or an error?
Message-Id: <CSSN4.1$VK6.363@vic.nntp.telstra.net>

Ad Brandt <ad.brandt@nl.origin-it.com> wrote in message
news:0E16861EE7BCD111BE9400805FE6841F0FAA2586@c1s5x001.cor.srvfarm.origi
n-it.com...
> Hi,
>
> If I run the following piece of code with Perl from ActiveX, the array
has
> changed! IMHO this is an error. Am I right or wrong?
>
> #perl
>
> $sequence ="aap+,noot?,mies*";
> my @childs = $sequence =~ /\w+[\*\?\+]/g;
>
> print join(',',@childs),"\n";
>
> foreach my $kid (@childs) {
>     chop $kid;
> }
>
> print join(',',@childs),"\n";
> print "ERROR: the array has changed!!\n";
>

chop removes the last character from the item being chop'ed.  You are
much better using chomp which removes the current value of $/ from the
item being chomp'ed, the default value of $/ being \n.

Wyzelli




------------------------------

Date: 27 Apr 2000 08:27:34 +0100
From: nobull@mail.com
Subject: Re: Is this side-effect intended or an error?
Message-Id: <u9snw8q6bg.fsf@wcl-l.bham.ac.uk>

"Ad Brandt" <ad.brandt@nl.origin-it.com> writes:

> If I run the following piece of code with Perl from ActiveX, the array has
> changed! IMHO this is an error. Am I right or wrong?

> foreach my $kid (@childs) {
>     chop $kid;
> }

You are wrong - it is deliberate and very useful feature.  See the
defintion of foreach in "perldoc perlsyn" or any book on Perl.

There are several ways to protect the array one is:

foreach my $kid (@{[@childs]}) {
   chop $kid;
}
-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Thu, 27 Apr 2000 09:13:41 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: Is this side-effect intended or an error?
Message-Id: <8e90bu$c4l$1@nnrp1.deja.com>

In article
<0E16861EE7BCD111BE9400805FE6841F0FAA2586@c1s5x001.cor.srvfarm.origin-it.com>
,  "Ad Brandt" <ad.brandt@nl.origin-it.com> wrote:

> Hi,
>
> If I run the following piece of code with Perl from ActiveX, the array has
> changed! IMHO this is an error. Am I right or wrong?
>
> #perl
>
> $sequence ="aap+,noot?,mies*";
> my @childs = $sequence =~ /\w+[\*\?\+]/g;
>
> print join(',',@childs),"\n";
>
> foreach my $kid (@childs) {
>     chop $kid;
> }
>
> print join(',',@childs),"\n";
> print "ERROR: the array has changed!!\n";
>

It isn't an error.

From perlsyn manpage:
> If any element of LIST is an lvalue, you can modify it by modifying VAR inside the loop.
> That's because the foreach loop index variable is an implicit alias for each item in the
> list that you're looping over.

So when you chop $kid, you actually modify @childs elements.
Good luck.
Ilja.




Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Thu, 27 Apr 2000 07:59:45 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Need help understanding references, specifically when dealing with     subroutines
Message-Id: <x7hfco2cun.fsf@home.sysarch.com>

>>>>> "DS" == Drew Simonis <care227@attglobal.net> writes:

  DS> if (param('price_plan') eq 'on'){
  DS> 	$price_ammt = param('price_plan_q');
  DS> 	$price_plan = "price_plan";
  DS> 	my $joined = join(':', $price_ammt,$price_plan);

  DS> }
  DS> again and again...

  DS> So, I am almost 100% certain that the array is being written to 
  DS> but just to ease my new nagging suspicion, I'll add a statment to 
  DS> print each element to a log after the array has been completed.

almost %100 is not enough in programming. do you know there is data in
@pages before you try to pass it to that other sub (which you neglected
to repost. try to put all relevent code in one post)

as i sadi before is you pass a ref to an array the that code would
work. but you don't show a complete section of code with the errors you
are getting.

  DS> As a sidebar question, could the block:

  DS> if (param('spec_num') eq 'on'){
  DS> 	$num_ammt = param('spec_num_q');
  DS> 	$spec_num = "spec_num";
  DS> 	my $joined = join(':', $num_ammt,$spec_num);
  DS> 	push @pages, $joined;
	
  DS> }

  DS> be re-written as:

  DS> if (param('spec_num') eq 'on'){
  DS> 	$num_ammt = param('spec_num_q');
  DS> 	push @pages, (join(':', $num_ammt,'spec_num'));

why the join? join for 2 elements is silly. do this:

	$num_ammt = param('spec_num_q');
	push @pages, "$num_ammt:spec_num" ;

or just:

	push @pages, param('spec_num_q') . ':spec_num' ;

  DS> ??  I tend to use extra variables just to be safe.  Curiousity here, 
  DS> really.

safe is ok. verbose is not. learn to combine code into expressions by
using the appropriate perl operators. that is why they were created.


  DS> http://rrtools.ibm.net/addpage.txt

that program needs much work. i can't begin to comment here on all its
problems. first off clean up its indenting and use strict. both will
help you in debugging it.

and the biggest problem i see is many calls of this:

&print_forms;

and only one of this:

print_forms(\@pages);

so how do you know which call has arguments as you don't check for them?
and &foo; has special semantics regarding @_ which you may not grok - it
leaves it alone and passes it through to the called sub whereas foo()
will pass an empty @_ to the sub.

so you have to reduce your code to an example where you do pass in an
array ref and you can't get it inside the sub. i see no such case in
either of your posts. 

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: 27 Apr 2000 07:06:59 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Need info on perl modules
Message-Id: <8e8le3$vn3$1@orpheus.gellyfish.com>

On Wed, 26 Apr 2000 21:13:55 +0100 JB wrote:
> I need to know what's involved in installing modules such as a date command
> and qmail 

qmail isnt written in or anything to do with Perl.

>           on a virtual server. The webspace (funmark) was advertised as
> 'full cgi-bin' but compared to my other host, Hypermart it's not user
> friendly.
> 

Then go somewhere else.

> Am I being naive in thinking it's just a case of uploading the correct
> modules?
> 

It really does depend on the module.  Ideally all modules should be
properly as described in their README file : however some simple ones
that have a single file and do not use AutoLoad might work if uploaded
into a directory of the correct name and which is in @INC.

You will want to read the entry in perlfaq8:

               How do I keep my own module/library directory?

While most of this has the presumption that you have access to a shell
on the target system, the information regarding setting @INC is relevant.

/J\
-- 
Trying is the first step towards failure.
-- 
fortune oscar homer


------------------------------

Date: 27 Apr 2000 07:54:35 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl compiler
Message-Id: <8e8o7b$955$1@orpheus.gellyfish.com>

On Tue, 25 Apr 2000 16:03:09 -0700 Ravinder Kumar wrote:
> How effective it is, can someone share his/her experience.

Apart from what it says in the FAQ - which I hope you have read
you should also read the *serious* caveats in the perlcc manpage
before you even think of using it.

> Where can I find "perlcc" ?.
> 

What happens when you type 'perlcc' at some command prompt.  You should
have it already if you have Perl 5.6.0 or 5.005 .

/J\
-- 
Oh, people can come up with statistics to prove anything, Kent. 14 of
people know that.
-- 
fortune oscar homer


------------------------------

Date: 27 Apr 2000 07:00:12 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl2EXE Reassembler
Message-Id: <8e8l1c$udc$1@orpheus.gellyfish.com>

On Wed, 26 Apr 2000 13:51:20 GMT Ron Sommer wrote:
> 
> worst english, excuse me please.
> I ´ve got following problem:
> I wrote a program to erase a network-problem in a company (language:
> TP7) and want sold it to them.
> This company said:We don´t need this function. Now 3 month later I´ve
> found an Perl-Script on there intranet, which is compiled with perl2exe
> and has the same function like my program. Is there any chance to get
> the source-code out of the compiled perl ?
> 

I think that the Perl code with a perl2exe program is not infact
'compiled' in the traditional sense of the word but is simply wrapped
with an executable runner.  Take a look at the file in some hex viewer
or similar and you will probably see some vestiges of the code.  I think
someone posted some code here a while back that will actually extract the
stuff but I cant remember who or when.

/J\
-- 
It is a very sad thing that nowadays there is so little uselss
information.
-- 
fortune oscar homer


------------------------------

Date: 27 Apr 2000 06:54:05 GMT
From: jcuesta@tid (CUESTA CUESTA)
Subject: Posting MIME articles from scripts
Message-Id: <8e8o6d$9dl1@tid.tid.es>

>>    I want to post an article with MIME format (containing the article in text
>> mode and in HTML format from a perl script. I've tryed with News::NNTPClient
>> and Net::NNTP but the don't seem to allow this.
>
>I hope that's true.  MIME isn't for usenet.  At least, it didn't used to
>be.  Text only, please.
>

  But most news readers support reading and posting mime articles. SMTP didn't
used to be MIME till it was.



--


------------------------------

Date: 27 Apr 2000 07:59:54 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Printing Line Numbers
Message-Id: <8e8oha$a5v$1@orpheus.gellyfish.com>

On Tue, 25 Apr 2000 14:21:16 -0700 Larry Rosler wrote:
> [Posted and a courtesy copy mailed.]
> 
> In article <Pine.GSO.4.10.10004251344100.25963-
> 100000@user2.teleport.com> on Tue, 25 Apr 2000 13:45:26 -0700, Tom 
> Phoenix <rootbeer@redcat.com> says...
>> On Tue, 25 Apr 2000, Chris Ottinger wrote:
>> 
>> > This is probably and easy ? but I was wondering if there is any way to
>> > print line numbers:
>> 
>> I think you want __LINE__, which is the current line number.
>> 
>>     &my_error_handler("Broken frammistat", __LINE__, __FILE__);
> 
> It might well be simpler and require fewer changes to existing code to 
> let the called function figure it out.
> 
> In &my_error_handler:
> 
>         ($package, $filename, $line) = caller;

Or possibly even simpler use the Carp module ...

/J\
-- 
The English are always degrading truths into facts. When a truth becomes
a fact it loses all its intellectual value.
-- 
fortune oscar homer


------------------------------

Date: Thu, 27 Apr 2000 07:36:27 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Put Variable Initializations In Other File
Message-Id: <x7k8hk2dxg.fsf@home.sysarch.com>

>>>>> "A" == Anonymous  <nobody@newsfeeds.com> writes:

  A> Uri Guttman wrote:

  >> and what i did in one line. BFD. go marry purlmoron and stay away
  >> from here.

  A> You accomplished nothing in one line

and your accomplishments are?

%hash = map { chomp ; split /\t/ } <INIT_FILE> ;

what do you call that line of code?

do you even read previous posts? do you even have half of pg's numbskull
of a brain? do you know any perl at all? do you dare to post some of
your code? do you dare to post with a real name? defending anonymously
an anonymous troll is such a powerful thing. just go back to suckling at
the pg's teat of stupidity and take her away from this group. she has
broken several promises to stay away, so why don't you do something
useful and make her back up her pledge?

and if you claim that you still have to open the file and that takes up
more lines of code try this:

%hash = map { chomp ; split /\t/ } do{ local( @ARGV ) = 'init_file'; <> } ;

one fscking line of hash initialization from a file with no modules,
no subs, no pg crapola.

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: Thu, 27 Apr 2000 09:54:14 +0200
From: Heiko Bentrup <hb@mediastudio.de>
Subject: Re: Redirection with Perl and NT
Message-Id: <3907F226.5CFE95A5@mediastudio.de>

This is a multi-part message in MIME format.
--------------BD197B4B15CD66BEDA4D1D63
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

I am sorry to tell you, but i tried it on my my NT-System with Service
Pack 5 and Active Perl 5.whatever installed, and it works. Did you try it
with explicit call of the PERL-Interpreter
c:\perl hello.pl > hello.txt  ?

Works fine for me

Scott Pyatt wrote:

> I've recently loaded Active Perl on a pair of NT systems.  All appears
> to be working fine until I attempt to redirect or pipe ouput from a
> Perl program.  For instance I create a simple hello.pl script with the
> following line.
>
>     print("Hello\n");
>
> I then run it.
>
>     C:\hello.pl
>     Hello
>
> It works.  Now I redirect the output to a file.
>
>     C:\hello.pl > howdy.txt
>
> As you would expect, no output is sent to the screen .  However, the
> "howdy.txt" which gets created is empty!  I've also tried the
> following without any luck.
>
>     C:\hello.pl | sort
>
> No output is sent to the screen.  I've also tried things like this,
> but it still does not work.
>
>     print(STDOUT "Hello\n");
>
> Anyone have any thoughts other than opening a file in Perl or throwing
> NT out the window (pun intended).
>
> Thanks,
> -Scott

--
Heiko Bentrup

MediaStudio
für Marketing und Multimedia GmbH
http://www.mediastudio.de
---------------------------------


--------------BD197B4B15CD66BEDA4D1D63
Content-Type: text/x-vcard; charset=us-ascii;
 name="hb.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Heiko Bentrup
Content-Disposition: attachment;
 filename="hb.vcf"

begin:vcard 
n:Bentrup;Heiko
x-mozilla-html:FALSE
url:http://www.mediastudio.de
org:MediaStudio für Marketing und Multimedia GmbH
adr:;;;Bielefeld;;33605;
version:2.1
email;internet:hb@mediastudio.de
title:New Media Producer
fn:Heiko Bentrup
end:vcard

--------------BD197B4B15CD66BEDA4D1D63--



------------------------------

Date: 27 Apr 2000 07:40:11 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: script help!
Message-Id: <8e8ncb$6d7$1@orpheus.gellyfish.com>

On Wed, 26 Apr 2000 12:41:35 GMT Someone Special wrote:
> On Tue, 25 Apr 2000 14:52:04 -0700, Tom Phoenix <rootbeer@redcat.com>
> wrote:
> 
>>On Tue, 25 Apr 2000 dreiger@rnci.com wrote:
>>
>>> Subject: script help!
>>
>>> I am NOT any kind of programmer
>>
>>So, do you want to become a programmer, or to hire one? If you're looking
>>to become one, perhaps you should search for an introductory course on
>>programming. If you'd like to hire one, there are many newsgroups with
>>'jobs' in their names, or you could just visit your local Perl Mongers.
>>
> I think you missed the point - I don't plan to ever be a programmer,
> and have had this project dumped on me, with no options but to write
> this, or job hunt.  

I think *you* missed *Tom's* point.  You have posted a complete program
to this newsgroup and have asked us to change it for you.  If you
have particular problem with some program you should try to cut the
problem to the smallest number of lines that demonstrate the problem.

There are some helpful people on this group but I very much doubt if any
of them have sufficient time on their hands to rewrite a whole program
for you for free.

/J\
-- 
Lord help me, I'm just not that bright.
-- 
fortune oscar homer


------------------------------

Date: 27 Apr 2000 07:49:34 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sort on xx-st piece of array
Message-Id: <8e8ntu$86f$1@orpheus.gellyfish.com>

On Wed, 26 Apr 2000 16:15:40 +0200 Penpal International wrote:
> nobull@mail.com wrote:
>> 
>> Penpal International <ppi@searchy.net> writes:
>> 
>> > 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?
>> 
>> See FAQ: "How do I sort an array by (anything)?"
>> 
>
> I had already a script myself. But somehow it just failed when trying to
> sort my attached file.

Except hardly anyone will have seen the 'attached file' as you included
it as a MIME attachment which many newsreaders will simply ignore.

You should include a small sample of your data along with *the code* that
you have tried and find not to work.  These things should be included
in the body of your post.  You should not use MIME to send messages
to Usenet.

> I also tried various others, but without success...

Various other whats ?  I see no code at all.

/J\
-- 
Facts are meaningless. You could use facts to prove anything that's even
remotely true!
-- 
fortune oscar homer


------------------------------

Date: Thu, 27 Apr 2000 16:14:03 +0900
From: "Akihabara" <akihabara@denno.gumi.com>
Subject: TCP/IP transfer timeout
Message-Id: <8e8pbs$1a29$1@news1.md.xaxon.ne.jp>

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;
}

------





------------------------------

Date: Thu, 27 Apr 2000 09:48:01 GMT
From: er@matrix.com.br (Lobo)
Subject: Re: URGENT help needed
Message-Id: <39080cb3.3780731@news.matrix.com.br>

On 24 Apr 2000 09:15:32 +0100, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:

>
>You *must* supply some kind of header.  Generally you cannot do what
>you are trying to do anyway as the server will not the parse the content
>produced by a CGI program for SSI stuff. 
>
>You will want to ask in the group comp.infosystems.www.authoring.cgi if
>you dont believe me.
>
>Ah I see what you want to do now.  You need to issue a redirect to the
>file that you have generated after you finished printing it.
>
>#!/usr/bin/perl -w
>
>use strict;
>
>use CGI qw(:standard);
>use CGI::Carp qw(fatalsToBrowser);
>
>my $file = param('file');
>
>my $page = "$file.shtml";
>my $txt  = "$file.txt";
> 
>my $pagefull = "/usr/home/httpd/html/leiloes/show/$page";
> 
>my $txtfull = "/usr/home/httpd/html/leiloes/show/$txt";
> 
> 
># The single quotes you had would have cause the variable
># not to be interpolated - also the '+' was redundant.
>
>open (HTM, ">$pagefull") || die "Cant open $pagefull - $!\n";
> 
> print HTM <<EEBAHGUM;
><html>
> <head>
> <title></title>
> </head>
> <body>
> <!--#include file=\"$txt\" -->
> </body>
> </html>
>EEBAHGUM
>
>close (HTM);
> 
>redirect("/show/$page");
>
>You will want to change the above to reflect the actual URL of the
>generated page.
>
>/J\
>-- 
>The only thing that the artist cannot see is the obvious. The only thing
>that the public can see is the obvious. The result is the Criticism of
>the Journalist.
>-- 
>fortune oscar homer


Thaks a lot!!! :))


------------------------------

Date: Thu, 27 Apr 2000 10:30:56 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: use strict; isn't good enough
Message-Id: <3907FAC0.7EDF959E@ife.ee.ethz.ch>

Ala Qumsieh wrote:
> 
> Alex Rhomberg <rhomberg@ife.ee.ethz.ch> writes:
> 
> > dwb1@home.com wrote:
> > >
> > > Is there a way to get perl to validate function calls on execution?
> >
> > You mean at compile time..
> >
> > use the critical function calls without ampersands or parens:
> >
> > % perl -Mstrict -wle'print 1;b 1'
> > Execution of -e aborted due to compilation errors.
> 
> What Perl are you using? I get this:
> 
> % perl -Mstrict -wle'print 1;b 1'
> Bareword "b" not allowed while "strict subs" in use at -e line 1.
> Unquoted string "b" may clash with future reserved word at -e line 1.
> Number found where operator expected at -e line 1, near "b 1"
>         (Do you need to predeclare b?)
> syntax error at -e line 1, near "b 1"
> Execution of -e aborted due to compilation errors.

I got the same, I just snipped most of it.

> To be able to call a subroutine without the ampersand or parens, you
> have to predeclare it. This means that you have to know before hand
> whether a subroutine exists or not, which defeats the purpose.

I interpreted the original question as:
Is there a way to make perl check function calls (e.g. for typos) at
compile time instead of during execution?

The answer to this is: use strict and don't use ampersands or parens and
the compiler will abort when seeing unknown functions.
Try
perl -Mstrict -e'b if 0'
perl -Mstrict -e'b() if 0'
perl -Mstrict -e'&b if 0'
- Alex


------------------------------

Date: Thu, 27 Apr 2000 08:38:19 GMT
From: james__rice@my-deja.com
Subject: Re: Win32::ODBC problem on ActiveState Perl
Message-Id: <8e8u9r$9qu$1@nnrp1.deja.com>

In article <101c03ac.a2cd0c3e@usw-ex0105-035.remarq.com>,
  glerner <glvsNOglSPAM@hotmail.com.invalid> wrote:
> Hi,
>
> I'm using Win32::ODBC on Windows NT and I'm having a problem
> retrieving column attribute. I used to be able to get column
> attribute (such as string column vs. integer column) by calling
> $db->ColAttributes($db->SQL_COLUMN_TYPE).
>
> After I upgraded ODBC driver, this function stopped working.
>
> Does anybody know how to work-around this problem or if there is
> another way to get column attributes?
>
> Thanks,
>
> Glenn
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!
>
Something similar:

I've just upgraded to active perl 5.6.0.613 (from build 522) and now any of
my scripts involving ODBC connections are failing (oh boy, am I glad I didn't
put this straight on to our server!) - I've tried reinstalling the DBI and
DBD-ODBC modules and the Win32-ODBC module appears to no-longer exist at
activeperl's ppm download site... My scripts only use the DBI module anyway -
but perl now performs an illegal operation and shuts down... Any ideas would
be appreciated - in the mean-time I'm going back to build 522...

James Rice


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 2876
**************************************


home help back first fref pref prev next nref lref last post