[29485] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 729 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 8 14:14:24 2007

Date: Wed, 8 Aug 2007 11:14:12 -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           Wed, 8 Aug 2007     Volume: 11 Number: 729

Today's topics:
    Re: Matching problem <m@rtij.nl.invlalid>
    Re: Matching problem <mritty@gmail.com>
    Re: Matching problem <m@rtij.nl.invlalid>
    Re: Matching problem <1usa@llenroc.ude.invalid>
    Re: Matching problem <AaronJSherman@gmail.com>
    Re: Matching problem <jgibson@mail.arc.nasa.gov>
    Re: Matching problem <m@rtij.nl.invlalid>
    Re: module OpenOffice::OODoc fails with Unicode charact <thepoet_nospam@arcor.de>
        new CPAN modules on Wed Aug  8 2007 (Randal Schwartz)
    Re: Replacing a line <vedpsingh@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 8 Aug 2007 08:57:40 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: Matching problem
Message-Id: <pan.2007.08.08.06.57.40@rtij.nl.invlalid>

On Sun, 05 Aug 2007 20:48:13 -0700, Paul Lalli wrote:

> You're welcome.  Shame you didn't learn it.  To continue to argue that
> Perl is some way deficient because *you* don't understand it is beyond
> arrogance.

Your nitpicking over english semantics is arrogance. It did not do what 
the OP wanted, so for him it did not work. That perl did what it was told 
to do is irrelevant.

M4


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

Date: Wed, 08 Aug 2007 03:43:21 -0700
From:  Paul Lalli <mritty@gmail.com>
Subject: Re: Matching problem
Message-Id: <1186569801.658684.249480@57g2000hsv.googlegroups.com>

On Aug 8, 2:57 am, Martijn Lievaart <m...@rtij.nl.invlalid> wrote:
> Your nitpicking over english semantics is arrogance. It did not
> do what the OP wanted, so for him it did not work. That perl did
> what it was told to do is irrelevant.

The code the OP wrote didn't do what the OP wanted, and the first
thing he asked was "Is this a known bug?", not bothering to consider
the possibility that his code was just wrong.
http://groups.google.com/group/comp.lang.perl.misc/msg/f7e50fc756df8f94

Read the whole thread next time.

Paul Lalli



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

Date: Wed, 8 Aug 2007 15:15:15 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: Matching problem
Message-Id: <pan.2007.08.08.13.15.15@rtij.nl.invlalid>

On Wed, 08 Aug 2007 03:43:21 -0700, Paul Lalli wrote:

> On Aug 8, 2:57 am, Martijn Lievaart <m...@rtij.nl.invlalid> wrote:
>> Your nitpicking over english semantics is arrogance. It did not do what
>> the OP wanted, so for him it did not work. That perl did what it was
>> told to do is irrelevant.
> 
> The code the OP wrote didn't do what the OP wanted, and the first thing
> he asked was "Is this a known bug?", not bothering to consider the
> possibility that his code was just wrong.
> http://groups.google.com/group/comp.lang.perl.misc/msg/f7e50fc756df8f94
> 
> Read the whole thread next time.

I did. I think you read something else in these last posts than the OP 
intended to convey. I certainly didn't read it the way you did and 
actually thought he was pretty clear in what he said.

M4


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

Date: Wed, 08 Aug 2007 14:05:47 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Matching problem
Message-Id: <Xns998666BCB2A67asu1cornelledu@127.0.0.1>

Martijn Lievaart <m@rtij.nl.invlalid> wrote in
news:pan.2007.08.08.13.15.15@rtij.nl.invlalid: 

> On Wed, 08 Aug 2007 03:43:21 -0700, Paul Lalli wrote:
> 
>> On Aug 8, 2:57 am, Martijn Lievaart <m...@rtij.nl.invlalid> wrote:
>>> Your nitpicking over english semantics is arrogance. It did not do
>>> what the OP wanted, so for him it did not work. That perl did what
>>> it was told to do is irrelevant.
>> 
>> The code the OP wrote didn't do what the OP wanted, and the first
>> thing he asked was "Is this a known bug?", not bothering to consider
>> the possibility that his code was just wrong.
>> 
http://groups.google.com/group/comp.lang.perl.misc/msg/f7e50fc756df8f9
>> 4 
>> 
>> Read the whole thread next time.
> 
> I did. I think you read something else in these last posts than the OP
> intended to convey. I certainly didn't read it the way you did and 
> actually thought he was pretty clear in what he said.
> 

In his first post in this thread,

raymond@new.orleans wrote in
news:cEnti.8716$RH2.3464@bignews7.bellsouth.net: 

# ...
# I have narrowed the problem down to parenthesis in a string that won't
# match.  Is this a known bug?

