[12883] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 293 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 29 05:07:25 1999

Date: Thu, 29 Jul 1999 02:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 29 Jul 1999     Volume: 9 Number: 293

Today's topics:
    Re: _Don't_ loose the connection <kar@webline.dk>
    Re: Beginner needs help with a function (Larry Rosler)
    Re: Beginner needs help with a function (Larry Rosler)
    Re: Beginner-friendly group as cultural adaptation? (Alan Stewart)
    Re: Beginner-friendly group as cultural adaptation? (Anno Siegel)
    Re: Can anyone explain concepts of Perl Objects? (Anno Siegel)
    Re: Die process, Die! (elephant)
    Re: Getting Height and Width of GIF/JPEG in PERL? (Abigail)
    Re: help running Perl Scripts in win95 <laurens@bsquare.com>
    Re: Help! tied DB_RECNO ->put() fails with R_IAFTER (Sara London)
    Re: help: push array refs into hash, sort by refs in ha (Rory C-L)
    Re: help: push array refs into hash, sort by refs in ha (Anno Siegel)
        how to open remote file from the server?? <leech6@ie.cuhk.edu.hk>
    Re: I need fast help ladlad@my-deja.com
    Re: I need fast help ladlad@my-deja.com
    Re: I need fast help (Andreas Fehr)
    Re: NEWSFLASH: Supremes rule anti-advert-ware illegal (catnip)
    Re: NEWSFLASH: Supremes rule anti-advert-ware illegal <quednauf@nortelnetworks.com>
        Perl 5.005_58 ... a bug. <swiftkid@bigfoot.com>
    Re: perl timeouts (Anno Siegel)
        Regex global search/replace problem (CyberPsychotic)
    Re: Regex global search/replace problem (Sam Holden)
        running Perl and Linux from a boot-cd? <thomas@bibsyst.no>
    Re: running Perl and Linux from a boot-cd? (elephant)
        Using a timer on flock wgd@adelaide.on.net
    Re: using sendmail in .pl (Martien Verbruggen)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Thu, 29 Jul 1999 08:13:59 +0200
From: Kaare Rasmussen <kar@webline.dk>
Subject: Re: _Don't_ loose the connection
Message-Id: <379FF127.972284E@webline.dk>

> > The problem: I'm planning a program that is supposed to use a browser as
> > the client. This means it will run through a web server of course. It
> Take a look at www.fastcgi.com.  You can use the same process to handle
> multiple requests.  Works with Apache.  May be want you want.

Yes I've been thinking a bit more about it and come to the conclusion that the
best idea is to move the control into Apache. I'll snoop around and try to
figure out if it will be FastCGI, a new mod_perl module, or EmbPerl / Mason.

It would be great if I could do all I want in embedded Perl so I will check
these options out first.



  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 28 Jul 1999 23:32:16 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Beginner needs help with a function
Message-Id: <MPG.12099549b54e3e19989d6a@nntp.hpl.hp.com>

In article <aminn7.7bo.ln@magna.metronet.com> on Wed, 28 Jul 1999 
14:38:02 -0400, Tad McClellan <tadmc@metronet.com> says...
> Alec Kelingos (akelingos@petrosys-usa.com) wrote:
> : I need a function to trim the first/last characters off a string if and
> : only if these characters are a user defined character.
> 
> sub trimChr {
>    my($str, $char) = @_;
>    $char = quotemeta($char);
> 
>    $str =~ s/^$char//;
>    $str =~ s/$char$//;
> 
>    return $str;
> }

Bzzzzt!

Another part of the quoted post says "trim the string if inclosed by the 
specified character, otherwise leave it alone".

'Inclosed' => 'enclosed' => 'fenced' => one on each end. 

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


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

Date: Thu, 29 Jul 1999 00:29:44 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Beginner needs help with a function
Message-Id: <MPG.1209a2b17c66955989d6b@nntp.hpl.hp.com>

