[32017] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3281 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 10 14:09:29 2011

Date: Thu, 10 Feb 2011 11:09:11 -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           Thu, 10 Feb 2011     Volume: 11 Number: 3281

Today's topics:
    Re: [OT] other forms of the word in english <email@invalid.net>
        How to exclude action of Find::Find::find in subdirecto <vadim.dvorkin@gmail.com>
        How to exclude action of Find::Find::find in subdirecto <vadim.dvorkin@gmail.com>
    Re: How to exclude action of Find::Find::find in subdir <glex_no-spam@qwest-spam-no.invalid>
    Re: one regex to do the work of two? (David Canzi)
    Re: one regex to do the work of two? <rvtol+usenet@xs4all.nl>
    Re: one regex to do the work of two? <nospam.gravitalsun@hotmail.com.nospam>
    Re: one regex to do the work of two? sln@netherlands.com
        ParseExcel $font->{Color} Question? <zihav@yahoo.com>
    Re: ParseExcel $font->{Color} Question? <justin.1011@purestblue.com>
    Re: ParseExcel $font->{Color} Question? <zihav@yahoo.com>
        table --> pre? (hymie!)
    Re: table --> pre? <mvdwege@mail.com>
    Re: table --> pre? <kkeller-usenet@wombat.san-francisco.ca.us>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 09 Feb 2011 14:41:18 GMT
From: QoS <email@invalid.net>
Subject: Re: [OT] other forms of the word in english
Message-Id: <iIx4p.52550$Ga6.4234@newsfe04.iad>


Hollow Quincy <hollow.quincy@gmail.com> wrote in message-id:  <0569b182-a89e-4cee-adc9-49bba9fd01ec@n10g2000yqf.googlegroups.com>

> 
> Hi,
> 
> I'm looking for an aplication / dictionary that would find other forms
> of the word in english.
> E.g. I would give word "love" it will returns loved, loving, lovely
> etc.
> Have you ever met something like that ?
> 
> Thanks for help


http://www.cpan.org/authors/id/Q/QO/QOS/Networking/lexicon_v1_60.pl





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

Date: Thu, 10 Feb 2011 09:18:10 -0800 (PST)
From: vdvorkin <vadim.dvorkin@gmail.com>
Subject: How to exclude action of Find::Find::find in subdirectories with known names?
Message-Id: <23296501-d224-485e-b5a9-28d1a8b956a9@r4g2000prm.googlegroups.com>

I must pass through directory tree and to execute some action with
files, names of which described by regex. I need not do it in
directories SCCS and VVS, which can be in every subdirectory.

The following code works correctly, does not action ("THE ACTION") in
unwanted directories, but it pass through every subdirectory. I'd
would like that it will worked faster, and procedure "wanted" will not
step inside SCCS and VVS. I have tried for that purpose the
"untaint_pattern" and "untaint_skip" options but did not success.
Perhaps I used incorrect values. Or, I do not understand  the task of
the options correctly.

Somebody can suggest to me the decision?

Thanks in advance,
--Vadim


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

Date: Thu, 10 Feb 2011 09:23:23 -0800 (PST)
From: vdvorkin <vadim.dvorkin@gmail.com>
Subject: How to exclude action of Find::Find::find in subdirectories with known names?
Message-Id: <62f2fb2d-25ae-4349-8171-bd397acb8285@s28g2000prb.googlegroups.com>

I must pass through directory tree and to execute some action with
files, names of which described by regex. I need not do it in
directories SCCS and VVS, which can be in every subdirectory.

The following code works correctly, does not action ("THE ACTION") in
unwanted directories, but it pass through every subdirectory. I'd
would like that it will worked faster, and procedure "wanted" will not
step inside SCCS and VVS. I have tried for that purpose the
"untaint_pattern" and "untaint_skip" options but did not success.
Perhaps I used incorrect values. Or, I do not understand  the task of
the options correctly.

Somebody can suggest to me the decision?

Thanks in advance,
--Vadim

