[17022] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4434 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 26 14:05:31 2000

Date: Tue, 26 Sep 2000 11:05:13 -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: <969991513-v9-i4434@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 26 Sep 2000     Volume: 9 Number: 4434

Today's topics:
        Can't print to filehandle while using IO::Socket (Adrian Harris)
    Re: Candidate for the top ten perl mistakes list <bernie@fantasyfarm.com>
    Re: Candidate for the top ten perl mistakes list (Tim)
    Re: Candidate for the top ten perl mistakes list (Craig Berry)
    Re: Candidate for the top ten perl mistakes list <dsimonis@fiderus.com>
    Re: Controlling line length read by <> (T. Postel)
    Re: Converting urls - the other way! (Rafael Garcia-Suarez)
    Re: determine where visitors are "living" (Jon S.)
    Re: determine where visitors are "living" <uri@sysarch.com>
    Re: determine where visitors are "living" (Abigail)
    Re: determine where visitors are "living" (Craig Berry)
        field length variation <nhiller@san.rr.com>
    Re: field length variation <anders@wall.alweb.dk>
    Re: field length variation (Abigail)
    Re: freeware perl script to binary... <p.m.spandler@bton.ac.uk>
    Re: freeware perl script to binary... <randy_734@my-deja.com>
    Re: Halloween Fun <lr@hpl.hp.com>
    Re: Help with Time::localtime <ren.maddox@tivoli.com>
        Hexadec converted to highascii (i.e chinese) <webmaster@ostas.lu.se>
    Re: Hexadec converted to highascii (i.e chinese) (Abigail)
    Re: How can I combine regular expressions? <ren.maddox@tivoli.com>
    Re: More Newbie Help nobull@mail.com
        moving files across an intranet  <dprowak@ci.syracuse.ny.us>
        Perl on PWS on Win ME <danielxx@bart.nl>
    Re: Perl vs. PHP/Java <wstsoi@hongkong.com>
    Re: Perl vs. PHP/Java <darryl@work-thicker.co.uk>
        perlscript .pl ------>>  perlscript.EXE ....compilation <madtrix23@compuserve.de>
    Re: perlscript .pl ------>>  perlscript.EXE ....compila <mpatton@acuitymedia.com>
    Re: Portability of Perl/Tk programs? (Clinton A. Pierce)
    Re: Send HTMLmail via Perl Script <lr@hpl.hp.com>
        Setting cookies with CGI.pm <Matthew.Couchman@bbsrc.ac.uk>
    Re: Setting cookies with CGI.pm <anders@wall.alweb.dk>
    Re: Thnaks to the Gurus! alphazerozero@my-deja.com
    Re: Thnaks to the Gurus! (Clay Irving)
    Re: Thnaks to the Gurus! <uri@sysarch.com>
    Re: Thnaks to the Gurus! (Craig Berry)
    Re: Uncaught exception question <dbohl@sgi.com>
        Win32::API needs help <wstsoi@hongkong.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 26 Sep 2000 19:47:49 +0200
From: adrian@duual.com (Adrian Harris)
Subject: Can't print to filehandle while using IO::Socket
Message-Id: <adrian-2609001947490001@192.168.0.109>

I have a server script which I want to log incoming data (which is in the
form of xml strings terminated by the \0 character).

It prints to STDOUT fine, but my logfile comes up empty every time. I've
tried putting die-s everywhere, to no avail.

Thanks in advance for any help, which would be much appreciated.

Regards,
Adrian


Briefly the relevant code is as follows:

use IO::Socket;
use IO::Select;
use IO::File;

$| = 1;

my $log = new IO::File ">>log.txt"; 

my $port = shift || 3966;
my $listen = IO::Socket::INET->new(Proto => 'tcp',
               LocalPort => $port,
               Listen => 1,
               Reuse => 1) or die $!;

my $select = IO::Select->new($listen);
while(@ready = $select->can_read) {
   my $socket;
   for $socket (@ready) {
      if($socket == $listen) {
         my $new = $listen->accept;
         $select->add($new);
         print $new->fileno . ": connected\n";
      } else {
         my $line="";
         $socket->recv($line,320);
         (@bits) = split(/\0/, $line);
         my $bit;
         my $i = 1;
         foreach $bit (@bits){
            print "bit $i is $bit\n"; # This prints OK
            print $log "$bit\n";      # This disappears into "bit heaven"
            $i++
         }
      }
   }
}
1;


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

Date: Tue, 26 Sep 2000 11:49:40 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <uah1ts49p7k5hmelt2fvd4gml5n7ctmp9s@news.supernews.net>