In article <379FC7F2.F8E84DA3@env.qld.gov.au> on Thu, 29 Jul 1999 
13:18:10 +1000, Tony Irvine <Tony.Irvine@env.qld.gov.au> says...
> John Imrie wrote:
> > One command method
> > $string =~ s/^c+(.*)c+$/$1/;
> > The Pilgrim
> 
> Better one command method
> $string =~ s/(?:^c+|c+$)//g;
> 
> It is still not as fast as the two step method but it is close.  I would
> still recommend using the two step because it is faster and clearer..
> but if you must use a single command... :)
> 
> Benchmark results for the interested.
> 
> Benchmark: timing 1000000 iterations of MyRegEx, OneRegEx, TwoRegEx...
>    MyRegEx: 10 wallclock secs ( 9.94 usr +  0.00 sys =  9.94 CPU)
>   OneRegEx: 18 wallclock secs (17.54 usr +  0.00 sys = 17.54 CPU)
>   TwoRegEx:  8 wallclock secs ( 8.11 usr +  0.00 sys =  8.11 CPU)

That's too bad, because of the three, only 'OneRegEx' comes close to 
solving the requested problem.

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


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

Date: Thu, 29 Jul 1999 08:39:46 GMT
From: astewart@spawar.navy.mil (Alan Stewart)
Subject: Re: Beginner-friendly group as cultural adaptation?
Message-Id: <37a01117.1689926846@news.pwy1.sdca.home.com>

On 28 Jul 1999 20:32:50 -0700, merlyn@stonehenge.com (Randal L.
Schwartz) wrote:

 . . .
>I don't believe anyone *I've* ever complained about in this newsgroup
>has even spent more than 15 minutes reading the existing group.
>
>I'm not sure what that does to your theory, but you'll have to help me
>understand that a newbie that has read enough to see the off-topic
>digressions has somehow managed to miss the every-three-day newbie FAQ
>as well as the personally mailed FAQ.
>
Perhaps not, and I probably shouldn't presume to speak for newbies. I
left my newbie-hood 30+ years ago.

My main point, which I will insist on, is that the digressions are
actually more of an annoyance to some of us than the newbie noise.
Their noise can be ignored quickly and totally, while digressions have
to be sifted through for the occasional nuggets. I wouldn't do it if
the nuggets weren't of sufficient value, but I hate to spend the high
time price. It's like looking for gold in cow pies.

I will now return to my usual quiet state, rather than add to this
particular pie.


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

Date: 29 Jul 1999 08:56:36 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Beginner-friendly group as cultural adaptation?
Message-Id: <7np504$ra$1@lublin.zrz.tu-berlin.de>

Alan Stewart <astewart@spawar.navy.mil> wrote in comp.lang.perl.misc:

[...]

>My main point, which I will insist on, is that the digressions are
>actually more of an annoyance to some of us than the newbie noise.
>Their noise can be ignored quickly and totally, while digressions have
>to be sifted through for the occasional nuggets. I wouldn't do it if
>the nuggets weren't of sufficient value, but I hate to spend the high
>time price. It's like looking for gold in cow pies.

You want an ideal world.  Usenet isn't.  If the regulars don't
discourage newbie noise it increases.  It's a balance, and few
unmoderated newsgroups do significantly better than clpm.  Many
do worse.  I don't particularly like it either, but there's no
choice.

Anno


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

Date: 29 Jul 1999 07:09:02 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Can anyone explain concepts of Perl Objects?
Message-Id: <7noume$c5c$1@lublin.zrz.tu-berlin.de>

M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote in comp.lang.perl.misc:
>Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>>
>>All true, but if the blessing was stuck onto the reference,
>>
>>$obj = bless \$a;
>>$whatsit = \$a;
>>
>>would leave me with an unblessed $whatsit.  So the difference is
>>of some semantic consequence.
>
>Your Perl is clearly broken if it leaves $whatsit unblessed.    I suggest
>you upgrade.
>
>Or perhaps you didn't test that before posting?    :-)
>
>
>Although bless() operates on a reference, the blessing is a property
>of the referent rather than the reference.    So Abigail's view of
>things is the correct one.

