[29788] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1031 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 14 03:09:42 2007

Date: Wed, 14 Nov 2007 00:09:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 14 Nov 2007     Volume: 11 Number: 1031

Today's topics:
        Does a value exist in an array <no@spam.tonsjunkmail.com>
    Re: Does a value exist in an array <simon.chao@gmail.com>
    Re: Does a value exist in an array <jwcarlton@gmail.com>
    Re: Does a value exist in an array <jurgenex@hotmail.com>
    Re: Does a value exist in an array xhoster@gmail.com
    Re: Does a value exist in an array <wsmith60@cinci.rr.com>
    Re: Does a value exist in an array <peter@makholm.net>
    Re: error in tkGlue.c when building Tk <ben@morrow.me.uk>
        error in tkGlue.c when installing TK mariakvelasco@gmail.com
    Re: error in tkGlue.c when installing TK <1usa@llenroc.ude.invalid>
        File I/O overwrite array variables? <jamesrwagner@gmail.com>
        File I/O overwrite array variables? <jamesrwagner@gmail.com>
    Re: File I/O overwrite array variables? <peter@makholm.net>
        how to: create/use/modify shared variable in Perl 5.6.1 <nitte.sudhir@gmail.com>
        Matching substring <modhak@gmail.com>
    Re: Matching substring <m@rtij.nl.invlalid>
        new CPAN modules on Wed Nov 14 2007 (Randal Schwartz)
    Re: peculiar behaviour with prototyped routines <christian.hansel@cpi-service.com>
    Re: Remove slow debug prints with "ifdef" type of pre p <rvtol+news@isolution.nl>
    Re: replace string contaning \n  cieux87-fin@yahoo.com
    Re: replace string contaning \n  cieux87-fin@yahoo.com
    Re: Using fork() <ced@blv-sam-01.ca.boeing.com>
    Re: Why /(word){0}/ does not work? <rvtol+news@isolution.nl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 13 Nov 2007 20:05:09 -0600
From: "M" <no@spam.tonsjunkmail.com>
Subject: Does a value exist in an array
Message-Id: <13jkluce58mba02@corp.supernews.com>

I am pushing values to an array like so.

push @suspend_list, $account;

But before I push it to the array I would like to know if it exists already 
in the array and if so not push it.  From reading a few of my books I have 
tried this.

if ( ! (exists($suspend_list{$account}))) {

               push @suspend_list, $account;
       }

It does not work.  Any advice?

M




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

Date: Tue, 13 Nov 2007 18:40:51 -0800
From:  nolo contendere <simon.chao@gmail.com>
Subject: Re: Does a value exist in an array
Message-Id: <1195008051.528658.256760@19g2000hsx.googlegroups.com>

On Nov 13, 10:05 pm, "M" <n...@spam.tonsjunkmail.com> wrote:
> I am pushing values to an array like so.
>
> push @suspend_list, $account;
>
> But before I push it to the array I would like to know if it exists already
> in the array and if so not push it.  From reading a few of my books I have
> tried this.
>
> if ( ! (exists($suspend_list{$account}))) {
>
>                push @suspend_list, $account;
>        }
>
> It does not work.  Any advice?

sounds like you want a hash. Does order matter? If not, use a hash. If
so, you can still use a Tied Hash, although I've never had to use one,
so don't know the details, although I'm sure one of the regulars will
be happy to help you out with that. But anyway, the regular (non-tied
hash) example would be:

my %suspend_list;
for my $account ( @accounts ) {
    $suspend_list{$account}++;
}

 ...now you have all of the accounts as keys in the hash, and the
values for each key represents the number of times that key (account)
showed up. If you still want an array, you can simply:

my @suspends = keys %suspend_list;


HTH




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

Date: Tue, 13 Nov 2007 18:40:58 -0800
From:  Jason Carlton <jwcarlton@gmail.com>
Subject: Re: Does a value exist in an array
Message-Id: <1195008058.864060.37440@22g2000hsm.googlegroups.com>

On Nov 13, 9:05 pm, "M" <n...@spam.tonsjunkmail.com> wrote:
> I am pushing values to an array like so.
>
> push @suspend_list, $account;
>
> But before I push it to the array I would like to know if it exists already
> in the array and if so not push it.  From reading a few of my books I have
> tried this.
>
> if ( ! (exists($suspend_list{$account}))) {
>
>                push @suspend_list, $account;
>        }
>
> It does not work.  Any advice?
>
> M


I had a similar problem earlier today! You're mixing up the array with
a hash.