Larry Rosler <lr@hpl.hp.com> wrote:

} That's why I would never write (as I have seen written here):
} 
}     push @array => $value; # UGH!!!
} 
} The arrow points the wrong way.

Maybe the next version of perl needs to have '<=' added as synonym for '=>'
so you can always use the one that makes the most intuitive sense in
context...

  /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: Tue, 26 Sep 2000 16:12:25 GMT
From: SPAM+indigo@dimensional.com (Tim)
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <8FBB62DBDindigodimcom@166.93.207.145>

bart.lateur@skynet.be (Bart Lateur) wrote in 
<sn1rssgg32m30spt38h8thnopviks975s2@4ax.com>:

>Adrian Pepper [MFCF] wrote:
>
>>My candidate for the top ten perl mistakes list
>>
>>Using close instead of closedir to close a handle opened using opendir.
>
> 1) Using symbolic references to store user data, instead of in a hash.

41) my @array = [ 1, 2, 3, 4];
42) my %hash = { bob => 6, maxine => 21 };



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

Date: Tue, 26 Sep 2000 17:48:42 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <st1obqslh389b4@corp.supernews.com>

Abigail (abigail@foad.org) wrote:
: Yeah, except that Perl is still supposed to be a 1-token lookahead parser.
: Determinining a possible end of a glob however, takes more than 1 token.
: 
: In fact, it can take more than k tokens for any k.

Well, so much for that idea...didn't realize the lookahead was limited in
all cases.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Quidquid latine dictum sit, altum viditur."
   |


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

Date: Tue, 26 Sep 2000 13:45:23 -0400
From: Drew Simonis <dsimonis@fiderus.com>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <39D0E0B3.51235095@fiderus.com>

Gwyn Judd wrote:
> 
> 
> 8a. Uses tr/// when s/// is needed

How about using a regex in the tr values?


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

Date: Tue, 26 Sep 2000 17:38:46 GMT
From: T.Postel@ieee.org (T. Postel)
Subject: Re: Controlling line length read by <>
Message-Id: <Sa5A5.22$SqM1.1376442@news.randori.com>

In article <slrn8t0suc.en.bernard.el-hagin@gdndev25.lido-tech>, 
bernard.el-hagin@lido-tech.net wrote:
>
>Hi,
>
>        Is it possible to make the <> ignore lines which contain more than
>an arbitrary amount of characters when reading a file (or any other
>source of data)?
>
>Regards,
>Bernard

From the other responses in this thread I'd guess you can't do this 
with <>. I couldn't tell if you wanted to prevent wasting storage 
space or time. If you are willing to take the time, you can read only 
the length you are willing to store and check to see if it contains a 
newline character. If it does, store it then read the next piece.
This may give you some ideas.

use strict;

my $test;
my $size = -s 'file';
my $length = 100;
open (FILE, 'file') or die "$!";
while (tell FILE < $size) {
    read(FILE, $test, $length);
    print $test unless (index $test, "\n") == -1;
    }
close FILE;



-- 
While my e-mail address is not munged,     | T.Postel@ieee.org
I probably won't read anything sent there. |


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

Date: Tue, 26 Sep 2000 15:43:49 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Converting urls - the other way!
Message-Id: <slrn8t1he4.ffr.rgarciasuarez@rafael.kazibao.net>