You have a few things backwards.  Check the thread.

Anno


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

Date: Thu, 29 Jul 1999 16:03:18 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Die process, Die!
Message-Id: <MPG.120a99a6a346088e989b9e@news-server>

Uri Guttman writes ..
>>>>>> "A" == Abigail  <abigail@delanet.com> writes:
>
>  A> JME (raceE@yahoo.com) wrote on MMCLVIII September MCMXCIII in
>  A> <URL:news:_QMn3.109$Ga2.8231@news.cwix.com>:
>  A> && 
>  A> && Any ideas why a script would hang after it seemingly completes?
>
>  A> Yeah, take a closer look at line 17.
>
>boy, a lot of people seem to make mistakes on that line. maybe they
>should make sure line 17 is always a comment or blank. sorta like hotels
>don't have a 13th floor in the us.

you're joking aren't you ? .. these types are still writing their 
copyright and licensing notices on line 17

-- 
 jason - remove all hyphens for email reply -


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

Date: 29 Jul 1999 01:34:20 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Getting Height and Width of GIF/JPEG in PERL?
Message-Id: <slrn7pvtec.eo5.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCLVIII September MCMXCIII in
<URL:news:x7aesgqba5.fsf@home.sysarch.com>:
`` >>>>> "A" == Abigail  <abigail@delanet.com> writes:
`` 
``   A> Oh yes, I do. Let me say it again: the evilness of Jim Clark and Mark
``   A> Andreessen far outweights the evilness of Bill Gates.
`` 
`` i appreciate your sentiments, but i don't agree. they may have ruined
`` the web, but uncle bill is trying to own the world and getting closer
`` eash second. i know who i would rather die a slow painful death.


Bill Gates has tried invading or ruining my environment. Billware runs
on other peoples computers. Not mine. Not *my* problem. Bill leaves me
alone.

The web however, was supposed to be a common source of information.
For all of us. And *that*'s be ruined. And that's something which hurts
me. And for which I hold Netscape partially responsible for.



Abigail
-- 
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 28 Jul 1999 23:19:43 -0700
From: "Lauren Smith" <laurens@bsquare.com>
Subject: Re: help running Perl Scripts in win95
Message-Id: <7norpm$34e$1@brokaw.wa.com>


David Cassell wrote in message <379FA0EC.3DF5A894@mail.cor.epa.gov>...
>Well then, try the PSI::ESP module, which occasionally works
>for me.
Thanks, that worked.  ;-)

Lauren




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

Date: Thu, 29 Jul 1999 08:52:53 GMT
From: SaraNOS@ixPAMquick.com (Sara London)
Subject: Re: Help! tied DB_RECNO ->put() fails with R_IAFTER
Message-Id: <37a00fae.15396153@nnrp1.farm.idt.net>

I'm using version 1.57 of DB_File.pm. I tried to follow your advice
re: installing the new version of BerkeleyDB, which I take is c code
version db-2.7.5 from sleepycat.com and perl module BerkeleyDB-0.06
from cpan, but they require that I recompile and install it, which I'm
not experienced with. I ran into trouble here because it wants to
install to /usr/local and /usr/local/lib, but I don't have write
access to those directories. 