Paul is correct in his criticism. In the last 25 years, I remember maybe 
2 or 3 instances of my programs not doing what I wanted them to do (ZX 
Spectrum's NMI bug comes to mind) because of a bug in the OS or the 
programming language but countless cases where I had made a mistake.

It is hard to take people seriously when the first thing they blame is a 
bug in someone else's code.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

Date: Wed, 08 Aug 2007 14:41:37 -0000
From:  Aaron Sherman <AaronJSherman@gmail.com>
Subject: Re: Matching problem
Message-Id: <1186584097.708228.54820@l70g2000hse.googlegroups.com>

On Aug 5, 6:32 pm, Tad McClellan <ta...@seesig.invalid> wrote:

> See the "Quote and Quote-like Operators" section in:
>
>    perldoc perlop
>
> > Would /$data2\Q/ also work?
>
> What happened when you tried it?

That seems sort of rude....

\Q is a directive that says, "start quoting metacharacters here,"
within any interpolatable sequence (that is, duoble-quotes and regex).
\E is the complementary operator that turns that behavior off. For
example:

 perl -le 'print qq{a(b\Q(c)\E)}'

Which produces:

 a(b\(c\))

All this does is place backslashes in front of any character that
would be interpreted by any interpolation as special. Mostly this is
used for interpolating variables in regex:

 s/Subject: \Q$subject\E/MATCHED SUBJECT/;

Many people get into the bad habit of omitting the \E, but I recommend
that you avoid that bit of laziness, as it will bite you when you
decide to modify code later and add something after the variable
without thinking about the \Q.

This feature can also be invoked as a function:

 $re_subj=quotemeta($subject);
 s/Subject: $re_subj/MATCHED SUBJECT/;




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

Date: Wed, 08 Aug 2007 09:35:27 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Matching problem
Message-Id: <080820070935270232%jgibson@mail.arc.nasa.gov>

In article <1186584097.708228.54820@l70g2000hse.googlegroups.com>,
Aaron Sherman <AaronJSherman@gmail.com> wrote:

> On Aug 5, 6:32 pm, Tad McClellan <ta...@seesig.invalid> wrote:
> 
> > See the "Quote and Quote-like Operators" section in:
> >
> >    perldoc perlop
> >
> > > Would /$data2\Q/ also work?
> >
> > What happened when you tried it?
> 
> That seems sort of rude....

Asking thousands of people a question that you can answer yourself with
little effort in a few minutes might also be considered rude.

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com


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

Date: Wed, 8 Aug 2007 19:49:59 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: Matching problem
Message-Id: <pan.2007.08.08.17.49.59@rtij.nl.invlalid>

On Wed, 08 Aug 2007 14:05:47 +0000, A. Sinan Unur wrote:

>> I did. I think you read something else in these last posts than the OP
                                             ^^^^^^^^^^^^^^^^
>> intended to convey. I certainly didn't read it the way you did and
>> actually thought he was pretty clear in what he said.
>> 
>> 
> In his first post in this thread,
         ^^^^^^^^^^

I never denied that.

(snip)
 
> It is hard to take people seriously when the first thing they blame is a
> bug in someone else's code.

True, but when they later see the light, which is as I read those later 
posts, I take them seriously again.

M4


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

Date: Wed, 08 Aug 2007 16:39:15 +0200
From: Christian Winter <thepoet_nospam@arcor.de>
Subject: Re: module OpenOffice::OODoc fails with Unicode characters
Message-Id: <46b9d593$0$21003$9b4e6d93@newsspool1.arcor-online.net>

David Sudlow wrote:
> Christian Winter wrote:
>> David Sudlow wrote:
>> ...and make this:
>>
>>> $text->appendParagraph(text => "hello\x{100}");
>>
>> my $hello = encode('utf-8', "hello\x{100}");
>> $text->appendParagraph(text => $hello);
>>
>>> $archive->save();
>>
>> and things should work. appendParagraph() seemingly expects the
>> text parameter to be a series of utf-8 octets, while "hello\x{100}"
>> creates a string with a wide character in Perl's native encoding.
>>
> 
> Thanks, this works (in my real code as well as the example). It feels 
> like a bit of a kludge though. Shouldn't there be a way to tell perl to 
> pass utf-8 strings without the explicit conversion, given that I am 
> reading in utf8 and passing it to a function that expects utf8?
> 
> Would you consider this a perl issue or an OpenOffice::OODoc issue an 
> 'Encode' issue or 'expected behaviour'?

I'd call it an OpenOffice::OODoc documentation unclarity and blame
neither Perl nor Encode (at least not too much). The whole utf8 thing
is a big ugly mess, as one needs to check twice and thrice which
encoding to use for which data, but that's hardly the fault of the
Perl and Encode authors. Upgrading old C applications to unicode
isn't any better.

At least telling the OODoc module to expect utf8 and passing Perl's
internal version of such a string gives an error instead of a garbled
document, so "expected behaviour" would come close :)

