[28427] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9791 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 2 18:05:51 2006

Date: Mon, 2 Oct 2006 15:05:07 -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           Mon, 2 Oct 2006     Volume: 10 Number: 9791

Today's topics:
    Re: case insensitive hash lookup (Chris Mattern)
    Re: FAQ 4.68 How can I make the Perl equivalent of a C  <jgibson@mail.arc.nasa.gov>
        get rid of ^M <>
    Re: get rid of ^M <jgibson@mail.arc.nasa.gov>
    Re: get rid of ^M beartiger@gmail.com
    Re: get rid of ^M (reading news)
    Re: How to make 2 dimensinal aray in Perl $mat(x,y)? <noreply@invalid.net>
        Inline C and different platforms vladimir.giron@gmail.com
    Re: Inline C and different platforms <wahab@chemie.uni-halle.de>
    Re: list vs. array <robb@acm.org>
    Re: Modifying a one-liner <tzz@lifelogs.com>
    Re: Modifying a one-liner beartiger@gmail.com
    Re: MySql - push a hash into an array (reading news)
    Re: newbie syntax question -> and => <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: newbie syntax question -> and => <David.Squire@no.spam.from.here.au>
        Perl Async .10 <toddenglish@gmail.com>
    Re: Perl Async .10 <toddenglish@gmail.com>
    Re: Problem running "cvs commit -m" inside a Perl scrip (reading news)
        XML::Parser Installation error: XML-Parser-2.34 <seanatpurdue@hotmail.com>
        XML::Parser Installation error: XML-Parser-2.34 <seanatpurdue@hotmail.com>
    Re: XML::Parser Installation error: XML-Parser-2.34 <jgibson@mail.arc.nasa.gov>
    Re: XML::Parser Installation error: XML-Parser-2.34 <seanatpurdue@hotmail.com>
    Re: XML::Parser Installation error: XML-Parser-2.34 <jgibson@mail.arc.nasa.gov>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 02 Oct 2006 21:25:48 -0000
From: syscjm@sumire.eng.sun.com (Chris Mattern)
Subject: Re: case insensitive hash lookup
Message-Id: <12i30usar1qoe27@corp.supernews.com>