Richard Lawrence wrote in comp.lang.perl.misc:
>In article <slrn8suuji.cn0.rgarciasuarez@rafael.kazibao.net>,
>  rgarciasuarez@free.fr (Rafael Garcia-Suarez) wrote:
>> Richard Lawrence wrote in comp.lang.perl.misc:
>> >
>> >However converting something back (ie. from "hello there" to "hello%
>> >20there") has me stuck. Can anyone help?
>>
>> Use the URI::Escape module.
>>
>
>Thanks!
>
>Unfortunately my server doesn't have that and i'm not able to get it
>installed.

As far as I know, the only thing you need is to copy the file
URI/Escape.pm (including the creation of the URI/ directory)
under your cgi-bin directory. This should work.

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Tue, 26 Sep 2000 15:07:38 GMT
From: jonceramic@nospammiesno.earthlink.net (Jon S.)
Subject: Re: determine where visitors are "living"
Message-Id: <39d0bb83.6468317@news.earthlink.net>

On Tue, 26 Sep 2000 09:58:22 +0100, "Graham Wood"
<graham.wood@iona.com> wrote:

>Why not ask them instead of deviously trying to guess? I can't see many
>people objecting to selecting a country specific version of a web page. Get
>them to click on the flag of their choice. That way you can even catch the
>people who are on holiday somewhere else but are dying to know what's on
>sale in the web shop back home.

Here, here.

If your site content has a valid reason for such info (like, say, the
current weather on a portal site), people will tell you where they
are.  (Or, maybe where they'd like to be in the case of weather...)

So, if the content warrants it, just _ask_ your users.  If you're
trying to track them, you're SOL.

Jon


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

Date: Tue, 26 Sep 2000 17:28:18 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: determine where visitors are "living"
Message-Id: <x7pulr9i6m.fsf@home.sysarch.com>

>>>>> "AJF" == Alan J Flavell <flavell@mail.cern.ch> writes:

  >> (like Akamai's trick of routing
  >> browsers to 'nearby' caching servers), this can pay off.

  AJF> But for _that_ kind of application, you couldn't care less where
  AJF> the user is physically located.  You're only looking for
  AJF> network-nearness, and that can be quite different from geography.
  AJF> Network-nearness can be measured (by number of hops, by RTT,
  AJF> etc.) (modulo the effects of QoS or diff.serv. measures, but this
  AJF> goes way off-topic so I'll stop there).

akamai uses many metrics to 'determine' where you are located, both on
the net and geographically. and they use a complex set of tables based
on many things like net cost, time, hops, server load, etc. to select
which server you get. their system works only because they look at all
that input and that gives a better download result on average for large
sites. this can be and is sold to customers. it doesn't have to be 100%
right or even close as long as it is better then the current situation
for a customer.

now, for a single site to try and do something similar would be almost
impossible and definitely worthless.

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: 26 Sep 2000 17:42:40 GMT
From: abigail@foad.org (Abigail)
Subject: Re: determine where visitors are "living"
Message-Id: <slrn8t1nu2.lo9.abigail@alexandra.foad.org>

Uri Guttman (uri@sysarch.com) wrote on MMDLXXXIII September MCMXCIII in
<URL:news:x7pulr9i6m.fsf@home.sysarch.com>:
'' 
'' akamai uses many metrics to 'determine' where you are located, both on
'' the net and geographically. and they use a complex set of tables based
'' on many things like net cost, time, hops, server load, etc. to select
'' which server you get. their system works only because they look at all
'' that input and that gives a better download result on average for large
'' sites. this can be and is sold to customers. it doesn't have to be 100%
'' right or even close as long as it is better then the current situation
'' for a customer.

But note that determining what the best "site" for you is to download
stuff from is quite different from getting a geographical location.
The net has its own geometry, and there's no reason useful measurements
can't be performed in that geometry. It just isn't homeomorphic with the
earth surface.



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


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

Date: Tue, 26 Sep 2000 17:54:15 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: determine where visitors are "living"
Message-Id: <st1om76i649r59@corp.supernews.com>

Alan J. Flavell (flavell@mail.cern.ch) wrote:
: > (like Akamai's trick of routing
: > browsers to 'nearby' caching servers), this can pay off.
: 
: But for _that_ kind of application, you couldn't care less where the
: user is physically located.  You're only looking for network-nearness,

Of course; I actually mentioned this in part of my post you didn't quote.
You can in turn correlate network position to geography, losing still more
accuracy in the process.

: and that can be quite different from geography.  Network-nearness can
: be measured (by number of hops, by RTT, etc.) (modulo the effects of
: QoS or diff.serv. measures, but this goes way off-topic so I'll stop
: there).

Yeah, highly interesting but definitely non-Perl from the start.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Quidquid latine dictum sit, altum viditur."
   |


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

Date: Tue, 26 Sep 2000 16:27:55 GMT
From: "Nathan D Hiller" <nhiller@san.rr.com>
Subject: field length variation
Message-Id: <f84A5.615$Y5.21194@typhoon.san.rr.com>

Does anyone know how to make an input field box the same
length on both IE and Netscape browsers?

The input field box for the member login on my web site
is different lengths depending on which browser you view it with.
With Netscape the field looks much longer than I want it to be.

Thanks,

Nathan

nhiller@san.rr.com






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

Date: Tue, 26 Sep 2000 19:07:18 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: field length variation
Message-Id: <lK4A5.2446$Pf.132193@news010.worldonline.dk>

Nathan D Hiller wrote:

> Does anyone know how to make an input field box the same
> length on both IE and Netscape browsers?
> 
> The input field box for the member login on my web site
> is different lengths depending on which browser you view it with.
> With Netscape the field looks much longer than I want it to be.
> 
> Thanks,
> 
> Nathan
> 
> nhiller@san.rr.com
> 
> 
> 
> 

maybe someone at a HTML ng?

Hopefully, since the fact that you post that question here indicates that 
you won't be able to find out on your own...

-anders

-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: 26 Sep 2000 17:46:27 GMT
From: abigail@foad.org (Abigail)
Subject: Re: field length variation
Message-Id: <slrn8t1o56.lo9.abigail@alexandra.foad.org>

Nathan D Hiller (nhiller@san.rr.com) wrote on MMDLXXXIII September
MCMXCIII in <URL:news:f84A5.615$Y5.21194@typhoon.san.rr.com>:
-- Does anyone know how to make an input field box the same
-- length on both IE and Netscape browsers?
--
-- The input field box for the member login on my web site
-- is different lengths depending on which browser you view it with.
-- With Netscape the field looks much longer than I want it to be.


First of all, this has absolutely nothing to do with the topic of
this group. Please ask in alt.binaries.clip-art, which is at least
as relevant to your issue as this group.

Furthermore, if you try to use HTML to create a "uniform look", 
you're nothing but a quack who fails to graps the basic concepts
of the media (s)he's working with.



Abigail
-- 
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
          for (s;s;s;s;s;s;s;s;s;s;s;s)
              {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'


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

Date: Tue, 26 Sep 2000 16:55:26 +0100
From: Paul Spandler <p.m.spandler@bton.ac.uk>
Subject: Re: freeware perl script to binary...
Message-Id: <39D0C6EE.E955C6BE@bton.ac.uk>

Brad

Brad Baxter wrote:
> I think Abigail understood you very well.  You can't afford $149?

It's not a case of not being able to afford $149. As I said, perl2exe is
very good.

I find it difficult to justify spending $149 for a simple hack.

Paul
-- 
mailto:p.m.spandler@bton.ac.uk
Systems Manager
IT Research Institute
Faculty of IT
University of Brighton
Telephone (01273) 642925


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

Date: Tue, 26 Sep 2000 16:37:57 GMT
From: Randy <randy_734@my-deja.com>
Subject: Re: freeware perl script to binary...
Message-Id: <39d0d0a6.54114078@207.126.101.100>

abigail@foad.org (Abigail) wrote:

>Paul Spandler (p.m.spandler@bton.ac.uk) wrote on MMDLXXXIII September
>MCMXCIII in <URL:news:39D05A2F.6703023C@bton.ac.uk>:
>== 
>== I'm looking for a freeware unix perl to executable file converter.
>
>chmod, which can be found at: <ftp://ftp.gnu.org/gnu/fileutils/>, and
>runs on more Unices than you can think of.
>

Unices?  Is that really a word?

>
>HTH. HAND.
>
>
>
>Abigail
>-- 
># Perl 5.6.0 broke this.
>%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
>(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi



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

Date: Tue, 26 Sep 2000 08:58:59 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Halloween Fun
Message-Id: <MPG.143a6799211ddec898adc6@nntp.hpl.hp.com>

In article <slrn8t0j20.lo9.abigail@alexandra.foad.org>, abigail@foad.org 
says...

<SNIP all the Perl stuff:->

> But I'm unfamiliar with the practise of telling spooky stories after
> Halloween. Isn't the Halloween period from labour day up till Oct 31,
> and on Nov 1, as soon as the shops open, Thanksgiving starts?

No, that's when Christmas starts.  There's no real money to be made from 
Thanksgiving.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 26 Sep 2000 12:09:24 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Help with Time::localtime
Message-Id: <m3g0mnrsfv.fsf@dhcp11-177.support.tivoli.com>

nobull@mail.com writes:

> "Jonathan Wong" <wongjonk@hotmail.com> writes:
> 
> > use Time::localtime;
> > $now = localtime;
> > 
> > I can access the year/month/day values by using $now->mon, etc.....
> > 
> > My problem is that I need them for the day after and the day before today!!
> > $now->mday +1 won't work during month end and month beginning.
> 
[snip]
> 
> The fix for that is:
> 
> use Time::localtime;
> $now = time;
> $today = localtime($time);
  # that should be
  $today = localtime($now);
> $noonish = $time - $today->hour * 3600 + 43200;
  # here also
  $noonish = $now - $today->hour * 3600 + 43200;
> $yesterday = localtime($noonish - 86400);
> $tomorrow = localtime($noonish + 86400);
> 
> print "Yesterday was day ",$yesterday->mday," of the month\n"; 
> print "Tomorrow will be day ",$tomorrow->mday," of the month\n"; 

An alternative solution (not that there is anything at all wrong with
this solution) would be to use one of the date modules.  Either
Time::Local, which would allow a similar bypassing of the DST problem,
or Date::Calc, which allows day addition:

#!/usr/local/bin/perl -w
use strict;
use Date::Calc qw(:all);
my(%today, %yesterday, %tomorrow);
my @date = qw(year month day);

@today{@date} = Today;
@yesterday{@date} = Add_Delta_Days(@today{@date}, -1);
@tomorrow{@date} = Add_Delta_Days(@today{@date}, 1);

print "Yesterday was day ", $yesterday{day}, " of the month\n";
print "Tomorrow will be day ", $tomorrow{day}, " of the month\n";
__END__

-- 
Ren Maddox
ren@tivoli.com


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

Date: Tue, 26 Sep 2000 17:42:25 +0200
From: Jimmy Lantz <webmaster@ostas.lu.se>
Subject: Hexadec converted to highascii (i.e chinese)
Message-Id: <39D0C3DE.4A3A8016@ostas.lu.se>

Hi,
I wonder if there's anyone who knows how I can convert hexadec for
example :
@hexdec = ('D3A3','BBA8', 'D7F7', 'D5DF', 'A3BA', 'CFF4', 'BEFC',
'B0D6', 'C8EB', 'C1CB', 'C1CB', 'D3FC', 'A3AC');
into ascii (highascii).
I've been trying to pack it and uu encode it, but I would be grateful if
someone could tell me if it can be done and give me some pointers which
function to use.
Thanks in advance
Jimmy Lantz
Sweden
Dept. of east asian languages
Lund Univ.


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

Date: 26 Sep 2000 15:54:22 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Hexadec converted to highascii (i.e chinese)
Message-Id: <slrn8t1hj1.lo9.abigail@alexandra.foad.org>

Jimmy Lantz (webmaster@ostas.lu.se) wrote on MMDLXXXIII September
MCMXCIII in <URL:news:39D0C3DE.4A3A8016@ostas.lu.se>:
<> Hi,
<> I wonder if there's anyone who knows how I can convert hexadec for
<> example :
<> @hexdec = ('D3A3','BBA8', 'D7F7', 'D5DF', 'A3BA', 'CFF4', 'BEFC',
<> 'B0D6', 'C8EB', 'C1CB', 'C1CB', 'D3FC', 'A3AC');
<> into ascii (highascii).
<> I've been trying to pack it and uu encode it, but I would be grateful if
<> someone could tell me if it can be done and give me some pointers which
<> function to use.

man perlfunc and pick the one with the obvious name....



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
#    A nesting eagle. Bankei
#    dies near a palace. Two
#    bears howl. The King.


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

Date: 26 Sep 2000 12:26:17 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: How can I combine regular expressions?
Message-Id: <m3d7hrrrnq.fsf@dhcp11-177.support.tivoli.com>

Jeff Pinyan <jeffp@crusoe.net> writes:

> 
>   $line =~ s/\b(AL|BE|GA|DE|EP)(?=[a-z]|\W)/\u\L$1/g;
> 

It might be a reasonable optimization to simply "not care" about what
the two-letter combinations are:

$line =~ s/\b([A-Z])([A-Z])(?=[a-z]|\W)/$1\l$2/g;

Then you don't need the list of possibilities.

-- 
Ren Maddox
ren@tivoli.com


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

Date: 26 Sep 2000 17:55:16 +0100
From: nobull@mail.com
Subject: Re: More Newbie Help
Message-Id: <u9em279jpn.fsf@wcl-l.bham.ac.uk>

"Jonathan Klaff" <jon.klaff@rdel.co.uk> writes:

> I have found a way around my earlier problem, but would also like to know
> how I can source a shell script from a perl script.

This question comes up here every few months.  I doubt the answer has
changed in the last few months, please view old threads on your
favourate Usenet search engine.

The question is ambiguous.  Some of the interpretations are
meaningless and some are covered in the FAQ.

Can you claify what you are seeking to achieve?

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 26 Sep 2000 17:41:17 GMT
From: "David Prowak" <dprowak@ci.syracuse.ny.us>
Subject: moving files across an intranet 
Message-Id: <1d5A5.34463$O37.4751662@typhoon.nyroc.rr.com>

Hi,

I need to move a file from a shared folder on a PC
withing our intranet to our web server.

I'd rather not use NET::FTP as then I'd have to run
a program from the client PC.  The client PC may
change as time goes on, and I'd like to be controlling
the whole process from the web server.

Can FILE::COPY work across the network?  I've tried,
but to no avail.

What other choices would I have?

TIA,
Dave





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

Date: Tue, 26 Sep 2000 17:13:54 GMT
From: "Daniel van den Oord" <danielxx@bart.nl>
Subject: Perl on PWS on Win ME
Message-Id: <mP4A5.988$EA.6039@Typhoon.bART.nl>

I have installed Microsoft Personal Webserver on Windows ME... This works
just fine..
After this I installed Perl 5.6 build 618 without installation problems...
Though when I'm trying to excess
http://daniel304/cgi-bin/filer.pl
perl says

Can't open perl script ""C:\Inetpub\cgi-bin\filer.pl"": No such file or
directory

This directory is correct and in a dos-box it does open this file
correctly...
I have granted executables and scripts in this dir..

Anybody knows what kinda problem this is.. except for a annoying one ?!?

Thanks




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

Date: Tue, 26 Sep 2000 23:07:59 +0800
From: "Lucas" <wstsoi@hongkong.com>
Subject: Re: Perl vs. PHP/Java
Message-Id: <8qqdtf$prp11@imsp212.netvigator.com>

> The only reason I can think of to move to an "embedded" scripting
> technology over a CGI is resource loading.  Externally running CGI's
> can have expensive setup/teardown costs, whereas the embedded
> scripting languages like PHP, mod_perl, mod_snake, ASP, and JSP bypass
> the setup/teardown, and stay in memory along with the HTTP server.

I am not a Perl guy, I just want to ask, would FastCgi a good way for
solve the problems about "resource loading" of Perl/CGI ?

If yes, how good it is? any benchmarks available?










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

Date: Tue, 26 Sep 2000 16:40:07 +0100
From: "CJ Llewellyn" <darryl@work-thicker.co.uk>
Subject: Re: Perl vs. PHP/Java
Message-Id: <o4kqq8.ei81.ln@paulweller>

"Tony Balazs" <tbalazs-this-must-go@netcomuk.co.uk> wrote in message
news:39d074d4.6302178@1.0.0.119...
-snip-
> It has been recommended to us that we use either Java or PHP to
> implement the development, which will necessitate hosting our site at
> a new ISP as our current one doesn't support PHP, ASP or that kind of
> stuff.
-snip-

For what it's worth, forget using Java. JSP is great but not commonly
supported by UK hosting.

PHP is great for this type of work, all POST and GET vars instantly
available for use, automatic escaping of special chars - for easy use in SQL
statements. (better shut up now before I get accused of Trolling)

Perl is great for just about everything, however you need to lookout for mod
perl support, rather then relying on CGI Perl. There is another recent
thread that explains a lot more about it.

--
Regards, CJ Llewellyn
http://www.cjll.uklinux.net/





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

Date: Tue, 26 Sep 2000 16:13:56 +0100
From: "mAdtriX23" <madtrix23@compuserve.de>
Subject: perlscript .pl ------>>  perlscript.EXE ....compilation 
Message-Id: <39d0c42c$0$16601$7d5a4a58@news.compuserve.de>

Is there any way of compiling pelscripts into exe format ???????





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

Date: Tue, 26 Sep 2000 10:41:15 -0500
From: Mike Patton <mpatton@acuitymedia.com>
Subject: Re: perlscript .pl ------>>  perlscript.EXE ....compilation
Message-Id: <39D0C39B.CC2EB47C@i-report-spammers.acuitymedia.com>

Yeah, check out perl2exe, available at www.indigostar.com



mAdtriX23 wrote:
> 
> Is there any way of compiling pelscripts into exe format ???????


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

Date: Tue, 26 Sep 2000 16:47:18 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Portability of Perl/Tk programs?
Message-Id: <qq4A5.11135$hD4.2731831@news1.rdc1.mi.home.com>

[Posted and mailed]
[Trimmed newsgroups, again!]

In article <8qnibn$pau@beanix.metronet.com>,
	Tye McQueen <tye@metronet.com> writes:
> clintp@geeksalad.org (Clinton A. Pierce) writes:
> ) 
> ) Bzzzt.  Wrong.  Has been since 5.6. 
> 
> But there is no "reliable fork() in Windows".  It is pretty easy
> to get the fork() in Perl 5.6.0 to fail rather colorfully.

In what way that hasn't already been addressed on this thread?

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: Tue, 26 Sep 2000 09:25:25 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Send HTMLmail via Perl Script
Message-Id: <MPG.143a6dcb9af7454498adc7@nntp.hpl.hp.com>

In article <39D0AEA9.EF564864@student.dtu.dk>, c960334@student.dtu.dk 
says...
> joshfeingold@my-deja.com wrote:
> > 
> > Thanks to all for your help.
> > 
> > Below is the code (which I have cut and pasted) and the error I
> > received. Please note that the first line of the code is line 114.
> > 
> > CODE:
> > 
> > open(MAILINPUT, "|/usr/bin/mailx -s $msu $mto >$temp");
> > print "Content-type: text/html\n\n";
> > print MAILINPUT <<"TEST";
> > <HTML><b>Hello $your_name</b></HTML>
> > TEST
> 
> You ought to terminate it with "TEST" rather than TEST (the doublequotes
> should be included).
> 
> > close(MAILINPUT);
> > 
> > ERROR:
> > 
> > Can't find string terminator "TEST" anywhere before EOF at warranty.pl
>                                ^    ^ the quotes

Bzzzt!  Totally wrong.  Did you try it before posting?

This is from perldata:

  An unquoted identifier works like double quotes. There must
  be no space between the << and the identifier. (If you put a space it 
  will be treated as a null identifier, which is valid, and
  matches the first empty line.) The terminating string must appear by 
  itself (unquoted and with no surrounding whitespace) on
  the terminating line.

        print <<EOF;
    The price is $Price.
    EOF

        print <<"EOF";  # same as above
    The price is $Price.
    EOF

A proper answer would refer to perlfaq4: "Why don't my <<HERE documents 
work?"  A guess based on the code posted would impl a space after the 
terminator, *perhaps*.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 26 Sep 2000 16:40:51 +0100
From: Matthew Couchman <Matthew.Couchman@bbsrc.ac.uk>
Subject: Setting cookies with CGI.pm
Message-Id: <39D0C383.6F9A847A@bbsrc.ac.uk>

Hello,

I'm using CGI.pm to get, then set the value of a cookie. I can get the
cookie fine and then i'm trying to set it to 0 using the line:

$cookies{$key}->value("");

Well this seems to work OK within the scope of the program but the
changes aren't reflected in my '~/.netscape/cookies' file. Is there a
call to CGI that saves changes that have been made since the cookies
were fetch()ed?

Thanks,

        Matt.



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

Date: Tue, 26 Sep 2000 17:56:53 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Setting cookies with CGI.pm
Message-Id: <gI3A5.2718$T3.131902@news000.worldonline.dk>

Matthew Couchman wrote:

> Hello,
> 
> I'm using CGI.pm to get, then set the value of a cookie. I can get the
> cookie fine and then i'm trying to set it to 0 using the line:
> 
> $cookies{$key}->value("");

I dont think that whatever is in $cookies{$key} has an object method 
value($) ;-))

If you wish to store a list of cookies in a hash, you may wish to read the 
perlref docs,

$perldoc perlref

$c = $query->cookie($cookiename); # get the value of a named cookie
# compute a new value...
 ...
# print the header with the new value
print $query->header(-cookie(-name=>$cookiename, -value=>$value, 
path=>$path);
 ...

Btw, did you think about reading the docs? try
$perldoc CGI
to view the CGI docs. Less offers nice search features, so you could read 
the less manual to figure out how to search for information on cookies if 
you use perldoc in a real (= *X) OS...

Btw, you are using the -w switch, and of cause the strict pragma, right?

-anders

-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Tue, 26 Sep 2000 15:32:33 GMT
From: alphazerozero@my-deja.com
Subject: Re: Thnaks to the Gurus!
Message-Id: <8qqfii$mcq$1@nnrp2.deja.com>

In article <8FB7D4311darkononenet@206.112.192.118>,
  darkon@one.net (David Wall) wrote:
> I love the definition of "loop" in the glossary of the Camel, and
have  shown it to several people who appreciated the joke even though
they don't  do any programming.


At the risk of requesting copyright violations or repetitions could you
post that one?
Also, to what do you mean by the Camel?  Is this a book that I dont
know about? Or is this a nickname I am unaware of?


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


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

Date: 26 Sep 2000 16:03:27 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: Thnaks to the Gurus!
Message-Id: <slrn8t1i6f.93r.clay@panix2.panix.com>

On Tue, 26 Sep 2000 15:32:33 GMT, alphazerozero@my-deja.com 
<alphazerozero@my-deja.com> wrote:

>Also, to what do you mean by the Camel?  Is this a book that I dont
>know about? Or is this a nickname I am unaware of?

Programming Perl -- O'Reilly books are commonly referred to by the animal
on the cover of the book. See:

   http://www.ora.com/catalog/pperl3/

-- 
Clay Irving <clay@panix.com>
RANSOM, n. The purchase of that which neither belongs to the seller, nor
can belong to the buyer. The most unprofitable of investments. 
- Ambrose Bierce 


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

Date: Tue, 26 Sep 2000 17:33:24 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Thnaks to the Gurus!
Message-Id: <x7n1gv9hy3.fsf@home.sysarch.com>

>>>>> "a" == alphazerozero  <alphazerozero@my-deja.com> writes:

  a> In article <8FB7D4311darkononenet@206.112.192.118>,
  a>   darkon@one.net (David Wall) wrote:
  >> I love the definition of "loop" in the glossary of the Camel, and
  a> have  shown it to several people who appreciated the joke even though
  a> they don't  do any programming.

  a> At the risk of requesting copyright violations or repetitions could
  a> you post that one?

from memory (too lazy to reach over and look):

loop:	see loop.


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, 26 Sep 2000 17:51:25 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Thnaks to the Gurus!
Message-Id: <st1ogt3al8f806@corp.supernews.com>

Uri Guttman (uri@sysarch.com) wrote:
: from memory (too lazy to reach over and look):
: 
: loop:	see loop.

CS 101 professor:  "In order to discuss recursion, we must first discuss
recursion."  You could spot the students who were going to ace the class; 
they laughed. :) 

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Quidquid latine dictum sit, altum viditur."
   |


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

Date: Tue, 26 Sep 2000 12:43:16 -0500
From: Dale Bohl <dbohl@sgi.com>
Subject: Re: Uncaught exception question
Message-Id: <39D0E034.3A195E46@sgi.com>

Anders Lund wrote:
> 
> Dale Bohl wrote:
> 
> >
> >    Can anyone tell me what the below
> > Uncaught exception from user code: error means?  I've
> > done some looking at the diags but did not see anything
> > there for it.  Any help is greatly appretiated.
> >
> > Improper link???
> >
> >
> > Line 125 is
> >  rename ($tmpfile2, $filename) or die "Can't rename $tmpfile2 to
> > $filename: $!";
> >
> >
> > $tmpfile2 is /tmp/tmpfile2
> > $filename is /export/home/cheetah1/heilmann/public_html/SN1/fs/index.htm
> >
> > Uncaught exception from user code:
> >         Can't rename /tmp/tmpfile2 to
> > /export/home/cheetah1/heilmann/public_html/SN1/fs/index.htm: Improper
> > link at ./chgword_homes line 125.
> >         main::replace() called at ./chgword_homes line 90
> >         main::search() called at ./chgword_homes line 56
> >         main::getfiles() called at ./chgword_homes line 28
> >
> 
> you forgot to check the source file.
> if (-f $tmpfile2) ...
> 
> -anders
> 
> --
> [ the word wall - and the trailing dot - in my email address
> is my _fire_wall - protecting me from the criminals abusing usenet]

I don't understand...the file is there.

$tmpfile2 is /tmp/tmpfile2
$filename is /export/home/cheetah1/heilmann/public_html/SN1/fs/index.htm

The Current working directory is /export/home/cheetah3/dbohl/tmp

/tmp/tmpfile2 exists
Uncaught exception from user code:
        Can't rename /tmp/tmpfile2 to
/export/home/cheetah1/heilmann/public_html/SN1/fs/index.htm: Improper
link at ./chgword_homes line 127.
        main::replace() called at ./chgword_homes line 90
        main::search() called at ./chgword_homes line 56
        main::getfiles() called at ./chgword_homes line 28

-- 

Thanks,
Dale

Dale Bohl
SGI Information Services
dbohl@sgi.com
(715)-726-8406
http://wwwcf.americas.sgi.com/~dbohl/
JAPH


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

Date: Wed, 27 Sep 2000 00:02:50 +0800
From: "Lucas" <wstsoi@hongkong.com>
Subject: Win32::API needs help
Message-Id: <8qqh4c$23d1@imsp212.netvigator.com>

Hi all,

Actually I have posted a help 10 days ago here about the same problem,
but I couldn't get any replys, so I guess I did not state my problem
clear enough and post here again today.
I am going to call fuctions from a DLL, but it went something
wrong in the output, so I need Perl guys here to help me.

The functions are:
int initTTS(char *dataPath, short gender);
int spkTTS(char *string, double sentenceRate, short gender);
void termTTS(void);

So I wrote a Perl script to call them:
>>>>>>>>>>>>>>>>>>>>>
use Win32::API;
$the_string = "a sentence here";
$initTTS = new Win32::API("cutalk", "initTTS", [P, I], I);
$spkTTS = new Win32::API("cutalk", "spkTTS", [P, N, I], I);
$termTTS = new Win32::API("cutalk", "termTTS", [], V);

if ($initTTS->Call('d:\\ctts_dll\\datafile',1)  == 1 ){
 print "initTTS ok, ready to go\n";
}
if ( ($spkTTS->Call($the_string, 2, 1)) == 1) {
 print "SpkTTS returned 1";}
else {
 print "returned 0";
}

$termTTS->Call();
>>>>>>>>>>>>>>>>>>>>>
As for the outputs, no any warning messages are returnrd.
However, the output is not correct (the DLL is a TTS Text to
Speech agent that could speak the sentence), just something
liked twisted speaking.

Could anyone figure out what I am going wrong here?
Thanks very very much.

Lucas





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

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


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