use File::Find;
use vars qw/*name *dir *prune/;
             *name   = *File::Find::name;
             *dir    = *File::Find::dir;
sub wanted;
# Traverse desired filesystems
File::Find::find({wanted => \&wanted}, '.');

sub wanted { # $_ is file name
  if ($dir !~ /\/SCCS\b/ && $dir !~ /\/VVS\b/)
   {
     THE ACTION...
  }
}


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

Date: Thu, 10 Feb 2011 11:39:45 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: How to exclude action of Find::Find::find in subdirectories with known names?
Message-Id: <4d5422e2$0$73610$815e3792@news.qwest.net>

vdvorkin wrote:
> I must pass through directory tree and to execute some action with
> files, names of which described by regex. I need not do it in
> directories SCCS and VVS, which can be in every subdirectory.
> 
> The following code works correctly, does not action ("THE ACTION") in
> unwanted directories, but it pass through every subdirectory. I'd
> would like that it will worked faster, and procedure "wanted" will not
> step inside SCCS and VVS. I have tried for that purpose the
> "untaint_pattern" and "untaint_skip" options but did not success.
> Perhaps I used incorrect values. Or, I do not understand  the task of
> the options correctly.
> 
> Somebody can suggest to me the decision?
> 
> Thanks in advance,
> --Vadim
> 
> use File::Find;
> use vars qw/*name *dir *prune/;
>              *name   = *File::Find::name;
>              *dir    = *File::Find::dir;
> sub wanted;
> # Traverse desired filesystems
> File::Find::find({wanted => \&wanted}, '.');
> 
> sub wanted { # $_ is file name
>   if ($dir !~ /\/SCCS\b/ && $dir !~ /\/VVS\b/)
>    {
>      THE ACTION...
>   }
> }

Try the preprocess method. From the documentation:  "...The code
can be used to sort the file/directory names alphabeti-
cally, numerically, or to filter out directory entries based on
their name alone. "


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

Date: Wed, 9 Feb 2011 00:34:08 +0000 (UTC)
From: dmcanzi@remulak.uwaterloo.ca (David Canzi)
Subject: Re: one regex to do the work of two?
Message-Id: <iisne0$73r$1@rumours.uwaterloo.ca>

In article <iipnm2$1l35$1@ulysses.noc.ntua.gr>,
George Mpouras  <nospam.gravitalsun@hotmail.com.nospam> wrote:
>Στις 19/1/2011 8:28 μμ, ο/η Spydo έγραψε:
>> On Jan 19, 1:24 pm, Spydo<spy...@gmail.com>  wrote:
>>> I frequently have to clean up lines with:
>>>
>>> s/^\s+//;
>>> s/\s+$//;
>>>
>>> Is there ONE regex (as in ONE, SINGLE s///, not one compound
>>> statement) that can do both of these ?
>>>
>>> Thanks&  happy Gnu Year.
>>
>> DOH Nevermind I found it.. I didnt know ^ and $ could be in parens..
>>
>> s/(^\s+)|(\s+$)//g;
>>
>
>
>here is a pretty one
>
>s/^\s*(.*?)\s*$/$1/

That's really neat.

-- 
David Canzi		| Life is too short to point out every mistake. |


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

Date: Wed, 09 Feb 2011 02:07:24 +0100
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: one regex to do the work of two?
Message-Id: <4d51e8cc$0$41114$e4fe514c@news.xs4all.nl>

On 2011-02-09 01:34, David Canzi wrote:
> In article<iipnm2$1l35$1@ulysses.noc.ntua.gr>,
> George Mpouras<nospam.gravitalsun@hotmail.com.nospam>  wrote:
>> Στις 19/1/2011 8:28 μμ, ο/η Spydo έγραψε:
>>> On Jan 19, 1:24 pm, Spydo<spy...@gmail.com>   wrote:

>>>> I frequently have to clean up lines with:
>>>>
>>>> s/^\s+//;
>>>> s/\s+$//;
>>>>
>>>> Is there ONE regex (as in ONE, SINGLE s///, not one compound
>>>> statement) that can do both of these ?
>>>>
>>>> Thanks&   happy Gnu Year.
>>>
>>> DOH Nevermind I found it.. I didnt know ^ and $ could be in parens..
>>>
>>> s/(^\s+)|(\s+$)//g;
>>>
>>
>>
>> here is a pretty one
>>
>> s/^\s*(.*?)\s*$/$1/
>
> That's really neat.

I don't think so, because it also replaces when there is no heading or 
tailing whitespace at all.

I normally use:

      s/\s+\z//,     # remove trailing whitespace
      s/\A\s+//,     # remove leading whitespace
      s/[^\S ]/ /g,  # replace non-space whitespace by space
      s/ {2,}/ /g,   # unify spaces
          for $input;

See also tr/ in perlop, think about tr/\t\n / /s.

-- 
Ruud


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

Date: Wed, 09 Feb 2011 23:35:28 +0200
From: George Mpouras <nospam.gravitalsun@hotmail.com.nospam>
Subject: Re: one regex to do the work of two?
Message-Id: <iiv1b1$1286$1@ulysses.noc.ntua.gr>

Στις 9/2/2011 3:07 πμ, ο/η Dr.Ruud έγραψε:
> On 2011-02-09 01:34, David Canzi wrote:
>> In article<iipnm2$1l35$1@ulysses.noc.ntua.gr>,
>> George Mpouras<nospam.gravitalsun@hotmail.com.nospam> wrote:
>>> Στις 19/1/2011 8:28 μμ, ο/η Spydo έγραψε:
>>>> On Jan 19, 1:24 pm, Spydo<spy...@gmail.com> wrote:
>
>>>>> I frequently have to clean up lines with:
>>>>>
>>>>> s/^\s+//;
>>>>> s/\s+$//;
>>>>>
>>>>> Is there ONE regex (as in ONE, SINGLE s///, not one compound
>>>>> statement) that can do both of these ?
>>>>>
>>>>> Thanks& happy Gnu Year.
>>>>
>>>> DOH Nevermind I found it.. I didnt know ^ and $ could be in parens..
>>>>
>>>> s/(^\s+)|(\s+$)//g;
>>>>
>>>
>>>
>>> here is a pretty one
>>>
>>> s/^\s*(.*?)\s*$/$1/
>>
>> That's really neat.
>
> I don't think so, because it also replaces when there is no heading or
> tailing whitespace at all.
>
> I normally use:
>
> s/\s+\z//, # remove trailing whitespace
> s/\A\s+//, # remove leading whitespace
> s/[^\S ]/ /g, # replace non-space whitespace by space
> s/ {2,}/ /g, # unify spaces
> for $input;
>
> See also tr/ in perlop, think about tr/\t\n / /s.
>


too much noise for something simple


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

Date: Wed, 09 Feb 2011 16:05:11 -0800
From: sln@netherlands.com
Subject: Re: one regex to do the work of two?
Message-Id: <rsa6l6pnb8ceijer4r51tbmnbt9i8m4dp5@4ax.com>

On Wed, 09 Feb 2011 02:07:24 +0100, "Dr.Ruud" <rvtol+usenet@xs4all.nl> wrote:

>On 2011-02-09 01:34, David Canzi wrote:
>> In article<iipnm2$1l35$1@ulysses.noc.ntua.gr>,
>> George Mpouras<nospam.gravitalsun@hotmail.com.nospam>  wrote:
>>> Στις 19/1/2011 8:28 μμ, ο/η Spydo έγ?αψε:
>>>> On Jan 19, 1:24 pm, Spydo<spy...@gmail.com>   wrote:
>
>>>>> I frequently have to clean up lines with:
>>>>>
>>>>> s/^\s+//;
>>>>> s/\s+$//;
>>>>>
>>>>> Is there ONE regex (as in ONE, SINGLE s///, not one compound
>>>>> statement) that can do both of these ?
>>>>>
>>>>> Thanks&   happy Gnu Year.
>>>>
>>>> DOH Nevermind I found it.. I didnt know ^ and $ could be in parens..
>>>>
>>>> s/(^\s+)|(\s+$)//g;
>>>>
>>>
>>>
>>> here is a pretty one
>>>
>>> s/^\s*(.*?)\s*$/$1/
>>
>> That's really neat.
>
>I don't think so, because it also replaces when there is no heading or 
>tailing whitespace at all.
>
>I normally use:
>
>      s/\s+\z//,     # remove trailing whitespace
>      s/\A\s+//,     # remove leading whitespace
>      s/[^\S ]/ /g,  # replace non-space whitespace by space
>      s/ {2,}/ /g,   # unify spaces
>          for $input;
>
>See also tr/ in perlop, think about tr/\t\n / /s.

This is pretty far afield from removing leading/trailing
whitespace.

-sln


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

Date: Thu, 10 Feb 2011 05:27:24 -0800 (PST)
From: T <zihav@yahoo.com>
Subject: ParseExcel $font->{Color} Question?
Message-Id: <e11ae0c5-9b9d-4ddb-b959-f5f5a424c865@z3g2000prz.googlegroups.com>

Greetings,

    I'm using the CPAN package Spreadsheet::ParseExcel to try and get
values of the cells. This works fine until I try to get the color of
the font. I'm using the examples provide in the docs:

use Spreadsheet::ParseExcel;

my $parser   = Spreadsheet::ParseExcel->new();
my $workbook = $parser->Parse('MyExcel.xls');

for my $worksheet ( $workbook->worksheets() ) {

    my ( $row_min, $row_max ) = $worksheet->row_range();
    my ( $col_min, $col_max ) = $worksheet->col_range();

    for my $row ( $row_min .. $row_max ) {
        for my $col ( $col_min .. $col_max ) {

            my $cell = $worksheet->get_cell( $row, $col );
            next unless $cell;
            print "Row, Col    = ($row, $col)\n";
            print "Value       = ", $cell->value(),       "\n";
            print "Unformatted = ", $cell->unformatted(), "\n";
            print "\n";

            my $formats = $cell->get_rich_text();

            for my $aref (@$formats) {
                my $font = $aref->[1];
                print "Color = ", $font->{Color}, "\n";
            }
        }
    }
}

Not sure what I'm doing wrong here, It looks like the get_rich_text
(), isn't returning anything. I'm just not sure why. Thanks for any
help in advance!

   Tom


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

Date: Thu, 10 Feb 2011 15:39:54 +0000
From: Justin C <justin.1011@purestblue.com>
Subject: Re: ParseExcel $font->{Color} Question?
Message-Id: <afdd28-7rh.ln1@zem.masonsmusic.co.uk>

On 2011-02-10, T <zihav@yahoo.com> wrote:
> Greetings,

Hello.

[snip]
>             my $formats = $cell->get_rich_text();
>
> Not sure what I'm doing wrong here, It looks like the get_rich_text
> (), isn't returning anything. I'm just not sure why. Thanks for any
> help in advance!

I don't see get_rich_text() as an available method in the
Spreadsheet::ParseExcel package. Ah, I see, you're using get_rich_text()
which is available in Spreadsheet::ParseExcel::Cell, maybe you should
specify that module? 

   Justin.

-- 
Justin C, by the sea.


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

Date: Thu, 10 Feb 2011 10:40:09 -0800 (PST)
From: Tom <zihav@yahoo.com>
Subject: Re: ParseExcel $font->{Color} Question?
Message-Id: <edf36756-a096-4de7-8f13-ce2e4b4badf6@glegroupsg2000goo.googlegroups.com>

>I don't see get_rich_text() as an available method in the
>Spreadsheet::ParseExcel package. Ah, I see, you're using get_rich_text()
>which is available in Spreadsheet::ParseExcel::Cell, maybe you should
>specify that module? 

Tried that, no luck. I see it in the Cell.pm file:

# get_rich_text()
#
# Returns an array ref of font information about each string block in a "rich",
# i.e. multi-format, string.
#
sub get_rich_text {

    my $self = shift;

    return $self->{Rich};
}

but I'm not getting any values back...

 Tom



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

Date: 10 Feb 2011 14:42:05 GMT
From: hymie@lactose.homelinux.net (hymie!)
Subject: table --> pre?
Message-Id: <4d53f93d$0$10483$882e7ee2@usenet-news.net>

Greetings.

Can somebody recommend to me a perl script or a perl module that
takes an HTML-formatted <table> and produces a space-formatted
output that would be suitable for use within a <pre> tag?

I currently have a black-box java script that does this, but doesn't
do it well, and I don't have the ability to adjust it.  At least with a
perl script, I can probably tweak it to meet my needs.

Thanks.

--hymie!    http://lactose.homelinux.net/~hymie    hymie@lactose.homelinux.net
-------------------------------------------------------------------------------


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

Date: Thu, 10 Feb 2011 18:28:25 +0100
From: Mart van de Wege <mvdwege@mail.com>
Subject: Re: table --> pre?
Message-Id: <86y65nre86.fsf@gareth.avalon.lan>

hymie@lactose.homelinux.net (hymie!) writes:

> Greetings.
>
> Can somebody recommend to me a perl script or a perl module that
> takes an HTML-formatted <table> and produces a space-formatted
> output that would be suitable for use within a <pre> tag?
>
I use Text::FormatTable to create those kind of text-only formatted
tables.

Mart
-- 
"We will need a longer wall when the revolution comes."
    --- AJS, quoting an uncertain source.


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

Date: Thu, 10 Feb 2011 09:28:11 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: table --> pre?
Message-Id: <bqjd28x719.ln2@goaway.wombat.san-francisco.ca.us>

On 2011-02-10, hymie! <hymie@lactose.homelinux.net> wrote:
>
> Can somebody recommend to me a perl script or a perl module that
> takes an HTML-formatted <table> and produces a space-formatted
> output that would be suitable for use within a <pre> tag?

You can use the HTML::TreeBuilder module to parse the HTML, and use a
loop around your table to print it out however you want.  (You might
also look at the HTML::FormatText module, which claims not to support
HTML tables, but might print out something minimal that's still usable.)

--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: 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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 3281
***************************************


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