In article <1159799723.336736.129560@i3g2000cwc.googlegroups.com>, Jack wrote:
>Hello,
>
>I noticed the hash lookup code below doesnt allow for case insensitive
>nor pattern match lookups.. I want to essentially be able to do the
>same as this (notice the "i"):
>if ($temp2  =~ m/Abdomen/i) {  print " case insensitive pattern matched
>!  "; }
>with my hash lookup:
>if (exists $hash{$temparray2[$sourcefield]}) {  print " exact match
>found only "  }
>
>Does anyone know how to accomplish this.
>
>Thank you,
>
>Jack
>

Change the string to all upper case before using it with
your hash.

-- 
             Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


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

Date: Mon, 02 Oct 2006 13:19:47 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: FAQ 4.68 How can I make the Perl equivalent of a C structure/C++ class/hash or array of hashes or arrays?
Message-Id: <021020061319477946%jgibson@mail.arc.nasa.gov>

In article <79f7v3-9f2.ln1@blue.stonehenge.com>, PerlFAQ Server
<brian@stonehenge.com> wrote:

> This is an excerpt from the latest version perlfaq4.pod, which
> comes with the standard Perl distribution. These postings aim to 
> reduce the number of repeated questions as well as allow the community
> to review and update the answers. The latest version of the complete
> perlfaq is at http://faq.perl.org .
> 
> --------------------------------------------------------------------
> 
> 4.68: How can I make the Perl equivalent of a C structure/C++ class/hash or
> array of hashes or arrays?
> 
>     Usually a hash ref, perhaps like this:
> 
>             $record = {
>                     NAME   => "Jason",
>                     EMPNO  => 132,
>                     TITLE  => "deputy peon",
>                     AGE    => 23,
>                     SALARY => 37_000,
>                     PALS   => [ "Norbert", "Rhys", "Phineas"],
>             };
> 
>     References are documented in perlref and the upcoming perlreftut.
>     Examples of complex data structures are given in perldsc and perllol.
>     Examples of structures and object-oriented classes are in perltoot.

"upcoming perlreftut"? It is alive and well in my Perl (5.8.6).

Would there be any value in mentioning the Class::Struct module here? I
have not used it and do not have an opinion. My uninformed opinion is
that it is "training wheels" for those coming to Perl from C or C++,
but there could be more value than that to the module.


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

Date: Mon, 02 Oct 2006 12:17:50 -0700
From: hmchkus <>
Subject: get rid of ^M
Message-Id: <gto2i2l9q192i1oisk967479r72732gifs@4ax.com>

Hi,

Perl script running  on windows, print statement  generates text file 

File copied to Sun Solaris box and vi sees "^M".

How to get rid of the "^M" in my perl script?

I know I can run "dos2unix" command in Solaris, but can I settle this
in windows before I copy over the file? No need to open the file in
windows.   Thanks!


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

Date: Mon, 02 Oct 2006 14:04:46 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: get rid of ^M
Message-Id: <021020061404469905%jgibson@mail.arc.nasa.gov>

In article <gto2i2l9q192i1oisk967479r72732gifs@4ax.com>, hmchkus wrote:

> Hi,
> 
> Perl script running  on windows, print statement  generates text file 
> 
> File copied to Sun Solaris box and vi sees "^M".
> 
> How to get rid of the "^M" in my perl script?
> 
> I know I can run "dos2unix" command in Solaris, but can I settle this
> in windows before I copy over the file? No need to open the file in
> windows.   Thanks!

Not sure, but you might try the binmode command on the newly-opened
file handle.


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

Date: 2 Oct 2006 14:35:49 -0700
From: beartiger@gmail.com
Subject: Re: get rid of ^M
Message-Id: <1159824949.319339.60090@b28g2000cwb.googlegroups.com>

hmchkus wrote:
> Hi,
>
> Perl script running  on windows, print statement  generates text file
>
> File copied to Sun Solaris box and vi sees "^M".
>
> How to get rid of the "^M" in my perl script?
>
> I know I can run "dos2unix" command in Solaris, but can I settle this
> in windows before I copy over the file? No need to open the file in
> windows.   Thanks!

You can do a substitution like:

     s/\r\n/\n/;

over all lines.


HTH,
John



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

Date: Mon, 02 Oct 2006 21:38:23 GMT
From: "Mumia W. (reading news)" <paduille.4058.mumia.w@earthlink.net>
Subject: Re: get rid of ^M
Message-Id: <jFfUg.5981$o71.1217@newsread3.news.pas.earthlink.net>

On 10/02/2006 02:17 PM, hmchkus wrote:
> Hi,
> 
> Perl script running  on windows, print statement  generates text file 
> 
> File copied to Sun Solaris box and vi sees "^M".
> 
> How to get rid of the "^M" in my perl script?
> 
> I know I can run "dos2unix" command in Solaris, but can I settle this
> in windows before I copy over the file? No need to open the file in
> windows.   Thanks!

perldoc PerlIO


-- 
Posting Guidelines for comp.lang.perl.misc:
http://www.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

Date: Mon, 02 Oct 2006 19:22:45 GMT
From: Ala Qumsieh <noreply@invalid.net>
Subject: Re: How to make 2 dimensinal aray in Perl $mat(x,y)?
Message-Id: <9GdUg.7774$GR.5057@newssvr29.news.prodigy.net>

anno4000@radom.zrz.tu-berlin.de wrote:

> tim <traggatt@gmail.com> wrote in comp.lang.perl.misc:
>> Joza wrote:
> 
> [top posting corrected, please don't do that]
> 
>> > How to make 2 dimensinal aray in Perl $mat(x,y)?
>> > 
>> > Thanks
> 
>> Hello
>> 
>> The syntax is like so:
>> 
>> $mat[x][y]
> 
> That's not Perl, unless x and y are predefined functions, constants
> for example.  Also, your syntax is already a simplification.  

Yes, but besides the fact that x and y should have been $x and $y, his
syntax was correct.

> The correct syntax is
> 
>     $mat[ $x]->[ $y]

Perl allows you to drop the arrow between indices, so this is not any more
correct than the $mat[$x][$y] syntax.

> Strictly speaking, even that is a simplification.  The basic syntax is
> 
>     ${ $mat[ $x] }[ $y]

Now, you are just showing off. I don't see what advantage pointing this out
has, except intimidating the OP and confusing him/her even more with
unnecessary information.

--Ala




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

Date: 2 Oct 2006 11:50:07 -0700
From: vladimir.giron@gmail.com
Subject: Inline C and different platforms
Message-Id: <1159815006.998609.4140@h48g2000cwc.googlegroups.com>

Hi


I'm working with Perl and I use the Compress Zlib library in the code..
the compress zlib module doesn't come with all of perl releases, you
have to download it.. when finished I want to put my program online so
anybody can download it and use it no matter what release of perl
they're using without downloading extra modules and because of this I
considered Inline C but searching more about this on the Internet I
found this:

"Inline C works on all of the Perl platforms that I have tested it with
so far. This includes all common Unixes and recent versions of
Microsoft Windows. The only catch is that you must have the same
compiler and make utility that was used to build your perl binary."

This means that if I make this program with inline C the enduser must
have the same compiler and make utility I used to be able to run it,
right?

Is there any other way I can make one single file? The problem is that
the Zlib uses and XS file (C code) and I would have to translate to
Perl things like

gzopen_(path, mode)
	char *	path
	char *	mode
	CODE:
	gzFile	gz ;
	gz = gzopen(path, mode) ;
	if (gz) {
	    ZMALLOC(RETVAL, gzType) ;
    	    RETVAL->buffer = newSV(SIZE) ;
    	    SvPOK_only(RETVAL->buffer) ;
    	    SvCUR_set(RETVAL->buffer, 0) ;
	    RETVAL->offset = 0 ;
	    RETVAL->gz = gz ;
	    RETVAL->closed = FALSE ;
	    SetGzErrorNo(0) ;
	}
	else {
	    RETVAL = NULL ;
	    SetGzErrorNo(errno ? Z_ERRNO : Z_MEM_ERROR) ;
	}
	OUTPUT:
	  RETVAL



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

Date: Mon, 02 Oct 2006 23:41:48 +0200
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: Inline C and different platforms
Message-Id: <efs1bu$ipf$1@mlucom4.urz.uni-halle.de>

Thus spoke vladimir.giron@gmail.com (on 2006-10-02 20:50):
> I'm working with Perl and I use the Compress Zlib library in the code..
> the compress zlib module doesn't come with all of perl releases, you
> have to download it.. 

What means: "you have to download it"?

I din't have the slightest problems to pull
Compress::Zlib by standard install (cpan script)
under Linux/5.8.7, 5.8.8, FreeBSD/5.8.8 and
even under Win32 (Activestate repo has it iirc).

You have to have the compiler installed, but
you need this thing also properly set up when
the user calls your Inline-based module.

Imho, the Inline-C solution is much more painful
than using a CPAN module that is even excellent
maintained.

There's also a 'pure Perl' Zlib Module(!) -

 http://search.cpan.org/CPAN/authors/id/N/NW/NWCLARK/Compress-Zlib-Perl-0.02.tar.gz

which you can place in your Package Directory
(at the huge cost of - of course - speed).

> when finished I want to put my program online so
> anybody can download it and use it no matter what release of perl
> they're using without downloading extra modules and because of this I
> considered Inline C but searching more about this on the Internet I
> found this:

Why wouldn't you trust the CPAN Compress::Zlib and let
the users figure how to install that?

> "Inline C works on all of the Perl platforms that I have tested it with
> so far. This includes all common Unixes and recent versions of
> Microsoft Windows. The only catch is that you must have the same
> compiler and make utility that was used to build your perl binary."

No, I don't think this is the point, rather they
have to bear a call signature which can be under-
stood. The Microsoft-Windows compilers usually
produce the same object format (may be wrong here).

> This means that if I make this program with inline C the enduser must
> have the same compiler and make utility I used to be able to run it,
> right?

IMHO no.

> Is there any other way I can make one single file? The problem is that
> the Zlib uses and XS file (C code) and I would have to translate to
> Perl things like
> 
> gzopen_(path, mode)
> 	char *	path

I assume Paul Marquess did exactly the same thing
with his Compress::Zlib as you plan to try to do
here.

I could think of this to be a real good examination
of the procedure for you, but CPAN philosophy
appeals to you to trust it's resources ;-)

Regards

M.


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

Date: 2 Oct 2006 14:14:17 -0700
From: "robb@acm.org" <robb@acm.org>
Subject: Re: list vs. array
Message-Id: <1159823657.265738.136370@k70g2000cwa.googlegroups.com>

Michele Dondi wrote:
> On 27 Sep 2006 18:17:11 -0700, "robb@acm.org" <robb@acm.org> wrote:
> >
> >I seem to remember this, and so long ago I adopted a coding style of
> >only passing scalars - actual scalars and refs - in my functions.
>
> Quite limitative and inefficiency-prone. But if you're feeling fine
> with it...

For sure, it's good maintenance-efficiency-wise.  In what ways would it
be ineffiicient?



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

Date: Mon, 02 Oct 2006 15:06:55 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Modifying a one-liner
Message-Id: <g69sli65ygg.fsf@CN1374059D0130.kendall.corp.akamai.com>

On  2 Oct 2006, beartiger@gmail.com wrote:

Ted Zlatanov wrote: 
> On 1 Oct 2006, beartiger@gmail.com wrote: >
>>> Then why do *you* spell it PERL here?
>>>
>>> http://cgi2.cs.rpi.edu/~lallip/perl/spring06/index.shtml
>>
>> You may not know that all-uppercase letters are an acceptable way to
>> capitalize headings and titles, at least in the USA.
>
> You evidently know nothing of what you speak.  [It's a logo.]

Of course, that's why I've written dozens of articles on Perl and
edited a book on Perl.  You, on the other hand, are posting
anonymously because you're too modest to reveal your true brilliance.

Ted


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

Date: 2 Oct 2006 13:54:00 -0700
From: beartiger@gmail.com
Subject: Re: Modifying a one-liner
Message-Id: <1159822440.468602.170620@m73g2000cwd.googlegroups.com>

Ted Zlatanov wrote:
> On  2 Oct 2006, beartiger@gmail.com wrote:
>
> Ted Zlatanov wrote:
> > On 1 Oct 2006, beartiger@gmail.com wrote: >
> >>> Then why do *you* spell it PERL here?
> >>>
> >>> http://cgi2.cs.rpi.edu/~lallip/perl/spring06/index.shtml
> >>
> >> You may not know that all-uppercase letters are an acceptable way to
> >> capitalize headings and titles, at least in the USA.
> >
> > You evidently know nothing of what you speak.  [It's a logo.]
>
> Of course, that's why I've written dozens of articles on Perl and
> edited a book on Perl.

*What* is why you've written dozens of articles on Perl and edited a
book on Perl?  The fact that you don't know the difference between a
title, a heading, and a logo?  Good lord, I hope not.

> You, on the other hand, are posting
> anonymously because you're too modest to reveal your true brilliance.

Who's posting anonymously?  I sign every post with "John", and a simple
Google Groups search would reveal that I've made no secret that my last
name is "Harrington".  So: at the very least, I'm anonymous no more.
For more than a decade, I've also, as a professional science writer
with degrees in biochemistry and English literature, written literally
dozens of manuals for a biotech company.  And, to thwart your
simple-minded arguments doesn't necessarily take brilliance, but I can
see why it would seem that way to someone like you.


John



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

Date: Mon, 02 Oct 2006 18:33:25 GMT
From: "Mumia W. (reading news)" <paduille.4058.mumia.w@earthlink.net>
Subject: Re: MySql - push a hash into an array
Message-Id: <VXcUg.9128$UG4.8806@newsread2.news.pas.earthlink.net>

On 10/02/2006 12:43 PM, John wrote:
> Hi
> 
> I am reading a row of hashes from a MySQL table.
> I need to add that row to an array to create an 'array of hashes'
> I should then be able to access, say, $xyz[34]{'steel'}.
> 
> The following is part of the code:
> 
> my @xyz=({}); # array of hashes
> 

Just this
   my @xyz;
will do.

> $sql="SELECT coal,iron,steel,china,wool,cloth,fish,livestock FROM industry";
> $sth=$dbh->prepare($sql);
> $sth->execute or die "Unable to execute query: $dbh->errstr\n";
> 
> my $row;
> while ($row = $sth->fetchrow_hashref) {push (@xyz,$row)}
> 
> $sth->finish();
> $dbh- >disconnect();
> 
> print $xyz[6]{'cloth'};
> 
> The print statement is empty.  Any ideas?
> 
> Regards
> John
> 
> 

Use Data::Dumper to see what is in @xyz. Perhaps there is no seventh 
element.


-- 
Posting Guidelines for comp.lang.perl.misc:
http://www.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

Date: Mon, 2 Oct 2006 12:11:19 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: newbie syntax question -> and =>
Message-Id: <nr48v3x0jv.ln2@goaway.wombat.san-francisco.ca.us>

On 2006-10-02, usenet@DavidFilmer.com <usenet@DavidFilmer.com> wrote:
>
> In the example you gave, "=>" is really like a comma in an array
> definition (it's called a 'fat comma').

I've never heard that term, 'fat comma'.  Does anybody know its origin?
A quick google search didn't turn up much, nor did perldoc perlop.

--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: Mon, 02 Oct 2006 22:26:08 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: newbie syntax question -> and =>
Message-Id: <efs05c$5de$1@gemini.csx.cam.ac.uk>

Keith Keller wrote:
> On 2006-10-02, usenet@DavidFilmer.com <usenet@DavidFilmer.com> wrote:
>> In the example you gave, "=>" is really like a comma in an array
>> definition (it's called a 'fat comma').
> 
> I've never heard that term, 'fat comma'.  Does anybody know its origin?
> A quick google search didn't turn up much, nor did perldoc perlop.

It's in Damian Conway's "Perl Best Practices", for one.


DS


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

Date: 2 Oct 2006 11:48:52 -0700
From: "Todd  English" <toddenglish@gmail.com>
Subject: Perl Async .10
Message-Id: <1159814931.959511.91570@m73g2000cwd.googlegroups.com>

It was suggested that my initial post was too verbose for the Perl
newsgroups. I have rewritten my original example and have posted it
bellow. This code uses the "force" feature of async to help with code
compactness. I will post an additional example without the flag, but it
will be a bit longer.

The expected output would be 20 lines printed to the console saying the
following:
<some number>      I have returned
What happens instead is that some of lines fail to print the "I have
returned" part of the message.

Sorry for the initial verbose posting.

Todd English

----------------sample code------------------
#!/usr/bin/perl -w

use strict;
use Async;

sub long_running_computation {
     system qq{find ./ -type f 2>&1 >/dev/null};
     return "I have returned";
  }

my %proc_result;
my %build_result;

for (my $counter=0; $counter < 20; $counter++)
{
    $proc_result{$counter} = Async->new( sub{
long_running_computation() } );
}

while ( my ($name, $proc) = each %proc_result)
{
    $build_result{$name} = $proc->result('1');
}

while (my($host_name, $result) = each %build_result)
{
    printf "%s\t%s\n", $host_name, $result;
}

DJ Stunks wrote:
> Todd  English wrote:
> > btatnall@gmail.com wrote:
> > > Todd  English wrote:
> > > > # This doesn't work
> > > > # while ( (my $name, $proc) = each %proc_result)
> > >
> > > Did you mean:
> > >
> > > while ( my ($name, $proc) = each %proc_result )
> > >
> > > notice the location of my
> >
> > Doh, typo on my part. That was what I meant and that was what I tested
> > (it doesn't work either). Thank you for the reply though, you are the
> > only person thus far to do so. Any other comments or ideas? I've
> > written to Mark-Jason Dominus (the author) several times and have not
> > heard back from him.
> >
> > Anything would be helpful.
>
> Could you boil all this down into one _short_ but _complete_ script
> which exhbits the problem you're describing?  I, and I'm sure others as
> well due to your lack of responses, can't be bothered to wade through
> 134 lines of code and problem description to try and figure out what it
> is you're trying to do and what's not working as you intended it.
>
> Be absolutely sure that whatever you post compiles and runs clean with
> both use warnings and use strict in effect.
> 
> HTH,
> -jp



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

Date: 2 Oct 2006 12:06:42 -0700
From: "Todd English" <toddenglish@gmail.com>
Subject: Re: Perl Async .10
Message-Id: <1159816002.041656.205600@b28g2000cwb.googlegroups.com>

Sample fot using the "force" option in the Async module.

-----------sample code--------------
#!/usr/bin/perl -w

use strict;
use Async;

sub long_running_computation {
     system qq{find ./ -type f 2>&1 >/dev/null};
     return "I have returned";
  }

my %proc_result;
my %build_result;

for (my $counter=0; $counter < 10; $counter++)
{
    $proc_result{$counter} = Async->new( sub{
long_running_computation() } );
}

while( 0 < scalar(keys %proc_result) )
{
    my @host_list_to_delete;
    while( (my $name) = each %proc_result)
    {
        if($proc_result{$name}->ready)
        {
            my $error;
            if($error = $proc_result{$name}->error)
            {
                $build_result{$name} = "Async indicates a failure error
occured: $error !";
            }
            else
            {
                $build_result{$name} = $proc_result{$name}->result;
            }
            push(@host_list_to_delete, $name);
        }
    }

    foreach my $item (@host_list_to_delete)
    {
        delete ( $proc_result{$item} );
    }

    sleep 10;
}


while (my($host_name, $result) = each %build_result)
{
    printf "%s\t%s\n", $host_name, $result;
}

Todd  English wrote:
> It was suggested that my initial post was too verbose for the Perl
> newsgroups. I have rewritten my original example and have posted it
> bellow.
>
> The expected output would be 20 lines printed to the console saying the
> following:
> <some number>      I have returned
> What happens instead is that some of lines fail to print the "I have
> returned" part of the message.
>
> Sorry for the initial verbose posting.
>
> Todd English
>
> ----------------sample code------------------
> #!/usr/bin/perl -w
>
> use strict;
> use Async;
>
> sub long_running_computation {
>      system qq{find ./ -type f 2>&1 >/dev/null};
>      return "I have returned";
>   }
>
> my %proc_result;
> my %build_result;
>
> for (my $counter=0; $counter < 20; $counter++)
> {
>     $proc_result{$counter} = Async->new( sub{
> long_running_computation() } );
> }
>
> while ( my ($name, $proc) = each %proc_result)
> {
>     $build_result{$name} = $proc->result('1');
> }
>
> while (my($host_name, $result) = each %build_result)
> {
>     printf "%s\t%s\n", $host_name, $result;
> }
>
> DJ Stunks wrote:
> > Todd  English wrote:
> > > btatnall@gmail.com wrote:
> > > > Todd  English wrote:
> > > > > # This doesn't work
> > > > > # while ( (my $name, $proc) = each %proc_result)
> > > >
> > > > Did you mean:
> > > >
> > > > while ( my ($name, $proc) = each %proc_result )
> > > >
> > > > notice the location of my
> > >
> > > Doh, typo on my part. That was what I meant and that was what I tested
> > > (it doesn't work either). Thank you for the reply though, you are the
> > > only person thus far to do so. Any other comments or ideas? I've
> > > written to Mark-Jason Dominus (the author) several times and have not
> > > heard back from him.
> > >
> > > Anything would be helpful.
> >
> > Could you boil all this down into one _short_ but _complete_ script
> > which exhbits the problem you're describing?  I, and I'm sure others as
> > well due to your lack of responses, can't be bothered to wade through
> > 134 lines of code and problem description to try and figure out what it
> > is you're trying to do and what's not working as you intended it.
> >
> > Be absolutely sure that whatever you post compiles and runs clean with
> > both use warnings and use strict in effect.
> > 
> > HTH,
> > -jp



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

Date: Mon, 02 Oct 2006 18:33:27 GMT
From: "Mumia W. (reading news)" <paduille.4058.mumia.w@earthlink.net>
Subject: Re: Problem running "cvs commit -m" inside a Perl script
Message-Id: <XXcUg.9129$UG4.1259@newsread2.news.pas.earthlink.net>

On 10/02/2006 11:11 AM, Newshound wrote:
> Hi all,
> 
> I'm trying to take a "cvs commit -m" command line with a multi-line
> log message and run it inside a Perl script.  For instance, trying to
> run the command line:
> 
> prompt> cvs commit -m"This is a\
> ? multi-line log message." filename
> prompt>
> 
> I would be trying to run this inside Perl as:
> 
> my $mesg = "\"This is a\\\nmulti-line log message."
> RunCommand("cvs commit -m $mesg filename","commit.log");
>     .... [...]

Anno's suggestion sounds good, or you could use the -F option to "cvs 
commit".

This is from "info cvs cvs commit":

> [...] You can specify the log message on the command line 
> with the `-m MESSAGE' option, and thus avoid the editor invocation, or 
> use the `-F FILE' option to specify that the argument file contains the 
> log message.

I hope this helps.

-- 
Posting Guidelines for comp.lang.perl.misc:
http://www.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

Date: 2 Oct 2006 11:17:36 -0700
From: "Sean" <seanatpurdue@hotmail.com>
Subject: XML::Parser Installation error: XML-Parser-2.34
Message-Id: <1159813056.433524.132420@c28g2000cwb.googlegroups.com>

I downloaded the XML-Parser module from
http://search.cpan.org/~msergeant/XML-Parser/Parser.pm
and I untar the source ball to $HOME/local/XML-Parser-2.34.
Can someone give me some helps? I appreciate!


Here is what I did and what errors I got:

1) sean$cd local/XML-Parser-2.34
2) XML-Parser-2.34$ ls
Changes  Expat  MANIFEST  Makefile.PL  Parser  Parser.pm  README  blib
pm_to_blib  samples  t
3) XML-Parser-2.34$ perl Makefile.PL PREFIX=$HOME/local/perl
Writing Makefile for XML::Parser::Expat
Writing Makefile for XML::Parse
4) XML-Parser-2.34$ make
make[1]: Entering directory `/home/seany/local/XML-Parser-2.34/Expat'
cc -c   -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"2.34\" -DXS_VERSION=\"2.34\"
-fPIC "-I/usr/lib/perl/5.8/CORE"   Expat.c
Expat.xs:12:19: error: expat.h: No such file or directory
Expat.xs:60: error: syntax error before 'XML_Parser'
Expat.xs:60: warning: no semicolon at end of struct or union
Expat.xs:78: error: syntax error before ':' token
Expat.xs:79: error: syntax error before ':' token
Expat.xs:80: error: syntax error before ':' token
Expat.xs:106: error: syntax error before '}' token
Expat.xs:106: warning: data definition has no type or storage class
 .....(lots of similar errors)
make[1]: *** [Expat.o] Error 1



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

Date: 2 Oct 2006 11:20:30 -0700
From: "Sean" <seanatpurdue@hotmail.com>
Subject: XML::Parser Installation error: XML-Parser-2.34
Message-Id: <1159813229.950975.239340@b28g2000cwb.googlegroups.com>

I downloaded the XML-Parser module from
http://search.cpan.org/~msergeant/XML-Parser/Parser.pm
and I untar the source ball to $HOME/local/XML-Parser-2.34.
Can someone give me some helps? I appreciate!

Here is what I did and what errors I got:

1) sean$cd local/XML-Parser-2.34
2) XML-Parser-2.34$ ls
Changes  Expat  MANIFEST  Makefile.PL  Parser  Parser.pm  README  blib
pm_to_blib  samples  t
3) XML-Parser-2.34$ perl Makefile.PL PREFIX=$HOME/local/perl
Writing Makefile for XML::Parser::Expat
Writing Makefile for XML::Parse
4) XML-Parser-2.34$ make
make[1]: Entering directory `/home/sean/local/XML-Parser-2.34/Expat'
cc -c   -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"2.34\" -DXS_VERSION=\"2.34\"
-fPIC "-I/usr/lib/perl/5.8/CORE"   Expat.c
Expat.xs:12:19: error: expat.h: No such file or directory
Expat.xs:60: error: syntax error before 'XML_Parser'
Expat.xs:60: warning: no semicolon at end of struct or union
Expat.xs:78: error: syntax error before ':' token
Expat.xs:79: error: syntax error before ':' token
Expat.xs:80: error: syntax error before ':' token
Expat.xs:106: error: syntax error before '}' token
Expat.xs:106: warning: data definition has no type or storage class
 .....(lots of similar errors)
make[1]: *** [Expat.o] Erro



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

Date: Mon, 02 Oct 2006 11:43:33 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: XML::Parser Installation error: XML-Parser-2.34
Message-Id: <021020061143332742%jgibson@mail.arc.nasa.gov>

In article <1159813056.433524.132420@c28g2000cwb.googlegroups.com>,
Sean <seanatpurdue@hotmail.com> wrote:

> I downloaded the XML-Parser module from
> http://search.cpan.org/~msergeant/XML-Parser/Parser.pm
> and I untar the source ball to $HOME/local/XML-Parser-2.34.
> Can someone give me some helps? I appreciate!
> 
> 
> Here is what I did and what errors I got:
> 
> 1) sean$cd local/XML-Parser-2.34
> 2) XML-Parser-2.34$ ls
> Changes  Expat  MANIFEST  Makefile.PL  Parser  Parser.pm  README  blib
> pm_to_blib  samples  t
> 3) XML-Parser-2.34$ perl Makefile.PL PREFIX=$HOME/local/perl
> Writing Makefile for XML::Parser::Expat
> Writing Makefile for XML::Parse
> 4) XML-Parser-2.34$ make
> make[1]: Entering directory `/home/seany/local/XML-Parser-2.34/Expat'
> cc -c   -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
> -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
> -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"2.34\" -DXS_VERSION=\"2.34\"
> -fPIC "-I/usr/lib/perl/5.8/CORE"   Expat.c
> Expat.xs:12:19: error: expat.h: No such file or directory
> Expat.xs:60: error: syntax error before 'XML_Parser'
> Expat.xs:60: warning: no semicolon at end of struct or union
> Expat.xs:78: error: syntax error before ':' token
> Expat.xs:79: error: syntax error before ':' token
> Expat.xs:80: error: syntax error before ':' token
> Expat.xs:106: error: syntax error before '}' token
> Expat.xs:106: warning: data definition has no type or storage class
> .....(lots of similar errors)
> make[1]: *** [Expat.o] Error 1
> 

Do you have the expat library installed? XML::Parser is a Perl wrapper
for using the expat C library. Try here: http://expat.sourceforge.net/

In the meantime, you can try XML::SAX::PurePerl, but it will be much
slower than XML::Parser and expat.


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

Date: 2 Oct 2006 11:52:51 -0700
From: "Sean" <seanatpurdue@hotmail.com>
Subject: Re: XML::Parser Installation error: XML-Parser-2.34
Message-Id: <1159815171.108585.90750@i3g2000cwc.googlegroups.com>

well, I think the C Expat library should be self-contained in this perl
XML-Parser module. Here is a 'try-to-prove'. I see a Expat.c there.

XML-Parser-2.34$ cd Expat/
Expat$ ls
Expat.c  Expat.pm  Expat.xs  Makefile  Makefile.PL  encoding.h
pm_to_blib  typemap

So, the previous question was about why Expat.h was missing.

Thanks,
Sean

Jim Gibson wrote:
> In article <1159813056.433524.132420@c28g2000cwb.googlegroups.com>,
> Sean <seanatpurdue@hotmail.com> wrote:
>
> > I downloaded the XML-Parser module from
> > http://search.cpan.org/~msergeant/XML-Parser/Parser.pm
> > and I untar the source ball to $HOME/local/XML-Parser-2.34.
> > Can someone give me some helps? I appreciate!
> >
> >
> > Here is what I did and what errors I got:
> >
> > 1) sean$cd local/XML-Parser-2.34
> > 2) XML-Parser-2.34$ ls
> > Changes  Expat  MANIFEST  Makefile.PL  Parser  Parser.pm  README  blib
> > pm_to_blib  samples  t
> > 3) XML-Parser-2.34$ perl Makefile.PL PREFIX=$HOME/local/perl
> > Writing Makefile for XML::Parser::Expat
> > Writing Makefile for XML::Parse
> > 4) XML-Parser-2.34$ make
> > make[1]: Entering directory `/home/seany/local/XML-Parser-2.34/Expat'
> > cc -c   -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
> > -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
> > -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"2.34\" -DXS_VERSION=\"2.34\"
> > -fPIC "-I/usr/lib/perl/5.8/CORE"   Expat.c
> > Expat.xs:12:19: error: expat.h: No such file or directory
> > Expat.xs:60: error: syntax error before 'XML_Parser'
> > Expat.xs:60: warning: no semicolon at end of struct or union
> > Expat.xs:78: error: syntax error before ':' token
> > Expat.xs:79: error: syntax error before ':' token
> > Expat.xs:80: error: syntax error before ':' token
> > Expat.xs:106: error: syntax error before '}' token
> > Expat.xs:106: warning: data definition has no type or storage class
> > .....(lots of similar errors)
> > make[1]: *** [Expat.o] Error 1
> >
>
> Do you have the expat library installed? XML::Parser is a Perl wrapper
> for using the expat C library. Try here: http://expat.sourceforge.net/
>
> In the meantime, you can try XML::SAX::PurePerl, but it will be much
> slower than XML::Parser and expat.



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

Date: Mon, 02 Oct 2006 13:54:52 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: XML::Parser Installation error: XML-Parser-2.34
Message-Id: <021020061354524267%jgibson@mail.arc.nasa.gov>

In article <1159815171.108585.90750@i3g2000cwc.googlegroups.com>, Sean
<seanatpurdue@hotmail.com> wrote:

[top-posting fixed]

> Jim Gibson wrote:
> > In article <1159813056.433524.132420@c28g2000cwb.googlegroups.com>,
> > Sean <seanatpurdue@hotmail.com> wrote:
> >
> > > I downloaded the XML-Parser module from
> > > http://search.cpan.org/~msergeant/XML-Parser/Parser.pm
> > > and I untar the source ball to $HOME/local/XML-Parser-2.34.
> > > Can someone give me some helps? I appreciate!
> > >
> > >
> > > Here is what I did and what errors I got:
> > >
 ...
> > > Expat.xs:12:19: error: expat.h: No such file or directory
 ...
> >
> > Do you have the expat library installed? XML::Parser is a Perl wrapper
> > for using the expat C library. Try here: http://expat.sourceforge.net/
> >
> > In the meantime, you can try XML::SAX::PurePerl, but it will be much
> > slower than XML::Parser and expat.
> 
> well, I think the C Expat library should be self-contained in this perl
> XML-Parser module. Here is a 'try-to-prove'. I see a Expat.c there.

Well, you might think so, but you would be wrong.

> 
> XML-Parser-2.34$ cd Expat/
> Expat$ ls
> Expat.c  Expat.pm  Expat.xs  Makefile  Makefile.PL  encoding.h
> pm_to_blib  typemap
> 
> So, the previous question was about why Expat.h was missing.

The missing file is expat.h, not Expat.h (case matters in Unix).
expat.h is included with the expat distribution, not XML::Parser.

Expat.c is generated as part of the XML::Parser build process by the
xsubpp utility (see the comments in Expat.c).

You will have to download and install the expat distribution if it does
not exist on your system. If it does exist in a non-standard location,
use the EXPINCPATH and EXPATLIBPATH arguments in the 'perl Makefile.PL
 ...' step to specify where the include and library files for expat may
be found.


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

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 V10 Issue 9791
***************************************


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