[29603] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 847 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 13 18:09:41 2007

Date: Thu, 13 Sep 2007 15:09:08 -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, 13 Sep 2007     Volume: 11 Number: 847

Today's topics:
    Re: (?{ code }) block works fine in child rule but not  <clint.olsen@gmail.com>
    Re: Accessing Hash keys alphabetically <bik.mido@tiscalinet.it>
    Re: Challenge: CPU-optimized byte-wise or-equals (for a <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: Challenge: CPU-optimized byte-wise or-equals (for a xhoster@gmail.com
    Re: Challenge: CPU-optimized byte-wise or-equals (for a <azazel@azazel.net>
    Re: Challenge: CPU-optimized byte-wise or-equals (for a <bik.mido@tiscalinet.it>
    Re: Challenge: CPU-optimized byte-wise or-equals (for a <5502109103600001@t-online.de>
        New to Perl - strange behaviour with backticks <venner@gmail.com>
    Re: New to Perl - strange behaviour with backticks <noreply@gunnar.cc>
    Re: New to Perl - strange behaviour with backticks xhoster@gmail.com
        parallel computing in perl? <jiehuang001@gmail.com>
    Re: parallel computing in perl? <glex_no-spam@qwest-spam-no.invalid>
    Re: parallel computing in perl? <peter@makholm.net>
    Re: parallel computing in perl? <jiehuang001@gmail.com>
    Re: parallel computing in perl? <peter@makholm.net>
    Re: parallel computing in perl? <bik.mido@tiscalinet.it>
    Re: passing variable to sub - $_='SendMessage' <steven.stone4@btopenworld.com>
        QEPWORWRJRJ <Unbekannt.Beispiel@googlemail.com>
    Re: removing users from /etc/group <joe@inwap.com>
    Re: Running Perl script in the backend from Html <noreply@gunnar.cc>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 13 Sep 2007 13:09:18 -0500
From: Clint Olsen <clint.olsen@gmail.com>
Subject: Re: (?{ code }) block works fine in child rule but not in parent
Message-Id: <slrnfeiv6e.5mi.clint.olsen@belle.0lsen.net>

On 2007-09-13, Bart Lateur <bart.lateur@pandora.be> wrote:
> Except it's dead slow.

It's probably dead slow because it lacks the ability to specify a separate
lexer, and unless you try to emulate the flex or re2c model of
scanning/buffering, it's going to suck.  Lexing, not parsing, is the most
expensive part of the whole process, because the lexing phase must examine
every character of the input and classify it.

I've written one really big language translator in Perl, and I was able to
get very acceptable performance using Parse::Yapp and a hand-written lexer
using buffered read() calls (faster than $/ = undef).  The hand-written
lexer part is the sore spot of the whole story since you cannot coordinate
pattern matching with buffer refills along the way.  If you could somehow
force a buffer refill automatically when an EOB condition was detected, you
could very easily write high performance scanners in Perl.

I think better tools on this front would help Perl immensely, because Perl
in itself has far superior RE facilities to lex/flex/re2c, and the builtin
data structures and string manipulation facilities make it an excellent
proving ground for language recognizers and translators.

-Clint


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

Date: Thu, 13 Sep 2007 23:06:53 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Accessing Hash keys alphabetically
Message-Id: <td9je31otk5akgrv5bltl5570l96639b3f@4ax.com>

On Thu, 13 Sep 2007 08:16:14 -0700, Paul Lalli <mritty@gmail.com>
wrote:

>> Well, it is and maybe it isn't, but just to play the devil's
>> advocate. (Don't know if the English idiom is correct.)
>
>It is.  You speak English better than about 75% of the native-speakers
>here.  No worries. :-P

Thank you for your kind words. Yet, I occasionally have problems with
idiomatic forms, and in doubt I ask... you know, just to be sure and
*learn*.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Thu, 13 Sep 2007 11:12:42 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <r5bor4xoj8.ln2@goaway.wombat.san-francisco.ca.us>

On 2007-09-13, Michele Dondi <bik.mido@tiscalinet.it> wrote:
>
> I'm going to keep it open until 24 hours have passed from the initial
> posting of this node. If no-one gets any faster, both moritz and avar
> have a meter of beer from me.

Beer is measured in volume, not length.  The OP (at PM) should really be
offering a cubic meter of beer, and moritz and avar should demand such.

--keith

-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information



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

Date: 13 Sep 2007 18:46:55 GMT
From: xhoster@gmail.com
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <20070913144657.883$ig@newsreader.com>

xhoster@gmail.com wrote:
> Michele Dondi <bik.mido@tiscalinet.it> wrote:
> >
> > Update: It looks like there is a 2-way tie between avar and moritz. I
> > went ahead and wrote an in-place version of moritz's code. Thanks to
> > SuicideJunkie for fixing my stupidity in the test data. The script now
> > looks like:
> >
> >   #!/usr/bin/perl
> >
> >   use 5.6.0;
> >
> >   use strict;
> >   use warnings FATAL => 'all';
> >
> >   #use Test::More no_plan => 1;
> >   use Benchmark qw( cmpthese );
> >
> >   my $s1 = do_rand(0, 100_000);
> >   my $s2 = do_rand(1, 100_000);
> >   my $expected = split1( \$s1, \$s2 );
>
> Because split1 modifies $s1 in place, $s1 is equal to $expected
> even before your tests start.  Therefore, a no-op routine would still
> satisfy your "is" assertions (were they not commented out).  Once I fix
> that, moritz seems to start giving the wrong answers.

The problem with moritz is that it compares index(...) to >0, rather than
either >-1 or >=0, for success, so it fails when the first char is \000.  I
fixed that, and changed to 4-argument substr.

For my own effort, I perhaps cheated by using Inline C, and depending on
the C representations of both strings being null terminated.

          Rate  split1 substr1   avar2  moritz moritz2    foo2
split1  5.35/s      --    -82%   -100%   -100%   -100%   -100%
substr1 30.3/s    467%      --    -97%    -98%    -99%   -100%
avar2   1160/s  21595%   3725%      --    -39%    -44%    -86%
moritz  1907/s  35576%   6190%     64%      --     -8%    -77%
moritz2 2080/s  38806%   6759%     79%      9%      --    -75%
foo2    8318/s 155488%  27330%    617%    336%    300%      --




use Inline C=> 'DATA';
 ...
__DATA__
__C__
void foo2 (unsigned char * s1, unsigned char * s2) {
  while ( *s2 != NULL ) {
    while ( *s1 != NULL ) {
      s1++; s2++;
    };
    *s1=*s2;
  };
};

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


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

Date: Thu, 13 Sep 2007 14:47:54 -0500
From: Azazel <azazel@azazel.net>
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <slrnfej4v4.i60.azazel@kadath.azazel.net>

On 2007-09-13, Josef Moellers <5502109103600001@t-online.de> wrote:
> Keith Keller wrote:
>> On 2007-09-13, Michele Dondi <bik.mido@tiscalinet.it> wrote:
>>> I'm going to keep it open until 24 hours have passed from the initial
>>> posting of this node. If no-one gets any faster, both moritz and avar
>>> have a meter of beer from me.
>>
>> Beer is measured in volume, not length.  The OP (at PM) should really be
>> offering a cubic meter of beer, and moritz and avar should demand such.
>
> It certainly depends on where you live: "a meter of beer" is quit common
> in some areas here in Germany: just place glasses next to each other for
> a length of 1 meter! There is even a competition: two drinkers start at
> each end and whoever reaches the middle first, wins.

And of course there is always the yard of ale:

  http://en.wikipedia.org/wiki/Yard_(beer)

Az.


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

Date: Thu, 13 Sep 2007 23:02:39 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <ri8je3t355us9d8tbc37rdue2e6knqvbpu@4ax.com>

On 13 Sep 2007 11:39:28 -0400, Charlton Wilbur
<cwilbur@chromatico.net> wrote:

>If Perlmonks is lacking in competent and knowledgeable posters, then
>perhaps it's time to reexamine their choice of interfaces.  And if

Well, of course if I see that many people agree with you and Abigail,
then I will stop doing so. Not that I do it *routinely* nor that I've
done that so many times...

However PM is *not* lacking in competent and knowledgeable posters, in
fact did the OP in this particular example receive quite a lot of
*sensible* answers.

Yet the problem seemed interesting enough to be shared: that it was
posted there is somewhat of circumstance. If I had stumbled in it by
randomly browsing the web and still found it interesting, then I would
have posted it here as well.

>they're not so lacking, reposting Perlmonks threads here and clpm
>threads there serves only to annoy.

Well it may be and may not be. I copied there the content of a thread
posted here some months ago (with proper attributions) and at
<http://perlmonks.org/?node_id=638535> you can read:

: ++ for bringing that here, so I read it :-)
: 
: I didn't know about @CARP_NOT, so I learned something new today. 

Also, Uri Guttman and xhoster took a shoot at the actual problem, so
they must have found it interesting.

Honestly, I don't want to bother anyone. Do you think that
occasionally posting here interesting stuff from PM with a suitable
tag in the Subject for you and others to easily filter it out would be
so bad?


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Thu, 13 Sep 2007 21:21:53 +0200
From: Josef Moellers <5502109103600001@t-online.de>
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <fcc2ki$vdn$01$1@news.t-online.com>

Keith Keller wrote:
> On 2007-09-13, Michele Dondi <bik.mido@tiscalinet.it> wrote:
>> I'm going to keep it open until 24 hours have passed from the initial
>> posting of this node. If no-one gets any faster, both moritz and avar
>> have a meter of beer from me.
> 
> Beer is measured in volume, not length.  The OP (at PM) should really be
> offering a cubic meter of beer, and moritz and avar should demand such.

It certainly depends on where you live: "a meter of beer" is quit common 
in some areas here in Germany: just place glasses next to each other for 
a length of 1 meter! There is even a competition: two drinkers start at 
each end and whoever reaches the middle first, wins.

Josef
-- 
Mails please to josef dot moellers
and I'm on gmx dot de.


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

Date: Thu, 13 Sep 2007 21:08:47 -0000
From:  Eric <venner@gmail.com>
Subject: New to Perl - strange behaviour with backticks
Message-Id: <1189717727.118224.229120@k79g2000hse.googlegroups.com>

I am trying to set up a CGI script that will run two other scripts and
then write a short message back to the webpage.  I have this mostly
working, except for one strange issue: after using backticks to read
the stdout from the first script, stdout from the second script is
being printed to the page as if it were printed from the CGI script
that acts as the caller.  The behaviour disappears if I comment out
the backticks, but then I can't get the information i need from the
stdout of the first script.  The code follows:

#!/usr/bin/perl
use CGI;

print "Content-type: text/html\n\n";
my $query = new CGI;
my $pdbCode = $query->param("pdbcode");
my $scriptPath = "~/Sites/etaserver/bin";
my $rankPath = "~/Documents/Templates/Distance\ Matcher/Data/2006/
Data";
my $pdbPath = "~/Documents/Templates/Distance\ Matcher/Data/
2006/2006pdb90\ ET/$pdbCode";
my $pymolPath = "/sw/lib/pymol-py24/bin/pymol";

my $extractMotifArgs = "perl -I$scriptPath \"$scriptPath/
extractmotif.pl\" \"$pdbPath/$pdbCode.clusters\" \"$pdbPath/
$pdbCode.dssp\" \"$pdbPath/$pdbCode.pdb\" \"$pdbPath/$p
my $motifs = `$extractMotifArgs`;
#my $motifs="1,2,3,4";

if($pdbCode =~ /^\d\w{3}\w?$/ && -e $pdbPath) {
  $pdbPath =~ s/\\//g;
  my $args = ("$pymolPath -cr $scriptPath/createPyMolImage.py --
$pdbCode \"$pdbPath\" $motifs");
  system($args);
  if (($? >> 8) == 0) {
    print "CreatedImage:".$pdbCode;
  } else {
    print "Error:Unable to Create image";
  }
} else {
  print "Error:Unable to find PDB Data\n";
}

This is Perl 5.8.6.

Thank you,
Eric



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

Date: Thu, 13 Sep 2007 23:46:34 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: New to Perl - strange behaviour with backticks
Message-Id: <5ktpe9F5fgnuU1@mid.individual.net>

Eric wrote:
> I am trying to set up a CGI script that will run two other scripts and
> then write a short message back to the webpage.  I have this mostly
> working, except for one strange issue: after using backticks to read
> the stdout from the first script, stdout from the second script is
> being printed to the page as if it were printed from the CGI script
> that acts as the caller.  The behaviour disappears if I comment out
> the backticks, but then I can't get the information i need from the
> stdout of the first script.

Assuming that

     system($args);

executes the second script you are talking about, what if you call also 
that script using backticks (in void context):

     qx($args);

<code snipped>

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: 13 Sep 2007 22:02:01 GMT
From: xhoster@gmail.com
Subject: Re: New to Perl - strange behaviour with backticks
Message-Id: <20070913180204.241$UF@newsreader.com>

Eric <venner@gmail.com> wrote:
> I am trying to set up a CGI script that will run two other scripts and
> then write a short message back to the webpage.  I have this mostly
> working, except for one strange issue: after using backticks to read
> the stdout from the first script, stdout from the second script is
> being printed to the page as if it were printed from the CGI script
> that acts as the caller.

The second time you invoke an external command, you do it with
"system".  That is the way system works--it writes its output to the
stdout it inherits from Perl.

> The behaviour disappears if I comment out
> the backticks,

That seems unlikely.  Perhaps when you comment out the backticks, the
system($args) no longer produces any output at all because it is not
passed anything interesting as its argument.


> #!/usr/bin/perl
> use CGI;
>
> print "Content-type: text/html\n\n";
> my $query = new CGI;
> my $pdbCode = $query->param("pdbcode");
> my $scriptPath = "~/Sites/etaserver/bin";
> my $rankPath = "~/Documents/Templates/Distance\ Matcher/Data/2006/
> Data";
> my $pdbPath = "~/Documents/Templates/Distance\ Matcher/Data/
> 2006/2006pdb90\ ET/$pdbCode";
> my $pymolPath = "/sw/lib/pymol-py24/bin/pymol";
>
> my $extractMotifArgs = "perl -I$scriptPath \"$scriptPath/
> extractmotif.pl\" \"$pdbPath/$pdbCode.clusters\" \"$pdbPath/
> $pdbCode.dssp\" \"$pdbPath/$pdbCode.pdb\" \"$pdbPath/$p
> my $motifs = `$extractMotifArgs`;
> #my $motifs="1,2,3,4";

Both for purposes of posting here, and for purposes of your own debugging,
you should probably replace the external commands with calls to
simple commonly available system utilities, like echo or cat.  That will
help you isolate the problem to the perl-specific part versus the
external part, and help us help you because we would be able to test
your code ourselves.

my $motifs=`echo 1,2,3,4`;


Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


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

Date: Thu, 13 Sep 2007 13:04:12 -0700
From:  Jie <jiehuang001@gmail.com>
Subject: parallel computing in perl?
Message-Id: <1189713852.795153.273230@r34g2000hsd.googlegroups.com>

Hi,

I have to randomly select a sample set and run it 1,000 times. The
following code that i am using now works fine, except it is taking
long time.
fore (1..1000) {
  ##get the random sample set and then run a command
}

Now I am thinking to split this program into 10 processes to reduce
the processing time. Of course, I can just change the first line to
"for (1..100)" and run this same program in 10 different locations.
but that is really tedi$$ous, and I believe there is a better way to
accomplish it so that a big job can be split into multiple small jobs.
Since I am repeatedly running a random sample set, there would be no
need to worry where each proces ends and another process begins.

Your insight is appreciated!!

jie



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

Date: Thu, 13 Sep 2007 15:14:35 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: parallel computing in perl?
Message-Id: <46e99a2b$0$10306$815e3792@news.qwest.net>

Jie wrote:
> Hi,
> 
> I have to randomly select a sample set and run it 1,000 times. The
> following code that i am using now works fine, except it is taking
> long time.
> fore (1..1000) {
Are we golfing? :-)
>   ##get the random sample set and then run a command
> }
> 
> Now I am thinking to split this program into 10 processes to reduce
> the processing time. Of course, I can just change the first line to
> "for (1..100)" and run this same program in 10 different locations.
> but that is really tedi$$ous, and I believe there is a better way to
> accomplish it so that a big job can be split into multiple small jobs.
> Since I am repeatedly running a random sample set, there would be no
> need to worry where each proces ends and another process begins.
> 
> Your insight is appreciated!!

Check CPAN for: Parallel::ForkManager


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

Date: Thu, 13 Sep 2007 20:33:38 +0000
From: Peter Makholm <peter@makholm.net>
Subject: Re: parallel computing in perl?
Message-Id: <87ejh2qp99.fsf@hacking.dk>

Jie <jiehuang001@gmail.com> writes:

> fore (1..1000) {
>   ##get the random sample set and then run a command
> }
>
> Now I am thinking to split this program into 10 processes to reduce
> the processing time. Of course, I can just change the first line to
> "for (1..100)" and run this same program in 10 different locations.

You might want to look at Parallel::ForkManager. You code would look
like something along the way of 

use Parallel::ForkManager;
my $pm = new Parallel::ForkManager 10;

for $data (1 .. 1000) {
    my $pid = $pm->start and next;

    ## get the random sample and process it

    $pm->finish;
}

$pm->wait_all_children;

//Makholm


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

Date: Thu, 13 Sep 2007 13:39:51 -0700
From:  Jie <jiehuang001@gmail.com>
Subject: Re: parallel computing in perl?
Message-Id: <1189715991.349418.192870@22g2000hsm.googlegroups.com>


however, the problem for parallel computing is a potential file
sharing and overwritten.
for example, previously my code will generate a temporary file and the
next loop will overwrite it with a new generated file. There is no
problem because the overwriting happens after each process is
finished. now when I open 10 parallel processing for example, will
those 10 temporary files or 10 temporary hashs/arrays/variables get
messed up????

thanks!

jie


On Sep 13, 4:33 pm, Peter Makholm <pe...@makholm.net> wrote:
> Jie <jiehuang...@gmail.com> writes:
> > fore (1..1000) {
> >   ##get the random sample set and then run a command
> > }
>
> > Now I am thinking to split this program into 10 processes to reduce
> > the processing time. Of course, I can just change the first line to
> > "for (1..100)" and run this same program in 10 different locations.
>
> You might want to look at Parallel::ForkManager. You code would look
> like something along the way of
>
> use Parallel::ForkManager;
> my $pm = new Parallel::ForkManager 10;
>
> for $data (1 .. 1000) {
>     my $pid = $pm->start and next;
>
>     ## get the random sample and process it
>
>     $pm->finish;
>
> }
>
> $pm->wait_all_children;
>
> //Makholm




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

Date: Thu, 13 Sep 2007 21:06:20 +0000
From: Peter Makholm <peter@makholm.net>
Subject: Re: parallel computing in perl?
Message-Id: <87abrqqnqr.fsf@hacking.dk>

Jie <jiehuang001@gmail.com> writes:

> however, the problem for parallel computing is a potential file
> sharing and overwritten.
> for example, previously my code will generate a temporary file and the
> next loop will overwrite it with a new generated file.

Use File::Temp when dealing with temporary files. Then each loop
should overwrite eaqch other, not even when running in parallel.

> There is no problem because the overwriting happens after each
> process is finished. now when I open 10 parallel processing for
> example, will those 10 temporary files or 10 temporary
> hashs/arrays/variables get messed up????

Then perl variables isn't shared between fork'ed processes.

//Makholm


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

Date: Thu, 13 Sep 2007 23:08:17 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: parallel computing in perl?
Message-Id: <3l9je31kb5ou02q4mso57ausocofa5l3ml@4ax.com>

On Thu, 13 Sep 2007 13:04:12 -0700, Jie <jiehuang001@gmail.com> wrote:

>I have to randomly select a sample set and run it 1,000 times. The
>following code that i am using now works fine, except it is taking
>long time.
>fore (1..1000) {
>  ##get the random sample set and then run a command
>}
>
>Now I am thinking to split this program into 10 processes to reduce
>the processing time. Of course, I can just change the first line to
>"for (1..100)" and run this same program in 10 different locations.
>but that is really tedi$$ous, and I believe there is a better way to
>accomplish it so that a big job can be split into multiple small jobs.
>Since I am repeatedly running a random sample set, there would be no
>need to worry where each proces ends and another process begins.

Given the specs,

  perldoc -f fork
  perldoc perlipc


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Thu, 13 Sep 2007 12:28:17 -0700
From:  steve <steven.stone4@btopenworld.com>
Subject: Re: passing variable to sub - $_='SendMessage'
Message-Id: <1189711697.123586.26680@w3g2000hsg.googlegroups.com>

On Sep 13, 12:52 am, Ben Morrow <b...@morrow.me.uk> wrote:
> [please trim quotations when replying]
>
> Quoth steve <steven.sto...@btopenworld.com>:
>
>
>
> > think I got all your points except the ->Append / join one, dont see
> > how it can be used to replace the 3 appends
> > case 3 {
> >    $win->RxTextfield->Append("action 3\r\n");
> >    chomp($actions[1]);
> >    $win->RxTextfield->Append("$actions[1]\r\n");
> >    open my $ACTION, '<', $actions[1] or die "cant open '$actions[1]' :
> > $!";
> >    while (my $line = <$ACTION> ) {
> >       $win->RxTextfield->Append("$line\r\n");
> >    }
>
> This 'while' loop will call ->Append multiple times (once for each line
> in the file). The replacement I posted avoids that. The two previous
> calls to ->Append are still needed, of course.
>
> Ben

Ah, got you.
but thats what I intended, but I now also see what your suggesting

cheers

steve



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

Date: Thu, 13 Sep 2007 11:23:01 -0700
From:  Iwan <Unbekannt.Beispiel@googlemail.com>
Subject: QEPWORWRJRJ
Message-Id: <1189707781.538134.246120@g4g2000hsf.googlegroups.com>

http://www.martin-stosch-superstar.wg.am/



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

Date: Thu, 13 Sep 2007 13:01:13 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: removing users from /etc/group
Message-Id: <TeadndtoqbubCnTbnZ2dnUVZ_tLinZ2d@comcast.com>

heylow wrote:

> I wanted to remove users (a, b, x, y, z) who do not exist in
> master.login from the /etc/group, so that i can get clean group file.

That's so easy.

    next if not defined $valid_logins{$username};


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

Date: Thu, 13 Sep 2007 23:00:30 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Running Perl script in the backend from Html
Message-Id: <5ktmntF5f03gU1@mid.individual.net>

satish2112@gmail.com wrote:
> following is my Html code:
> 
> <form name="form100" method="post" action="script.pl">
> <textarea cols = "160" rows="12" name="TextArea1" > </textarea>
> <input align = "left" name="UpdateButton" type= "submit"
> value="Update" >
> 
> in the above code, if i click on submit button, a webpage is opened
> and the script in script.pl is executed.
> 
> is there any way such that another web-page is not opened and the
> script is run in the backend?
> 
> Please help me!!

I tried...

http://groups.google.com/group/comp.lang.perl.misc/msg/7ef1507bf9b74338

Why do you ignore the reply you got so far??

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 847
**************************************


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