-Chris


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

Date: Wed, 8 Aug 2007 04:42:19 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Aug  8 2007
Message-Id: <JMFuEJ.1A2G@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.

Apache-Yaalr-0.03.0
http://search.cpan.org/~jeremiah/Apache-Yaalr-0.03.0/
Perl module for Yet Another Apache Log Reader 
----
Apache-Yaalr-0.03.1
http://search.cpan.org/~jeremiah/Apache-Yaalr-0.03.1/
Perl module for Yet Another Apache Log Reader 
----
Business-BR-Ids-0.00_20
http://search.cpan.org/~ferreira/Business-BR-Ids-0.00_20/
Modules for dealing with Brazilian identification codes (CPF, CNPJ, ...) 
----
CPAN-Reporter-0.48
http://search.cpan.org/~dagolden/CPAN-Reporter-0.48/
Provides Test::Reporter support for CPAN.pm 
----
CPAN-Reporter-0.99_02
http://search.cpan.org/~dagolden/CPAN-Reporter-0.99_02/
Provides Test::Reporter support for CPAN.pm 
----
CPAN-Test-Dummy-Perl5-Make-FailLate-1.00
http://search.cpan.org/~dagolden/CPAN-Test-Dummy-Perl5-Make-FailLate-1.00/
CPAN Test Dummy 
----
Cwd-Ext-1.03
http://search.cpan.org/~leocharre/Cwd-Ext-1.03/
extended file path subroutines 
----
DBIx-Class-Cursor-Cached-1.0.1
http://search.cpan.org/~mstrout/DBIx-Class-Cursor-Cached-1.0.1/
cursor class with built-in caching support 
----
Data-Compare-0.17
http://search.cpan.org/~dcantrell/Data-Compare-0.17/
compare perl data structures 
----
Egg-Release-2.20
http://search.cpan.org/~lushe/Egg-Release-2.20/
Version of Egg WEB Application Framework. 
----
Egg-Release-JSON-0.01
http://search.cpan.org/~lushe/Egg-Release-JSON-0.01/
JSON module kit for Egg. 
----
Egg-Release-XML-FeedPP-0.01
http://search.cpan.org/~lushe/Egg-Release-XML-FeedPP-0.01/
XML::FeedPP module kit for Egg. 
----
Eludia-07.08.07
http://search.cpan.org/~dmow/Eludia-07.08.07/
----
Geo-Gpx-0.18
http://search.cpan.org/~andya/Geo-Gpx-0.18/
Create and parse GPX files. 
----
HoneyClient-Manager-0.99
http://search.cpan.org/~mitrehc/HoneyClient-Manager-0.99/
----
IO-AIO-Util-0.03
http://search.cpan.org/~gray/IO-AIO-Util-0.03/
useful functions missing from IO::AIO 
----
MARC-Charset-0.98
http://search.cpan.org/~esummers/MARC-Charset-0.98/
convert MARC-8 encoded strings to UTF-8 
----
MogileFS-Client-FilePaths-0.02
http://search.cpan.org/~hachi/MogileFS-Client-FilePaths-0.02/
Client library for use with FilePaths plugin in MogileFS 
----
MogileFS-Plugin-FilePaths-0.02
http://search.cpan.org/~hachi/MogileFS-Plugin-FilePaths-0.02/
----
MooseX-Storage-0.06
http://search.cpan.org/~stevan/MooseX-Storage-0.06/
An serialization framework for Moose classes 
----
Net-SSH-Expect-1.04
http://search.cpan.org/~bnegrao/Net-SSH-Expect-1.04/
SSH wrapper to execute remote commands 
----
OAI-Harvester-1.12
http://search.cpan.org/~esummers/OAI-Harvester-1.12/
----
Objects-Collection-0.34
http://search.cpan.org/~zag/Objects-Collection-0.34/
Collections of data or objects. 
----
PDF-API2-0.62
http://search.cpan.org/~areibens/PDF-API2-0.62/
A Perl Module Chain to faciliate the Creation and Modification of High-Quality "Portable Document Format (aka. PDF)" Files. 
----
Perl-Critic-Dynamic-0.04
http://search.cpan.org/~thaljef/Perl-Critic-Dynamic-0.04/
Non-static policies for Perl::Critic 
----
Scriptalicious-1.11
http://search.cpan.org/~samv/Scriptalicious-1.11/
Make scripts more delicious to SysAdmins 
----
Slay-Makefile-0.06
http://search.cpan.org/~nodine/Slay-Makefile-0.06/
Wrapper to Slay::Maker that reads the rules from a file 
----
Test-StubGenerator-0.9.1
http://search.cpan.org/~kcowgill/Test-StubGenerator-0.9.1/
A simple module that analyzes a given source file and automatically generates t/*.t style tests for subroutines/methods it encounters. 
----
Test-StubGenerator-0.9.2
http://search.cpan.org/~kcowgill/Test-StubGenerator-0.9.2/
A simple module that analyzes a given source file and automatically generates t/*.t style tests for subroutines/methods it encounters. 
----
Text-Pluralize-1.1
http://search.cpan.org/~kvail/Text-Pluralize-1.1/
simple pluralization routine 
----
VR-API-1.05
http://search.cpan.org/~nmarden/VR-API-1.05/
Communicate with VerticalResponse's API services 
----
VR-API-1.06
http://search.cpan.org/~nmarden/VR-API-1.06/
Communicate with VerticalResponse's API services 
----
WebService-Nestoria-Search-0.10
http://search.cpan.org/~kaoru/WebService-Nestoria-Search-0.10/
Perl interface to the Nestoria Search public API. 
----
WebService-Validator-HTML-W3C-0.21
http://search.cpan.org/~struan/WebService-Validator-HTML-W3C-0.21/
Access the W3Cs online HTML validator 
----
YAML-Syck-0.96
http://search.cpan.org/~audreyt/YAML-Syck-0.96/
Fast, lightweight YAML loader and dumper 


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: Wed, 08 Aug 2007 09:40:13 -0700
From:  Ved <vedpsingh@gmail.com>
Subject: Re: Replacing a line
Message-Id: <1186591213.855380.176570@d30g2000prg.googlegroups.com>

On Aug 7, 3:17 am, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
wrote:
> Ved wrote:
> > Hi all,
> > I have to replace commented line in a list of  " .cpp" file .
> > Line  looks like this:
> > //#define BBPRxChanRouteFileLoadInput 1
>
> > i.e. The line format :
> > //#define (FileName)FileLoadInput 1
> >  is to be replaced with
> > #define (FileName)FileLoadInput 1
>
> > I have written a code using Tie::File which is mentioned below.
> > I want to do two things:
>
> > 1) Remove trailing .cpp in $dir ?
>
> perldoc -f rename
>
>
>
> > 2) What to do in this to get (/ //#define $dirFileLoadInput 1 /)   in
> > the for loop ?
> > #!/usr/local/bin/perl
> > use strict;
> > use warnings;
> > use Tie::File;
>
> > my $dir_list = 'my.rxfiles'; #contains list of .cpp files
> >     open my $fh,'<',$dir_list or die "Cannot read $dir_list: $!\n";
> >     while (my $dir = <$fh>) {
> >      chop $dir;
> >      my $file = "$dir";
> >       chomp $file;
>
> Why have $dir and $file? Use more descriptive variable
> names.
>
> open( my $cpp_files, '<', $dir_list )
>         or die "Cannot read $dir_list: $!\n";
> while ( my $cpp_file = <$cpp_files> )
> {
>         chomp $cpp_file;
>         if ( -e $cpp_file )
>         {
>                 process_one( $cpp_file );
>         }
>         else { ...}
>
> }
> >      if (-e $dir) {
> >        process_one_file($dir);
> >      } else {
> >        warn "File $dir does not exist; skipping\n";
> >      }
> >    }
>
> >    #Using core module Tie::File to process a file in this subroutine
> >    sub process_one_file {
> >      my $dir = shift;
>
> Since you're processing a 'file' not a 'dir'ectory, name your
> variables accordingly:
>
> my $file = shift;
>
> print "Processing $file\n";
> etc.
>
> >      print "Processing $dir\n";
> >       tie my @array, 'Tie::File', $dir  or die "tie error $dir: $!
> > \n" ;
> >       for (@array) {
> >           if (/\//#define $dirFileLoadInput 1/)  #what to do here ??
> >       {
> >             $_ = #define $dirFileLoadinput 1 ;
> >             last;
>
> You only want to modify the first one?
>
> >            }
> >         }
> >    }
>
>         for( @array )
>         {
>                 # Need to escape the $
>                 if( m{^//#define \$dirFileLoadInput 1$} )
>                 {
>                         s{^//}{};
>                         last;
>                 }
>         }
>
> Documentation on regular expressions:
>
>         perldoc perlretut
Hi Gleixner,

Why is it not entering in this condition ?

 if( m{^//#define \$module_nameFileLoadInput 1$} )



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

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


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