The immediate problem is that the (!(exists... statement is looking
for a hash value, while the push... statement is setting an array. But
there's a logic problem that can be resolved fairly easily that will
fix all of that.

Forget about pushing altogether, and just add $account to a hash
instead. Like:

$suspend_list{$account} = 1; # the 1 is just a boolean character

Then when you need it:

if (exists($suspend_list{$account})) {
  # do whatever you want if the value exists
}

For instance, if you were originally going to print each $account out
of the @suspend_list, like:

foreach $key (@suspend_list) { print "$key\n"; }

Then you can just do this now:

foreach $key (keys %suspend_list) { print "$key\n"; }

HTH,

Jason



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

Date: Wed, 14 Nov 2007 02:54:15 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Does a value exist in an array
Message-Id: <rrt_i.7297$NC.6444@trndny07>

M wrote:
> I am pushing values to an array like so.
>
> push @suspend_list, $account;
>
> But before I push it to the array I would like to know if it exists
> already in the array and if so not push it.

Your Question is Asked Frequently. Please see "perldoc -q contains":

    "How can I tell whether a list or array contains a certain element?"

> From reading a few of my
> books I have tried this.
>
> if ( ! (exists($suspend_list{$account}))) {

The array @suspend_list into which you are pushing the data has nothing to 
do with the hash %suspend_list that you are trying to examine here.

> It does not work.  Any advice?

See the FAQ.

jue 




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

Date: 14 Nov 2007 05:26:20 GMT
From: xhoster@gmail.com
Subject: Re: Does a value exist in an array
Message-Id: <20071114002624.455$Sn@newsreader.com>

"M" <no@spam.tonsjunkmail.com> wrote:
> I am pushing values to an array like so.
>
> push @suspend_list, $account;
>
> But before I push it to the array I would like to know if it exists
> already in the array and if so not push it.  From reading a few of my
> books I have tried this.
>
> if ( ! (exists($suspend_list{$account}))) {
>
>                push @suspend_list, $account;
>        }
>
> It does not work.  Any advice?

"Does not work" is an awful description.

You are using both a hash %suspend_list, and an array @suspend_list,
which happen to have the same name, apart from the sigil.  I occasionally
intentionally do this, if I need functionality that neither alone will
give me, but some people find it confusing.

But you never add to the hash, just the array, so the exists will always
be false.

if ( ! (exists($suspend_list{$account}))) {
               $suspend_list{$account}=undef;
               push @suspend_list, $account;
}

Of course if you don't need to keep the stuff in order too, then you can
use only a hash and get rid of the array altogether.

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: Wed, 14 Nov 2007 00:42:20 -0500
From: "Bill" <wsmith60@cinci.rr.com>
Subject: Re: Does a value exist in an array
Message-Id: <473a8ac3$0$2357$4c368faf@roadrunner.com>


"Jürgen Exner" <jurgenex@hotmail.com> wrote in message 
news:rrt_i.7297$NC.6444@trndny07...
>M wrote:
>> I am pushing values to an array like so.
>>
>> push @suspend_list, $account;
>>
>> But before I push it to the array I would like to know if it exists
>> already in the array and if so not push it.
>
> Your Question is Asked Frequently. Please see "perldoc -q contains":

"perldoc -q contain" on my system.

The module solution  List::Util wins hands down for maintainabity.
I find that this is usually more important than performance.

>
>    "How can I tell whether a list or array contains a certain element?"
>
>> From reading a few of my
>> books I have tried this.
>>
>> if ( ! (exists($suspend_list{$account}))) {
>
> The array @suspend_list into which you are pushing the data has nothing to 
> do with the hash %suspend_list that you are trying to examine here.
>
>> It does not work.  Any advice?
>
> See the FAQ.
>
> jue
> 




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

Date: Wed, 14 Nov 2007 06:27:12 +0000
From: Peter Makholm <peter@makholm.net>
Subject: Re: Does a value exist in an array
Message-Id: <87hcjp9wan.fsf@hacking.dk>

nolo contendere <simon.chao@gmail.com> writes:

> my %suspend_list;
> for my $account ( @accounts ) {
>     $suspend_list{$account}++;
> }
>
> ...now you have all of the accounts as keys in the hash, and the
> values for each key represents the number of times that key (account)
> showed up. If you still want an array, you can simply:

Note that this only works if $account is a simple value like a integer
or a string. If it is references or perl objects it stringifies the
value most often leaving you with a textual representation of the
address of the object. You can't get back to the original object from
this address.

If you need to store references you have to use something like Xho's
solution

//Makholm


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

Date: Tue, 13 Nov 2007 23:52:47 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: error in tkGlue.c when building Tk
Message-Id: <fvpp05-fb2.ln1@osiris.mauzo.dyndns.org>


Quoth mariakvelasco@gmail.com:
> 
> We are trying to install Tk-804.027_501 on Solaris 10 using Perl
> version 5.8.4. We were able to create the makefile through the command
> perl Makefile.PL; however, when running make, we are getting errors
> regarding the file tkGlue.c
> 
> tkGlue.c: In function `do_comp':
> tkGlue.c:5250: warning: passing arg 1 of `Perl_pregcomp' from
> incompatible pointer type
> tkGlue.c:5250: warning: passing arg 2 of `Perl_pregcomp' makes pointer
> from integer without a cast
> tkGlue.c:5250: too few arguments to function `Perl_pregcomp'

This is typically the result of an ithreads/no-ithreads mismatch. Do you
have some other version of perl whose headers are being picked up by
accident? Is your perl built for threads (or rather, for multiplicity;
check with perl -V:useithreads -V:usemultiplicity).

> tkGlue.c: In function `Tcl_GetRegExpFromObj':
> tkGlue.c:5319: `RXf_UTF8' undeclared (first use in this function)
> tkGlue.c:5319: (Each undeclared identifier is reported only once
> tkGlue.c:5319: for each function it appears in.)
> tkGlue.c:5319: `RXf_PMf_FOLD' undeclared (first use in this function)

RXf_* are new in bleadperl, they aren't present in any version of 5.8.
Do you have 5.9.* or perl-current installed anywhere? Does your
pTk/tkConfig.h contain the line

    #define HAS_PMOP_EXTRA_FLAGS 1

? What happens if you run

    perl -I. -MConfig -MTk::MMtry -e'
        $Tk::MMtry::VERBOSE = 1;
        try_compile("config/pmop.c", ["-I$Config{archlibexp}/CORE"])
            or die "try_compile failed: $?";'

(all on one line, of course)? What does perl -V:archlibexp print? Is
that correct (it should be the path to your arch-specific perl core lib
directory, something like /usr/lib/perl5/5.8.4/sun4-solaris)?

Ben



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

Date: 13 Nov 2007 15:35:24 -0800
From: mariakvelasco@gmail.com
Subject: error in tkGlue.c when installing TK
Message-Id: <1194993418.499313.48790@t8g2000prg.googlegroups.com>

Hello,

We are trying to install Tk-804.027_501 on Solaris 10 using Perl
version 5.8.4.  We were able to create the makefile through the
command perl Makefile.PL; however, when running make, we are getting
errors regarding the file tkGlue.c

tkGlue.c: In function `do_comp':
tkGlue.c:5250: warning: passing arg 1 of `Perl_pregcomp' from
incompatible pointer type
tkGlue.c:5250: warning: passing arg 2 of `Perl_pregcomp' makes pointer
from integer without a cast
tkGlue.c:5250: too few arguments to function `Perl_pregcomp'
tkGlue.c: In function `Tcl_GetRegExpFromObj':
tkGlue.c:5319: `RXf_UTF8' undeclared (first use in this function)
tkGlue.c:5319: (Each undeclared identifier is reported only once
tkGlue.c:5319: for each function it appears in.)
tkGlue.c:5319: `RXf_PMf_FOLD' undeclared (first use in this function)
*** Error code 1
make: Fatal error: Command failed for target `tkGlue.o'

Is there anyone on here that is familiar with these errors or does
anyone have any suggestions on how to get rid of these errors.  We
would really appreciate your help.

Thanks!



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

Date: Wed, 14 Nov 2007 00:26:05 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: error in tkGlue.c when installing TK
Message-Id: <Xns99E7C5AEBCD15asu1cornelledu@127.0.0.1>

mariakvelasco@gmail.com wrote in news:1194993418.499313.48790
@t8g2000prg.googlegroups.com:

> Hello,

On the UseNet, impatience is not your friend.

Sinan


-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>



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

Date: Wed, 14 Nov 2007 07:40:37 -0000
From:  "jamesrwagner@gmail.com" <jamesrwagner@gmail.com>
Subject: File I/O overwrite array variables?
Message-Id: <1195026037.642390.275340@q5g2000prf.googlegroups.com>

Hello:

I was basically finding that after a block of code, an array I had
called @localizations was still the same size, but each of the
variables was now being overwritten by an empty string. What I found
on closer inspection was that as I was reading in from the file with
handle INPUT, each line was in turn being stored in the current place
that it was on from the outer foreach loop, until upon termination
when the final line is only a newline storing a n empty string in that
place holder.

The code below


sub indexSequences {

    my $fold = shift;
    my $minSup = shift;

    my @localizations = ("cytoplasmic", "cytoplasmicmembrane",
"extracellular",
"outermembrane", "periplasmic");
    my %containsHash;

    foreach(@localizations) {
        my $localization = $_;
        open INPUT, "freseqs" . $_ . $fold . $minSup ;

        while(<INPUT>) {
            chomp;




         }

           foreach(@localizations) {
                     my $alocalization = $_;
                       print("This is the  $alocalization $_\n");
              }
    }


}



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

Date: Wed, 14 Nov 2007 07:42:15 -0000
From:  "jamesrwagner@gmail.com" <jamesrwagner@gmail.com>
Subject: File I/O overwrite array variables?
Message-Id: <1195026135.451898.287280@q5g2000prf.googlegroups.com>

Hello:

I was basically finding that after a block of code, an array I had
called @localizations was still the same size, but each of the
variables was now being overwritten by an empty string. What I found
on closer inspection was that as I was reading in from the file with
handle INPUT, each line was in turn being stored in the current place
that it was on from the outer foreach loop, until upon termination
when the final line is only a newline storing a n empty string in that
place holder.

The code below


sub indexSequences {

    my $fold = shift;
    my $minSup = shift;

    my @localizations = ("cytoplasmic", "cytoplasmicmembrane",
"extracellular",
"outermembrane", "periplasmic");
    my %containsHash;

    foreach(@localizations) {
        my $localization = $_;
        open INPUT, "freseqs" . $_ . $fold . $minSup ;

        while(<INPUT>) {
            chomp;




         }

           foreach(@localizations) {
                     my $alocalization = $_;
                       print("This is the  $alocalization $_\n");
              }
    }
}
Giving the following output:

This is the localization
This is the localization cytoplasmicmembrane
This is the localization extracellular
This is the localization outermembrane
This is the localization periplasmic
This is the localization
This is the localization
This is the localization extracellular
This is the localization outermembrane
This is the localization periplasmic
This is the localization
This is the localization
This is the localization
This is the localization outermembrane
This is the localization periplasmic
This is the localization
This is the localization
This is the localization
This is the localization
This is the localization periplasmic
This is the localization
This is the localization
This is the localization
This is the localization
This is the localization


Thus in turn the each element of the @localizations array is
overwritten with an empty string. When I comment out the file I/O
lines the problem goes away. (And the chomp makes no difference).

What can be going on the reading in from a file is overwriting
elements of an array?


Thanks very much.



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

Date: Wed, 14 Nov 2007 07:48:54 +0000
From: Peter Makholm <peter@makholm.net>
Subject: Re: File I/O overwrite array variables?
Message-Id: <87d4ud9sih.fsf@hacking.dk>

"jamesrwagner@gmail.com" <jamesrwagner@gmail.com> writes:

>     foreach(@localizations) {

Here you make $_ an alias to each element of @localizations

>         my $localization = $_;
>         open INPUT, "freseqs" . $_ . $fold . $minSup ;
>
>         while(<INPUT>) {

Here you modify $_ which, as we remember, is an alias into
@localizations. So it is quite expected that you in later iterationes
over @localizations sees these modified values. 

>             chomp;

>          }

//Makholm


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

Date: Wed, 14 Nov 2007 07:33:24 -0000
From:  kath <nitte.sudhir@gmail.com>
Subject: how to: create/use/modify shared variable in Perl 5.6.1
Message-Id: <1195025604.273464.58450@v23g2000prn.googlegroups.com>

Hello group,

Following is the workarround to implement multithread in Perl 5.6.1

1. i loop through a hash(for eg.) to check existence of the file
2. if the file does not exists
                        2.1 make an entry in SHARED variable
mentioning that a process has been spawned to create this perticular
file(eg. bangalore.xml)

                        2.2 spawn a process to create a file(for eg.
bangalore.xml)
                                        2.2.1 in the child process
create a file
                                        2.2.2 after creating file,
make a note in SHARED variable that child is exiting after creating a
file

         if file exists
                        close file-handle

NOTE: Parent should not wait for child to finish its job, because we
have more one file(location) to look up. And we cannot wait for the
one child creating bangalore.xml to finish, to spawn a child to create
sofia.xml file

Where im stuck?
        I don't know to use create and use shared variable in Perl  :
(

Can any one help me here pls.

here is the code.
#---- SBREnviron.pl -------
package SBREnviron;

%LOCATIONS = (
			'bangalore' => {
								'xml_file' => q(bangalore.xml)
				},
			'sofia' => {
								'xml_file' => q(sofia.xml)
				},

#-----------------

# -------- Fork.pl -------------
require 'SBREnviron.pl';

use FileHandle;

%process_track= ();
$foo=1000;
while($foo--){
	while(my ($k, $v) = each %SBREnviron::LOCATIONS){
		my $fh = new FileHandle;
		my $dbh;

		eval{
			print "\nPARENT($foo): open_file: trying to open
$SBREnviron::LOCATIONS{$k}->{'xml_file'} ";
			open ($fh, $SBREnviron::LOCATIONS{$k}->{'xml_file'}) or die"ERROR:
$!";
		};
		#if ($@ =~ /ERROR: file does not exists/){
		if ( ($@ =~ /ERROR:/)){
			print "\nPARENT($foo): file_exists: NO";
			print "\n\tPARENT($foo): checking for spawned process";

			if (not exists $process_track{$k}){
				print "\n\tPARENT: isSpawned: NO";
				#print "\n\tPARENT($foo): no process is spawned for $k, so im
going to spawn a child to create $SBREnviron::LOCATIONS{$k}-
>{'xml_file'} file.";

				# make a note that a process has spawn for this already
				$process_track{$k} = 1;
				print "\nPARENT: shared_var(so called): $process_track{$k}";
				my $pid;
				$pid = fork();
				if ($pid == 0){
					# child process
					print "\n\t---\n\tCHILD:im the child, and will create
$SBREnviron::LOCATIONS{$k}->{'xml_file'} file in a short while\t\t---
";
					sleep 15;
					# just a create a file
					my $fh = new FileHandle;
					open ($fh, ">$SBREnviron::LOCATIONS{$k}->{'xml_file'}");
					close($fh);

					# delete the entry from hash, representing the child process has
finished
					print "\n\t---\n\tCHILD: im deleting an entry $k\t\t---";
					delete $process_track{$k};
					print "\nPARENT: shared_var(so called): $process_track{$k}" if
(exists $proces_track{$k});
					#process will exit once it is finished.
					exit(0);
				} # end of child process
			}else{
				print "\n\tPARENT: isSpawned: YES";#print "\nPARENT($foo): a
process is already running for this $k";
				print "\nPARENT: shared_var(so called): $process_track{$k}";
				}
		} # end of if-file-doesnot-exists
		else{
			close($fh);
			print "\n PARENT($foo): $SBREnviron::LOCATIONS{$k}->{'xml_file'}
exists, so closing the filehandle"};
	} # end of loop through locations
	sleep(2);
	print "\n\n";
}# end of infinite loop


Thanks and regards,
kath.



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

Date: Tue, 13 Nov 2007 22:32:57 -0800
From:  m <modhak@gmail.com>
Subject: Matching substring
Message-Id: <1195021977.474909.192540@e34g2000pro.googlegroups.com>

Hi All

I have a string :

invokeEvent('5_290_act', true)" class="button">Add</button>

I need to get 5_290_act into a variable, can you please tell me how to
construct regular expression for this.

Thanks
M



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

Date: Wed, 14 Nov 2007 08:21:21 +0100
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: Matching substring
Message-Id: <pan.2007.11.14.07.17.31@rtij.nl.invlalid>

On Tue, 13 Nov 2007 22:32:57 -0800, m wrote:

> Hi All
> 
> I have a string :
> 
> invokeEvent('5_290_act', true)" class="button">Add</button>
> 
> I need to get 5_290_act into a variable, can you please tell me how to
> construct regular expression for this.
> 
> Thanks
> M

if (/invokeEvent\('(.*?)', true\)" class="button">Add</button>/) {
  $var = $1;
}

HTH,
M4


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

Date: Wed, 14 Nov 2007 05:42:16 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Nov 14 2007
Message-Id: <JrHEIG.p70@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

App-Addex-0.012
http://search.cpan.org/~rjbs/App-Addex-0.012/
generate mail tool configuration from an address book 
----
Astro-SIMBAD-Client-0.011
http://search.cpan.org/~wyant/Astro-SIMBAD-Client-0.011/
Fetch astronomical data from SIMBAD 4. 
----
Astro-satpass-0.014
http://search.cpan.org/~wyant/Astro-satpass-0.014/
----
Audio-MPD-0.18.2
http://search.cpan.org/~jquelin/Audio-MPD-0.18.2/
class to talk to MPD (Music Player Daemon) servers 
----
Authen-CAS-Client-0.02
http://search.cpan.org/~pravus/Authen-CAS-Client-0.02/
Provides an easy-to-use interface for authentication using JA-SIG's Central Authentication Service 
----
Business-Address-POBox-0.01
http://search.cpan.org/~marcel/Business-Address-POBox-0.01/
Check whether an address looks like a P.O.Box 
----
Business-Address-POBox-0.02
http://search.cpan.org/~marcel/Business-Address-POBox-0.02/
Check whether an address looks like a P.O.Box 
----
Business-KontoCheck-2.4
http://search.cpan.org/~michel/Business-KontoCheck-2.4/
Perl extension for checking German and Austrian Bank Account Numbers 
----
C-Scan-Constants-1.017
http://search.cpan.org/~icerider/C-Scan-Constants-1.017/
Slurp constants from specified C header (.h) files 
----
CGI-Application-URIMapping-0.01
http://search.cpan.org/~kazuho/CGI-Application-URIMapping-0.01/
A dispatcher and permalink builder 
----
CPANPLUS-Dist-Mdv-0.3.1
http://search.cpan.org/~jquelin/CPANPLUS-Dist-Mdv-0.3.1/
a cpanplus backend to build mandriva rpms 
----
CPANPLUS-Dist-Mdv-0.3.2
http://search.cpan.org/~jquelin/CPANPLUS-Dist-Mdv-0.3.2/
a cpanplus backend to build mandriva rpms 
----
CatalystX-CRUD-0.10
http://search.cpan.org/~karman/CatalystX-CRUD-0.10/
CRUD framework for Catalyst applications 
----
CatalystX-CRUD-Model-RDBO-0.06
http://search.cpan.org/~karman/CatalystX-CRUD-Model-RDBO-0.06/
Rose::DB::Object CRUD 
----
Class-Adapter-1.04
http://search.cpan.org/~adamk/Class-Adapter-1.04/
Perl implementation of the "Adapter" Design Pattern 
----
Class-Factory-Enhanced-0.06
http://search.cpan.org/~marcel/Class-Factory-Enhanced-0.06/
more functionality for Class::Factory 
----
Class-MOP-0.43
http://search.cpan.org/~groditi/Class-MOP-0.43/
A Meta Object Protocol for Perl 5 
----
Class-MOP-0.44
http://search.cpan.org/~groditi/Class-MOP-0.44/
A Meta Object Protocol for Perl 5 
----
Class-MOP-0.45
http://search.cpan.org/~groditi/Class-MOP-0.45/
A Meta Object Protocol for Perl 5 
----
Compress-LZF-2.0
http://search.cpan.org/~mlehmann/Compress-LZF-2.0/
extremely light-weight Lempel-Ziv-Free compression 
----
Config-Any-0.09_01
http://search.cpan.org/~bricas/Config-Any-0.09_01/
Load configuration from different file formats, transparently 
----
Config-Any-0.09_02
http://search.cpan.org/~bricas/Config-Any-0.09_02/
Load configuration from different file formats, transparently 
----
DBIx-Class-QueryLog-1.0.2
http://search.cpan.org/~gphat/DBIx-Class-QueryLog-1.0.2/
Log queries for later analysis. 
----
DBIx-DataModel-0.35
http://search.cpan.org/~dami/DBIx-DataModel-0.35/
Classes and UML-style Associations on top of DBI 
----
Daemon-Simple-0.02
http://search.cpan.org/~khs/Daemon-Simple-0.02/
Perl extension for making script as daemon with start|stop controlling 
----
Data-HexDump-XXD-0.1.0
http://search.cpan.org/~polettix/Data-HexDump-XXD-0.1.0/
format hexadecimal dumps and reverse like xxd 
----
Data-Timeline-0.01
http://search.cpan.org/~marcel/Data-Timeline-0.01/
Timelines 
----
Data-Timeline-IScrobbler-0.01
http://search.cpan.org/~marcel/Data-Timeline-IScrobbler-0.01/
Build a timeline from tracks recorded by iScrobbler 
----
Data-Timeline-SVK-0.01
http://search.cpan.org/~marcel/Data-Timeline-SVK-0.01/
Builds a timeline from an 'svk log' 
----
DateTimeX-Easy-0.081
http://search.cpan.org/~rkrimen/DateTimeX-Easy-0.081/
Parse a date/time string using the best method available 
----
Devel-Unplug-0.01
http://search.cpan.org/~andya/Devel-Unplug-0.01/
Simulate the non-availability of modules 
----
Devel-Unplug-0.02
http://search.cpan.org/~andya/Devel-Unplug-0.02/
Simulate the non-availability of modules 
----
Encode-JP-Mobile-0.06
http://search.cpan.org/~miyagawa/Encode-JP-Mobile-0.06/
Shift_JIS variants of Japanese Mobile phones 
----
Encode-JP-Mobile-0.07
http://search.cpan.org/~miyagawa/Encode-JP-Mobile-0.07/
Shift_JIS variants of Japanese Mobile phones 
----
Encode-JP-Mobile-0.08
http://search.cpan.org/~miyagawa/Encode-JP-Mobile-0.08/
Shift_JIS variants of Japanese Mobile phones 
----
Encode-JP-Mobile-0.09
http://search.cpan.org/~miyagawa/Encode-JP-Mobile-0.09/
Shift_JIS variants of Japanese Mobile phones 
----
Encode-JP-Mobile-0.10
http://search.cpan.org/~miyagawa/Encode-JP-Mobile-0.10/
Shift_JIS variants of Japanese Mobile phones 
----
Encode-JP-Mobile-0.11
http://search.cpan.org/~miyagawa/Encode-JP-Mobile-0.11/
Shift_JIS (CP932) variants of Japanese cellphone pictograms 
----
Event-Notify-0.00001
http://search.cpan.org/~dmaki/Event-Notify-0.00001/
Simple Observer/Notifier 
----
Event-Notify-0.00002
http://search.cpan.org/~dmaki/Event-Notify-0.00002/
Simple Observer/Notifier 
----
Event-Notify-0.00003
http://search.cpan.org/~dmaki/Event-Notify-0.00003/
Simple Observer/Notifier 
----
File-Find-Parallel-0.50
http://search.cpan.org/~andya/File-Find-Parallel-0.50/
Traverse a number of similar directories in parallel 
----
File-Rotate-Backup-0.11
http://search.cpan.org/~dowens/File-Rotate-Backup-0.11/
Make backups of multiple directories and rotate them on unix. 
----
File-Rotate-Backup-0.12
http://search.cpan.org/~dowens/File-Rotate-Backup-0.12/
Make backups of multiple directories and rotate them on unix. 
----
Font-TTF-0.42
http://search.cpan.org/~mhosken/Font-TTF-0.42/
Perl module for TrueType Font hacking 
----
Font-TTF-Scripts-0.9
http://search.cpan.org/~mhosken/Font-TTF-Scripts-0.9/
Smart font script supporting modules and scripts for TTF/OTF 
----
Fuse-PDF-0.01
http://search.cpan.org/~cdolan/Fuse-PDF-0.01/
Filesystem embedded in a PDF document 
----
Getopt-CallingName-1.18
http://search.cpan.org/~srshah/Getopt-CallingName-1.18/
Script duties delegation based upon calling name 
----
JSON-XS-1.53
http://search.cpan.org/~mlehmann/JSON-XS-1.53/
JSON serialising/deserialising, done correctly and fast 
----
Language-BF-0.03
http://search.cpan.org/~dankogai/Language-BF-0.03/
BF virtual machine in perl 
----
Lemonldap-Handlers-Generic-3.5.4
http://search.cpan.org/~egerman/Lemonldap-Handlers-Generic-3.5.4/
Perl extension for Lemonldap sso system 
----
Lingua-KO-DateTime-0.01
http://search.cpan.org/~aero/Lingua-KO-DateTime-0.01/
convert time to korean format. 
----
MDV-Distribconf-3.13
http://search.cpan.org/~nanardon/MDV-Distribconf-3.13/
Read and write config of a Mandriva Linux distribution tree 
----
Mail-IMAPClient-2.99_06
http://search.cpan.org/~markov/Mail-IMAPClient-2.99_06/
An IMAP Client API 
----
Mixin-ExtraFields-0.006
http://search.cpan.org/~rjbs/Mixin-ExtraFields-0.006/
add extra stashes of data to your objects 
----
MojoMojo-0.999008
http://search.cpan.org/~mramberg/MojoMojo-0.999008/
A Catalyst & DBIx::Class powered Wiki. 
----
Moose-0.27
http://search.cpan.org/~groditi/Moose-0.27/
A complete modern object system for Perl 5 
----
Moose-0.28
http://search.cpan.org/~groditi/Moose-0.28/
A complete modern object system for Perl 5 
----
Moose-0.29
http://search.cpan.org/~groditi/Moose-0.29/
A complete modern object system for Perl 5 
----
Net-Backpack-1.13
http://search.cpan.org/~davecross/Net-Backpack-1.13/
Perl extension for interfacing with Backpack 
----
Net-IPMessenger-0.07
http://search.cpan.org/~masanorih/Net-IPMessenger-0.07/
Interface to the IP Messenger Protocol 
----
Net-POP3-SSLWrapper-0.01
http://search.cpan.org/~tokuhirom/Net-POP3-SSLWrapper-0.01/
simple POP3S wrapper for Net::POP3 
----
Net-Twitter-Diff-0.03
http://search.cpan.org/~tomyhero/Net-Twitter-Diff-0.03/
Twitter Diff 
----
POE-Component-CPAN-YACSmoke-1.09
http://search.cpan.org/~bingos/POE-Component-CPAN-YACSmoke-1.09/
Bringing the power of POE to CPAN smoke testing. 
----
Parse-Eyapp-1.086
http://search.cpan.org/~casiano/Parse-Eyapp-1.086/
Extensions for Parse::Yapp 
----
Parse-Marpa-0.001_041
http://search.cpan.org/~jkegl/Parse-Marpa-0.001_041/
Jay Earley's general parsing algorithm with LR(0) precomputation 
----
Pod-Generated-0.02
http://search.cpan.org/~marcel/Pod-Generated-0.02/
generate POD documentation during 'make' time 
----
RDF-Query-1.500
http://search.cpan.org/~gwilliams/RDF-Query-1.500/
An RDF query implementation of SPARQL/RDQL in Perl for use with RDF::Redland and RDF::Core. 
----
RHP-Timer-0.1
http://search.cpan.org/~phred/RHP-Timer-0.1/
A high resolution timer abstraction 
----
Rose-DB-0.736
http://search.cpan.org/~jsiracusa/Rose-DB-0.736/
A DBI wrapper and abstraction layer. 
----
Rose-DBx-Garden-0.04
http://search.cpan.org/~karman/Rose-DBx-Garden-0.04/
bootstrap Rose::DB::Object and Rose::HTML::Form classes 
----
Rose-DBx-Garden-Catalyst-0.02
http://search.cpan.org/~karman/Rose-DBx-Garden-Catalyst-0.02/
plant Roses in your Catalyst garden 
----
SMS-Send-0.05
http://search.cpan.org/~adamk/SMS-Send-0.05/
Driver-based API for sending SMS messages 
----
SMS-Send-AU-MyVodafone-0.03
http://search.cpan.org/~adamk/SMS-Send-AU-MyVodafone-0.03/
An SMS::Send driver for the myvodafone.com.au website 
----
Sys-Syslog-0.23
http://search.cpan.org/~saper/Sys-Syslog-0.23/
Perl interface to the UNIX syslog(3) calls 
----
TRL-MT_Plate-0.111
http://search.cpan.org/~cjones/TRL-MT_Plate-0.111/
A Perl module for creating and manipulating micro-titre plate objects 
----
TRL-Microarray-0.241
http://search.cpan.org/~cjones/TRL-Microarray-0.241/
A Perl module for creating and manipulating microarray objects 
----
Task-1.02
http://search.cpan.org/~adamk/Task-1.02/
The successor to Bundle:: for installing sets of modules 
----
Task-Business-AU-0.02
http://search.cpan.org/~adamk/Task-Business-AU-0.02/
A Task module for Australian Businesses 
----
Task-CVSMonitor-0.006004
http://search.cpan.org/~adamk/Task-CVSMonitor-0.006004/
Install all the CPAN modules needed by CVS Monitor 0.6.3 
----
Task-RecycleTrash-1.01
http://search.cpan.org/~adamk/Task-RecycleTrash-1.01/
Check/install the dependencies for File::Remove::trash 
----
Task-Weaken-1.02
http://search.cpan.org/~adamk/Task-Weaken-1.02/
Ensure that a platform has weaken support 
----
Test-DBIC-0.01001
http://search.cpan.org/~kolibrie/Test-DBIC-0.01001/
Facilitates Automated Testing for DBIx::Class 
----
Test-DBIC-0.01002
http://search.cpan.org/~kolibrie/Test-DBIC-0.01002/
Facilitates Automated Testing for DBIx::Class 
----
Test-Depends-0.06
http://search.cpan.org/~samv/Test-Depends-0.06/
Gracefully skip tests if missing modules 
----
Test-Group-0.08
http://search.cpan.org/~domq/Test-Group-0.08/
Group together related tests in a test suite 
----
Test-HTTP-Server-Simple-0.06
http://search.cpan.org/~jesse/Test-HTTP-Server-Simple-0.06/
Test::More functions for HTTP::Server::Simple 
----
Test-Harness-3.01
http://search.cpan.org/~andya/Test-Harness-3.01/
Run Perl standard test scripts with statistics 
----
Text-Pipe-0.02
http://search.cpan.org/~marcel/Text-Pipe-0.02/
Common text filter API 
----
Time-Elapsed-0.21
http://search.cpan.org/~burak/Time-Elapsed-0.21/
Displays the elapsed time as a human readable string. 
----
WWW-Myspace-0.73
http://search.cpan.org/~grantg/WWW-Myspace-0.73/
Access MySpace.com profile information from Perl 
----
WWW-Velib-0.05
http://search.cpan.org/~dland/WWW-Velib-0.05/
Download account information from the Velib website 
----
WebService-Backlog-0.01_04
http://search.cpan.org/~yamamoto/WebService-Backlog-0.01_04/
Perl interface to Backlog. 
----
Win32-0.33
http://search.cpan.org/~jdb/Win32-0.33/
Interfaces to some Win32 API Functions 
----
Win32-API-0.47
http://search.cpan.org/~cosimo/Win32-API-0.47/
Perl Win32 API Import Facility 
----
XML-Twig-3.32
http://search.cpan.org/~mirod/XML-Twig-3.32/
A perl module for processing huge XML documents in tree mode. 
----
cPanel-SyncUtil-v0.0.3
http://search.cpan.org/~dmuey/cPanel-SyncUtil-v0.0.3/
Perl extension for creating utilities that work with cpanelsync aware directories 
----
httpd_ctl-1.06
http://search.cpan.org/~srshah/httpd_ctl-1.06/
An apache httpd control script that supports Template Toolkit pre-processing 
----
o2sms-3.27
http://search.cpan.org/~mackers/o2sms-3.27/
A module to send SMS messages using the website of O2 Ireland 
----
vars-global-0.0.2
http://search.cpan.org/~polettix/vars-global-0.0.2/
try to make global variables a little safer 


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Tue, 13 Nov 2007 23:36:23 -0800
From:  "cvh@LE" <christian.hansel@cpi-service.com>
Subject: Re: peculiar behaviour with prototyped routines
Message-Id: <1195025783.684152.106630@19g2000hsx.googlegroups.com>

Hi Steffen,

Thanks for the very interesting link - a very enlightening read
indeed.

The recommendation with arrays is clear... I just needed an example.

What remains unclear, however, is your remark

> "Make sure that that definition is seen by the compiler before it
> compiles any calls to the function."

Now my question is how exactly am I supposed to that? How can I
prototype a function,
even before it is actually parsed by the compiler? Should I state 'C-
like-header-files' containing
only prototypes ?

CVH



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

Date: Wed, 14 Nov 2007 01:23:48 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Remove slow debug prints with "ifdef" type of pre processor pragma.
Message-Id: <fhdiuf.1d4.1@news.isolution.nl>

Tad McClellan schreef:
> kebabklubben.emp:

>> Is there a way to remove slow debug prints with some kind of "ifdef"
>> type of pre processor pragma?
>
> No, but you can use constants, and let them be optimized away
> by the compiler.
>
>    use constant DEBUG => 0;
> 
>    if ( DEBUG ) {
>       # code here is optimized away
>    }

 ... and the surrounding if(){} structure as well. 

perl -MO=Deparse -e'
    use constant THE_END => 0;
    if (THE_END and my $s = "Goodbye World") {
        print "$s\n"
    }
'
use constant ('THE_END', 0);
'???';

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

Date: Tue, 13 Nov 2007 23:57:49 -0800
From:  cieux87-fin@yahoo.com
Subject: Re: replace string contaning \n
Message-Id: <1195027069.233748.235440@50g2000hsm.googlegroups.com>

On 13 nov, 11:13, sheinr...@my-deja.com wrote:
> On Nov 13, 10:46 am, cieux87-...@yahoo.com wrote:
>
> > hello.
>
> >  I try to change the string \nE by # E without success.
>
> >  $line=~ s/(\n\E/#E/g;
>
> > Thank you in advance for your assistance.
>
> Is it the string constant '\nE' that you'd like to replace or do you
> want to replace all line breaks by '#' which are being followed by
> 'E'?
> And what does the '(' in your regex stand for?
>
> In the first case
>   $line=~ s/\\nE/#E/g;
>
> in the 2nd case
>   $line=~ s/\nE/#E/g;
>
> Cheers,
> Steffen

Hello

Here a solution.

#  replace all \n by space
sub chg_file {
   # Open file to modify for reading
   open(INPUTF,$ARGV[0]);

   while(<INPUTF>) {
        if (m/^E /) {
                print OUTFILE "\n" unless $lin < 2;
        }
        print OUTFILE " " unless m/^E /;
        chop $_;
        print OUTFILE $_;
        $lin++;
   }
   print OUTFILE "\n";
   close(OUTFILE);
   close(INPUTF);
}



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

Date: Tue, 13 Nov 2007 23:59:19 -0800
From:  cieux87-fin@yahoo.com
Subject: Re: replace string contaning \n
Message-Id: <1195027159.994916.193350@57g2000hsv.googlegroups.com>

On 13 nov, 12:59, Tad McClellan <ta...@seesig.invalid> wrote:
> cieux87-...@yahoo.com <cieux87-...@yahoo.com> wrote:
> >  I try to change the string \nE by # E without success.
>
> >  $line=~ s/(\n\E/#E/g;
>
> That does not even compile.
>
> Two pieces of information are needed to evaluate the behavior
> of a pattern match, the pattern and the string that it is
> trying to match against.
>
> We need to see the contents of $line.
>
> Your choice of variable name implies that the answer is
> given in the Perl FAQ:
>
>    perldoc -q match
>
>       I'm having trouble matching over more than one line.  What's wrong?
>
> --
> Tad McClellan
> email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"

hello

Here a solution.

#  replace all \n by space
sub chg_file {
   # Open file to modify for reading
   open(INPUTF,$ARGV[0]);

   while(<INPUTF>) {
        if (m/^E /) {
                print OUTFILE "\n" unless $lin < 2;
        }
        print OUTFILE " " unless m/^E /;
        chop $_;
        print OUTFILE $_;
        $lin++;
   }
   print OUTFILE "\n";
   close(OUTFILE);
   close(INPUTF);
}



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

Date: Tue, 13 Nov 2007 21:22:22 -0800
From:  "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Using fork()
Message-Id: <1195017742.602390.28870@e34g2000pro.googlegroups.com>

On Nov 13, 8:15 am, Q <qal...@gmail.com> wrote:
> I'm trying to use fork and have the processes interact with each
> other... Is this possible?  Something like:
>
> my $pid = fork();
> my $gotit = 0;
>
> if ($pid) {
>    while (1) {
>       if $gotit = 0 {
>         <do a thing>
>         $gotit = 1;
>       }
>    }} else {
>
>    while (1) {
>       my $input = <STDIN>;
>       print $input;
>       $gotit = 0; #when I get input, I want to set gotit back to 0 so
> the parent starts again.
>    }
>
>

Here's a possible solution with the child sending
a SIGUSR1 signal to the parent. (I'm not sure how you intend the child
or the parent to exit their loops though.  Exercise for the reader.
perldoc perlipc for other possibilities )

--
Charles DeRykus


my $pid = fork();
die "fork failed: $!" unless defined $pid;

my $gotit = 1;

if ($pid) {   # parent
   local $SIG{'USR1'} = sub { $gotit = 0; };
   while (1) {
      if ( $gotit == 0 ) {
        print "I GOT IT\n";
        $gotit = 1;
      }
      sleep 2;
   }
   waitpid $pid, 0;

} else {     #child
   my $parent = getppid();
   while (1) {
      my $input = <STDIN>;
      print $input,"\n";
      kill 'USR1', $parent
         or die "can't signal $parent";
   }
}





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

Date: Wed, 14 Nov 2007 00:40:05 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Why /(word){0}/ does not work?
Message-Id: <fhdggj.uo.1@news.isolution.nl>

Randal L. Schwartz schreef:
> chacallot:

> chacallot> So I tried /(\/temp){0}/ but it doesnt work (every
> filesystem is chacallot> monitored /temp included).
>
> Indeed.   The string "a" matches /a{0}/, because "a" has a match for
> zero instances of 'a', which is the same as the empty string, which
> every string has.
>
> Why would you expect it to do something different?

I actually like chacallot's train of thought. He/She wants the number of
(possible) matches to be 0.

0 * 0 = 0, so why is a beggar happy if there are zero days on which he
received zero Euros?


chacallot, did you try this?   !/^\/temp\//

If your software only allows unnegated Perl /regexen/:

  /^(?!=\/temp\/)/

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

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


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