I (believe I) followed the documentation for db-2.7.5 to compile it to
another directory and it passed all its tests, but the BerkeleyDB-0.06
perl module didn't have similar documentation and despite trying a
similar command (replacing 'make install' with 'make
prefix=/usr/home/mydir/Berkeley/BerkeleyDB-0.06 install') it didn't
work. I manually adjusted the prefix in the Makefile and it mostly
worked but said that some directory didn't exist. So I created the
directory, and it compiled and installed, but when I try to reference
the module it says "Can't locate loadable object for module BerkeleyDB
in @INC....".

This is so frustrating! This was my first time recompiling a unix
utility so I'm probably missing something along that line.

If anyone has insight into compiling this module into a non /usr/local
directory, or into the original problem where the DBFile that is
bundled with the recent Perl distribution fails on ->put($key, $value,
R_IAFTER), I would be very, very grateful.

Many thanks, Sara

On 28 Jul 1999 17:24:51 -0000, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:

>Sara London <SaraNOS@ixPAMquick.com> wrote in comp.lang.perl.misc:
>>Hi! I am trying to manipulate a  file opened via _tie_ with DB_RECNO.
>
>[symptoms snipped]
>
>Just an unqualified shot in the dark:  Which version of Berkeley DB are
>you using?  The newish 2.7.5 (available from www.sleepycat.com) has
>quite a few bug fixes.
>
>Anno

[original post:]
Hi! I am trying to manipulate a  file opened via _tie_ with DB_RECNO.

My ->get($key, $value) and ->put($key, $value) commands work fine, but
->put($key, $value, R_IAFTER) and ->put($key, $value, R_IBEFORE) do
not! A status value of -1 is returned and the insertion is not
successful.

->put()'s documentation says that it will behave differently with
R_IBEFORE or R_IAFTER by modifying $key to contain the inserted line's
number. I suspect this has something to do with the problem since
->put() works without the $flag parameter.

Any ideas? Here is a code excerpt:

 ...
my(@lines,$upto_line, $the_file, $the_status);
use Fcntl;                                     
use DB_File;

$the_file = tie(@lines, "DB_File", $the_path, O_RDRW | O_CREAT, 0640,
$DB_RECNO);
 ...
my $target_line = 9;
my $new_content = "This line to insert.";
$the_status = $the_file->put($target_line,$new_content,R_IAFTER);
print "response: $the_status, returned line: $target_line.";
 ...
untie(@lines);

************
When this code is executed, $the_status == -1 and $target_line is
still 9 and the file remains unchanged. (When I remove the R_IAFTER
the code executes and replaces the line.)

I will be grateful for any insight that you might have.

Thank you, 
Sara
SaraNOS@ixPAMquick.com


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

Date: Thu, 29 Jul 1999 08:02:39 +0100
From: campbell-lange@easynet.co.uk (Rory C-L)
Subject: Re: help: push array refs into hash, sort by refs in hash
Message-Id: <campbell-lange-2907990802390001@campbell-lange.easynet.co.uk>

In article <7nnhco$bfn$1@lublin.zrz.tu-berlin.de>,
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:

> It's not quite clear what you are trying to accomplish.  It
>*seems* that you want the arrays @rest to remain distinct, as opposed
>to a flattened list that contains all of them.  

Hi Anno

Thanks a lot for your input
I'd like to keep the two arrays related to the shared issue separate, so
that I can get output like this: (the example is theoretical though -
constructed because I'm having trouble understandin refs)

       
487/1998     
      4/12/98     A/LB/10/04/021    J 
636/1999     
      23/2/99     A/LB/10/00/229    D                        
780/1999     
      21/4/99     A/LB/10/00/249    C 
      14/1/99     A/LB/10/02/028    C                                
874/1999      
      1/6/99      A/LB/10/01/003    R  

presumably that means I need to push arrays into an array which is itself
the value of the hash.                        

>In that case, you
>don't even have to distinguish if a key has already been defined.
>Just push your array refs onto the value of a key,


>  push @{ $hash{ $issue}}, \@rest; # Just push, it'll spring into existence

Wonderful! I have been confusing myself trying to do this.
However I need to push the arrays into an anonymous array which is the
value of $hash{$issue}. How would I do that?

>  for my $aref ( @{ $hash{ $issue}} ) {
>    print "(@$aref)"; # Using $" here


@{$hash{issue} is a ref to the array which contains the arrays
so when accessing an array of array one by one go something like this...

   for may $aref ( @{$hash{$issue}} )
   {
      print "@$hash{issue}->[$aref]";
   }

>>A related sort question:
>>
>>I have a hash structured like this:
>>
>>   key   value (ref to anonymous array) 
>>    |      |
>>    x    (anonymous) array with refs to 1 .. n anonymous arrays
>>           |
>>         array array array
>>           |
>>         first element
>>         
>
>Videmus nunc per speculo in aenigmatem.  Or something.  You have lost
>me here, or rather, since I'm not sure I got your first question right,
>I'd rather not guess any further.  Care to give some feedback?

In my example above, I'd like to sort the hash values for a second set ouf
outputs by the drawing number name (such as A/LB/10/01/003). The drawing
number would be in an array of an array ref'd by the hash value. Is this
possible?

Thanks for all your help

Rory

-- 
--
Rory Campbell-Lange
The Campbell-Lange Workshop, London


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

Date: 29 Jul 1999 08:24:12 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: help: push array refs into hash, sort by refs in hash
Message-Id: <7np33c$pa$1@lublin.zrz.tu-berlin.de>

Rory C-L <campbell-lange@easynet.co.uk> wrote in comp.lang.perl.misc:
>In article <7nnhco$bfn$1@lublin.zrz.tu-berlin.de>,
>anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
>
>> It's not quite clear what you are trying to accomplish.  It
>>*seems* that you want the arrays @rest to remain distinct, as opposed
>>to a flattened list that contains all of them.  
>
>Hi Anno
>
>Thanks a lot for your input
>I'd like to keep the two arrays related to the shared issue separate, so
>that I can get output like this: (the example is theoretical though -
>constructed because I'm having trouble understandin refs)
>
>       
>487/1998     
>      4/12/98     A/LB/10/04/021    J 
>636/1999     
>      23/2/99     A/LB/10/00/229    D                        
>780/1999     
>      21/4/99     A/LB/10/00/249    C 
>      14/1/99     A/LB/10/02/028    C                                
>874/1999      
>      1/6/99      A/LB/10/01/003    R  
>
>presumably that means I need to push arrays into an array which is itself
>the value of the hash.                        

Yes, though strictly speaking "arrays" must be "array refs" in both
cases.  This is exactly what the push... below does.

>>In that case, you
>>don't even have to distinguish if a key has already been defined.
>>Just push your array refs onto the value of a key,
>
>
>>  push @{ $hash{ $issue}}, \@rest; # Just push, it'll spring into existence
>
>Wonderful! I have been confusing myself trying to do this.
>However I need to push the arrays into an anonymous array which is the
>value of $hash{$issue}. How would I do that?
>
>>  for my $aref ( @{ $hash{ $issue}} ) {
>>    print "(@$aref)"; # Using $" here
>
>
>@{$hash{issue} is a ref to the array which contains the arrays

Your braces don't balance.  Please be more careful in your typing.
The game of guessing what you mean is getting tiresome.

>so when accessing an array of array one by one go something like this...
>
>   for may $aref ( @{$hash{$issue}} )
>   {
>      print "@$hash{issue}->[$aref]";

This is gibberish.  You're accessing $hash{'issue'} (quotes added for
clarity).  That key doesn't exist.  Further, what goes into the [] above
must be an integer.  $aref, by name and by construction, is an array ref.
Have you run that code?  I thought not.

>   }
>
>>>A related sort question:
>>>
>>>I have a hash structured like this:
>>>
>>>   key   value (ref to anonymous array) 
>>>    |      |
>>>    x    (anonymous) array with refs to 1 .. n anonymous arrays
>>>           |
>>>         array array array
>>>           |
>>>         first element
>>>         
>>
>>Videmus nunc per speculo in aenigmatem.  Or something.  You have lost
>>me here, or rather, since I'm not sure I got your first question right,
>>I'd rather not guess any further.  Care to give some feedback?
>
>In my example above, I'd like to sort the hash values for a second set ouf
>outputs by the drawing number name (such as A/LB/10/01/003). The drawing

What second set of outputs?  You haven't yet defined the first set of
outputs.  What is a drawing number name?

>number would be in an array of an array ref'd by the hash value. Is this
>possible?

Is a drawing number the same as a drawing number name above?  Why do
the terms differ?  You want an array of *an* array?  Why bother to
put a single item into an array then?

>Thanks for all your help

Obviously you need help.  But you won't get it unless you state
clearly what you want to do.  Don't use Perl parlance if you don't
understand it clearly, it will only confuse your readers.  Use
the terms of your problem area, like "issue", "drawing", "drawing
number" etc. but *define* them, don't assume their meaning is
self-evident.

Anno


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

Date: Thu, 29 Jul 1999 16:10:51 +0800
From: HING <leech6@ie.cuhk.edu.hk>
Subject: how to open remote file from the server??
Message-Id: <Pine.GSO.4.10.9907291605440.8399-100000@iesun44>

Hi.
   I have this situation show below:
   I am writing a cgi file by using perl .
   the file is put in a web server(NT4.0).
   My question is how to write the code in order that the
server can open a file from my local harddisk??
   
   I downloaded some "upload module" from the internet..and they work in
unix server but not NT,, why??
   Any resource can be found about the perl in win NT??
   please help.

Vincent Lee




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

Date: Thu, 29 Jul 1999 06:08:30 GMT
From: ladlad@my-deja.com
Subject: Re: I need fast help
Message-Id: <7nor4r$32q$1@nnrp1.deja.com>

In article <7niqsc$mg1$1@news.online.de>,
  "Marko Cehaja" <thetaworld@magikomik.de> wrote:
> I have PWS and Perl installed. Perl and PWS works both well, instead
that
> Perl cannot write onto the file. Here is the sample program that
doesnt
> work. I need fast help for that, as this program doesnt create any
file, nor
> shows any error:
>
> #eval 'exec /usr/bin/perl -S -W -D $0 ${1+"$@"}'
> # if $running_under_some_shell;
>
> print"Testing screen output";
>
> open(MY,"FILETST");
> print MY "Testing file output\n";
> close (MY);
>
Use
open(MY,">FILETST");


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 29 Jul 1999 06:13:22 GMT
From: ladlad@my-deja.com
Subject: Re: I need fast help
Message-Id: <7nordv$3c7$1@nnrp1.deja.com>

In article <7niqsc$mg1$1@news.online.de>,
  "Marko Cehaja" <thetaworld@magikomik.de> wrote:
> I have PWS and Perl installed. Perl and PWS works both well, instead
that
> Perl cannot write onto the file. Here is the sample program that
doesnt
> work. I need fast help for that, as this program doesnt create any
file, nor
> shows any error:
>
> #eval 'exec /usr/bin/perl -S -W -D $0 ${1+"$@"}'
> # if $running_under_some_shell;
>
> print"Testing screen output";
>
> open(MY,"FILETST");
> print MY "Testing file output\n";
> close (MY);
>
Use
open(MY,">FILETST");


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 29 Jul 1999 06:48:46 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: I need fast help
Message-Id: <379ff914.1673786@news.uniplus.ch>

On Thu, 29 Jul 1999 06:08:30 GMT, ladlad@my-deja.com wrote:

>In article <7niqsc$mg1$1@news.online.de>,
>Use
>open(MY,">FILETST");
>

open(MY,">FILETST") or die("open FILETST: $!");
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Andreas


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

Date: Thu, 29 Jul 1999 07:06:28 GMT
From: catnip8@geocities.com (catnip)
Subject: Re: NEWSFLASH: Supremes rule anti-advert-ware illegal
Message-Id: <379ffcf5.50107528@news.nucleus.com>

On 28 Jul 1999 14:28:01 -0700, Tom Christiansen <tchrist@mox.perl.com>
wrote:

>							March 32, 2002
>
>Washington DC - After more than two years in and out of the courts,
>The Supreme Court today upheld the lower courts' ruling that the viewing
>of a website in any layout and format other than the one set-up by that
>site's authors was illegal.
>
>The original suit was brought by a cartel of powerful web businesses
>all over the country, initially sponsored by the Direct Marketers
>Association (DMA). Defendants included Junkbusters Inc, a mysterious
>Perl programmer named ``Abigail'', and thirty-four other businesses
>and individuals who had created software to let users by-pass blinking
>pictures, pop-ups advertisements, and intended controls on font, color,
>size, and backgrounds.
<snipped the rest of the hilarity>

Honey, I think you have *way* too much time on your hands! Get thee to
a Perl-a-Thon.

catnip


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

Date: Thu, 29 Jul 1999 09:59:42 +0100
From: Frank Quednau <quednauf@nortelnetworks.com>
Subject: Re: NEWSFLASH: Supremes rule anti-advert-ware illegal
Message-Id: <37A017FE.5430D9C2@nortelnetworks.com>

You always seemed so busy on the Perl Newsgroup! What happened? No
newbies that require enlightenment ? :)

Seriously, I enjoyed reading this a lot. It kind of summarises the
problems I have as a European with that amazing Sub-continent that is
the USA.


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

Date: Wed, 28 Jul 1999 21:24:32 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Perl 5.005_58 ... a bug.
Message-Id: <7npt8h$mpo1@news.cyber.net.pk>

perl -V is broken!

RedHat 6.0

--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
FAX: (815) 846-2877





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

Date: 29 Jul 1999 08:36:43 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: perl timeouts
Message-Id: <7np3qr$q2$1@lublin.zrz.tu-berlin.de>

Martin Grossman  <grossman@bbn.com> wrote in comp.lang.perl.misc:
>A program is timeing out and I don't know if its perl or the program....
>
>Here the part of the perl program that fails....
>
>$error .= "ERROR #1\r\n" unless open ( CMD, "$cmd | " );
>while ( <CMD>){

Perl doesn't time out unless you make it do so.  It's either the
program $cmd or the environment running perl (such as a web server).

Anno


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

Date: Thu, 29 Jul 1999 13:13:01 +0600 (KGST)
From: mlists@gizmo.kyrnet.kg (CyberPsychotic)
Subject: Regex global search/replace problem
Message-Id: <Pine.LNX.4.05.9907291307350.1166-100000@gizmo.kyrnet.kg>

hello people,
I am writing some sort of html preprocessorm and abit stuck with one
thing, so far I know the string:
$string =~ s/(.*)\/bl(\S+)(.*)/$1<blink>$2<\/blink>$3/gi

should replace all occurencies of /bl, with <blink>..</blink> stuff, but
in practice it replaces only first occurence of such string. Any ideas
what's wrong here?

PS: I solved this problem by appending while statement at the end:
$string =~ s/(.*)\/bl(\S+)(.*)/$1<blink>$2<\/blink>$3/gi
                                        while ($string =~/[^<]\/bl/);
but I believe there should be a more elegant solution.



--
fygrave@tigerteam.net		http://www.kalug.lug.net




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

Date: 29 Jul 1999 08:04:20 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Regex global search/replace problem
Message-Id: <slrn7q02oh.t89.sholden@pgrad.cs.usyd.edu.au>

On Thu, 29 Jul 1999 13:13:01 +0600 (KGST),
    CyberPsychotic <mlists@gizmo.kyrnet.kg> wrote:
>hello people,
>I am writing some sort of html preprocessorm and abit stuck with one
>thing, so far I know the string:
>$string =~ s/(.*)\/bl(\S+)(.*)/$1<blink>$2<\/blink>$3/gi
>
>should replace all occurencies of /bl, with <blink>..</blink> stuff, but
>in practice it replaces only first occurence of such string. Any ideas
>what's wrong here?

I think it replaces only the _last_ occurance...

 .* is greedy and so will match as much possible locally, as long
as the final regular expression matches globally.

Hence the first .* should match everything up until the last '/bl' and
the last .* will match the rest of the string. Hence the entire string has 
been used so only one match will be made (ignoring \n and . issues).

The following should work a little better :

$string =~ s|/bl(\S+)|<blink>$1</blink>|gi;

I also changed the / to | so as to avoid the '\/'s

Instead of copying the characters you want to ignore this regex ignores
them and simply says replace all occurances of /bl followed by some stuff,
which <blink>the same stuff</blink>.

There is no need to capture the beginning and put it back at the beginning
and the same with the end, that is done for you automatically.

-- 
Sam

Every human culture has good and bad points. Every computer program has
Eveone more bug. Even Perl.
	--Larry Wall


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

Date: Thu, 29 Jul 1999 10:07:39 +0200
From: Thomas Weholt <thomas@bibsyst.no>
Subject: running Perl and Linux from a boot-cd?
Message-Id: <37A00BCB.30F61415@bibsyst.no>

Hi,

I got a database I`d like other less fortunate people, actually people
running crap like windows98 and Windows Nt, to have the pleasure of
using. Because these people are scared of the OS called Linux they will
not dare to install it on their computer, but a boot-cd they might try
out. My idea was that if I could make a boot-image, using linux, with
all the stuff needed to run Perl, and Perl of-course, on it, the
database could be used by everybody. The main database would be burned
after the boot-part was created on the disc, so the cd-rom would appear
like a normal disc for ordinary use. No X-Windows, no extra bullshit. 

Has anybody any idea on how to do this? Is it possible? I would see it
as great oppertunity to distribute large databases ( large for me is
things that come on cd-roms.  I know this is small talking about real
databases, but hey - we gotta think of the little people sometimes too !
) on cd-roms, with no installation procedures etc. neccesary, - the os,
libs, mods and perl in one place. I don`t have the knowledge of Linux to
do this so, if anybody has pointers to how-tos or other docs related to
this, please let me know.

Uh .....

I need feedback. If this is a stupid/impossible/[insert word here] idea,
then tell me.

( Hm, I wonder what Uri will say .... )

So long,
Thomas Weholt


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

Date: Thu, 29 Jul 1999 18:50:28 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: running Perl and Linux from a boot-cd?
Message-Id: <MPG.120ac0dc23508206989b9f@news-server>

Thomas Weholt writes ..
>Has anybody any idea on how to do this?

the part of what you want to do that's actually relevant to this group is 
trivial .. ie. have perl available on a CD

your questions regarding the rest of this idea would be better directed 
to either a group on Linux or a group on CD burning

>I need feedback. If this is a stupid/impossible/[insert word here] idea,
>then tell me.

yes .. it sounds stupid .. perl is fairly compatible across different OSs 
- sounds like you're trying to jump in the air by moving the planet in 
the opposite direction

that having been said .. it's certainly possible to boot Linux from a CD 
- but it is machine configuration dependant

-- 
 jason - remove all hyphens for email reply -


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

Date: Thu, 29 Jul 1999 08:16:55 GMT
From: wgd@adelaide.on.net
Subject: Using a timer on flock
Message-Id: <7np2lj$8dc$1@nnrp1.deja.com>

Hi everyone,

I've been researching the file locking issue and I have a question
about setting up a timer to wait for a file to be unlocked.

I read at the "Perl + Perl/CGI Mini FAQ", operated by Bekman Stas that
you can use this sort of solution:

  $timeout=20;    # in seconds
  while (-e $lock_file && (stat($lock_file))[9]+$timeout>time)
  { sleep(1);}

However in Tom Christiansen's post, he says:

"Never use the existence of a file C<-e $file> as a locking indication,
because there is a race condition between the test for the existence of
the file and its creation."

So as a newbie, I ask how can you tell if a file is locked without
using the -e indicator?

Thanks in advance,

Alex.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 29 Jul 1999 06:17:09 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: using sendmail in .pl
Message-Id: <FlSn3.141$tY.11736@nsw.nnrp.telstra.net>

In article <7noq8l$33g$1@news.vossnet.de>,
	"Christian Hans" <Christian.Hans@s3ag.de> writes:

> I user a sendmail in a perl script, and it works well, but know I want to
> add a BCC recipient ... what is the syntax ?
> 
> print MAIL "BCC: name\@domain.com";

This is a question about sendmail, not about perl. You would have a
much better chance of getting this correctly answered in a group that
talks about sendmail, like maybe comp.mail.sendmail

It may be capitalisation, it may not be.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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


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