[25641] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7883 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 15 14:05:43 2005

Date: Tue, 15 Mar 2005 11:05: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           Tue, 15 Mar 2005     Volume: 10 Number: 7883

Today's topics:
    Re: [perl-python] unicode study with unicodedata module <nobull@mail.com>
    Re: [Q]: How to sort first abc, then 123? <tadmc@augustmail.com>
        Can this be more efficient? <Colin@chaplin.me.uk>
    Re: Can this be more efficient? <mritty@gmail.com>
    Re: Can this be more efficient? <Colin@chaplin.me.uk>
    Re: Can this be more efficient? <tadmc@augustmail.com>
    Re: Can this be more efficient? <mritty@gmail.com>
    Re: Can this be more efficient? <vek@station02.ohout.pharmapartners.nl>
    Re: Can this be more efficient? xhoster@gmail.com
    Re: Can this be more efficient? <notvalid@email.com>
    Re: Extract data using Curl Unix Command & Perl Script  <tadmc@augustmail.com>
    Re: How to make a blessable anonymous scalar ref? <socyl@987jk.com.invalid>
    Re: How to make a blessable anonymous scalar ref? (Anno Siegel)
    Re: How to make a blessable anonymous scalar ref? (Anno Siegel)
    Re: How to make a blessable anonymous scalar ref? xhoster@gmail.com
    Re: Is there a perl array for... <spamtrap@dot-app.org>
    Re: Module should not work, but works (Bart Van der Donck)
        perl & corba <pobugfix@peterlink.ru>
    Re: perl & corba <matternc@comcast.net>
    Re: perl & corba <jgibson@mail.arc.nasa.gov>
    Re: perl & corba <pobugfix@peterlink.ru>
    Re: perl & corba <pobugfix@peterlink.ru>
    Re: problem writing to stdin of child process (john)
    Re: problem writing to stdin of child process (john)
    Re: regular expression help with apostrophe <tadmc@augustmail.com>
    Re: regular expression help with apostrophe dmalhotr2001@yahoo.com
    Re: regular expression help with apostrophe <1usa@llenroc.ude.invalid>
    Re: regular expression help with apostrophe dmalhotr2001@yahoo.com
    Re: regular expression help with apostrophe <tzz@lifelogs.com>
    Re: side by side concatenation <tadmc@augustmail.com>
    Re: Win32: How to find out the number of serial ports? <ThomasKratz@REMOVEwebCAPS.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 15 Mar 2005 17:43:52 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: [perl-python] unicode study with unicodedata module
Message-Id: <d176i3$bru$1@sun3.bham.ac.uk>

Xah Lee wrote:

> i don't know what's the state of Perl's unicode.

perldoc perlunicode



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

Date: Tue, 15 Mar 2005 08:54:59 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: [Q]: How to sort first abc, then 123?
Message-Id: <slrnd3dtq3.6bn.tadmc@magna.augustmail.com>

peter pilsl <pilsl@goldfisch.at> wrote:
> HEB wrote:
>> 
>> I'm not sure if the X-No-archive really works, but
>> if it does, I hope I can keep my opinion to myself. :)
>> 
> 
> So then you should not post to usenet, cause its a public place.
> Especially in technical groups the monopolistic google-archive of all 
> usenet-postings is a very important thing, so people dont need to 
> ask/answer the same questions, but simply look up in the archive.


Just in case readers didn't pick it up earlier in this thread:

   Less people will see your question if you set X-No-archive.


I choose to not help folks who are unwilling to go on record,
so my newsreader deletes their posts automatically for me.

I never even see posts that have that header set.


Also, trolls often set it so that evidence of their trollage isn't
there to give up the game when they take it to a new venue.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 15 Mar 2005 14:15:54 -0000
From: "Colin chaplin" <Colin@chaplin.me.uk>
Subject: Can this be more efficient?
Message-Id: <d16qmq$46t$1$8302bc10@news.demon.co.uk>

Hi All

I've got a little quick and dirty perl program that scans through logfiles
for certain words and counts them up. Trouble is, it's quite slow and I was
wondering if you smart chaps could suggest a way of speeding it up. The
logfiles are about 50MB in size, and I'm running it on a reasonably powerful
PC

The Psuedo code is

For each logfile in the directory:
   read into an @rray
   close file
   for each line of array
      do text processing stuff

print results on screen

I've played about with not reading into an array just reading the file line
by line, no obvious change either way

As I said its written using basic perl data types, so I was wondering if
there is a quicker way to store and process this data ?




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

Date: Tue, 15 Mar 2005 14:38:54 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Can this be more efficient?
Message-Id: <2sCZd.916$Ue6.148@trndny04>

"Colin chaplin" <Colin@chaplin.me.uk> wrote in message
news:d16qmq$46t$1$8302bc10@news.demon.co.uk...
> Hi All
>
> I've got a little quick and dirty perl program that scans through
logfiles
> for certain words and counts them up. Trouble is, it's quite slow and
I was
> wondering if you smart chaps could suggest a way of speeding it up.
The
> logfiles are about 50MB in size, and I'm running it on a reasonably
powerful
> PC
>
> The Psuedo code is
>
> For each logfile in the directory:
>    read into an @rray
>    close file
>    for each line of array
>       do text processing stuff
>
> print results on screen
>
> I've played about with not reading into an array just reading the file
line
> by line, no obvious change either way

I don't know about speed efficiency, but this is certainly more
efficient space-wise.

How are you determining "no obvious change"?  Have you used the
Benchmark module?

Also, is there any reason you can't just use grep, rather than entire
perl script?

if you really want Perl...

perl -ne '$words++ if /\bsearchedWord\b/; END { print "$words words
found\n" }' *.log

(note that this assumes the word will only appear a maximum of once per
line.

Paul Lalli



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

Date: Tue, 15 Mar 2005 15:22:41 -0000
From: "Colin chaplin" <Colin@chaplin.me.uk>
Subject: Re: Can this be more efficient?
Message-Id: <d16uk2$9h5$1$8302bc10@news.demon.co.uk>

> >
> > I've got a little quick and dirty perl program that scans through
> logfiles
> > for certain words and counts them up. Trouble is, it's quite slow and
>
> > by line, no obvious change either way
>
> I don't know about speed efficiency, but this is certainly more
> efficient space-wise.
>
> How are you determining "no obvious change"?  Have you used the
> Benchmark module?
>
By the very scientific "gosh this is taking a long time" make-a-cup-of-tea,
tidy-up, "oh it's still going" approach. I was looking for a magic bullet
perhaps that'd make it work in a matter of seconds. Not so much to speed
this up as it's only going to run a few times, but so in future when I do
similar it's better.


> Also, is there any reason you can't just use grep, rather than entire
> perl script?
>

I was being a little brief with my description, there's quite a lot of
pattern matching going on there that I use a function for. Almost do-able in
grep I guess but apart from speed the program works pretty well so I'm happy
to keep with it. Id post it here but I'd probably only get slated for coding
style >:-)

> if you really want Perl...
>
> perl -ne '$words++ if /\bsearchedWord\b/; END { print "$words words
> found\n" }' *.log
>

I can't get that syntax to run from the command line, not sure why (NT
platform "can't find string terminator ' before EOF") but if I understand
the -ne switch it's effectively openinging every file, going through it line
by line, which is pretty much what I'm doing now ?

I did just have a look at $/ but not sure that would help me out.

Thanks for your time!

Colin




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

Date: Tue, 15 Mar 2005 09:28:18 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Can this be more efficient?
Message-Id: <slrnd3dvoi.6np.tadmc@magna.augustmail.com>

Colin chaplin <Colin@chaplin.me.uk> wrote:

> for certain words and counts them up. Trouble is, it's quite slow


> The Psuedo code is
> 
> For each logfile in the directory:
>    read into an @rray
>    close file
>    for each line of array
>       do text processing stuff
> 
> print results on screen


The Psuedo answer is: improve the "do text processing stuff" part.

Of course we can't help you with that, since we cannot see that part...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 15 Mar 2005 16:01:45 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Can this be more efficient?
Message-Id: <JFDZd.2750$jt6.549@trndny07>

"Colin chaplin" <Colin@chaplin.me.uk> wrote in message
news:d16uk2$9h5$1$8302bc10@news.demon.co.uk...
> Paul Lalli wrote
>
> > Also, is there any reason you can't just use grep, rather than
entire
> > perl script?
> >
>
> I was being a little brief with my description,

You should always specify your description as completely as possible.
How else can you expect people to help you do what you want to do?

> there's quite a lot of
> pattern matching going on there that I use a function for. Almost
do-able in
> grep I guess but apart from speed the program works pretty well so I'm
happy
> to keep with it. Id post it here but I'd probably only get slated for
coding
> style >:-)

You say that as though it's a bad thing...

> > if you really want Perl...
> >
> > perl -ne '$words++ if /\bsearchedWord\b/; END { print "$words words
> > found\n" }' *.log
> >
>
> I can't get that syntax to run from the command line, not sure why (NT
> platform "can't find string terminator ' before EOF")

Windows requires args to be delimited by " instead of '.  Which means
you'll have to backslash all the " in the code.

> but if I understand
> the -ne switch it's effectively openinging every file, going through
it line
> by line, which is pretty much what I'm doing now ?

No.  What you said you were currently doing is reading the file line by
line, storing each line onto an array, and then going through the array
line by line.  Quite different.


Paul Lalli



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

Date: 15 Mar 2005 16:08:47 GMT
From: Villy Kruse <vek@station02.ohout.pharmapartners.nl>
Subject: Re: Can this be more efficient?
Message-Id: <slrnd3e24f.282.vek@station02.ohout.pharmapartners.nl>

On Tue, 15 Mar 2005 14:15:54 -0000,
    Colin chaplin <Colin@chaplin.me.uk> wrote:


> Hi All
>
> I've got a little quick and dirty perl program that scans through logfiles
> for certain words and counts them up. Trouble is, it's quite slow and I was
> wondering if you smart chaps could suggest a way of speeding it up. The
> logfiles are about 50MB in size, and I'm running it on a reasonably powerful
> PC
>
> The Psuedo code is
>
> For each logfile in the directory:
>    read into an @rray
>    close file
>    for each line of array
>       do text processing stuff
>
> print results on screen
>

Any reason for first slurping in the entire file and then work on it line
by line?  If you work line by line, do read the file one line at a time;
I would guess that would improve performance.


Villy


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

Date: 15 Mar 2005 16:48:16 GMT
From: xhoster@gmail.com
Subject: Re: Can this be more efficient?
Message-Id: <20050315114816.402$R1@newsreader.com>

"Colin chaplin" <Colin@chaplin.me.uk> wrote:
> Hi All
>
> I've got a little quick and dirty perl program that scans through
> logfiles for certain words and counts them up. Trouble is, it's quite
> slow and I was wondering if you smart chaps could suggest a way of
> speeding it up. The logfiles are about 50MB in size, and I'm running it
> on a reasonably powerful PC
>
> The Psuedo code is
>
> For each logfile in the directory:
>    read into an @rray
>    close file
>    for each line of array
>       do text processing stuff
>
> print results on screen

So, how about not doing the text processing stuff?  If it is still slow,
then you know the slow step is one of the earlier steps.  If not still
slow, you know it is the text processing stuff.  Then you can show is the
real code used to do the part that is slow.  I give us real numbers, so we
can try to replicate the problem.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Tue, 15 Mar 2005 18:46:36 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: Can this be more efficient?
Message-Id: <g4GZd.21999$OU1.21108@newssvr21.news.prodigy.com>

Colin chaplin wrote:
> Id post it here but I'd probably only get slated for coding
> style >:-)

What you're saying is akin to me going to a car mechanic and telling her 
"my car is broken. how do I fix it?" without me allowing her to see the car.

You won't get any useful replies like that. Plus, a little critique of 
your coding style should be a Good Thing (tm).

--Ala


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

Date: Tue, 15 Mar 2005 09:00:41 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Extract data using Curl Unix Command & Perl Script from Webpage
Message-Id: <slrnd3du4p.6bn.tadmc@magna.augustmail.com>

ifiaz <ifiaz@hotmail.com> wrote:


> Thanks Tad,


You are welcome, you can show your gratitude by composing followups properly:

Please do not top-post.

Please do not full-quote.

Please do not quote .sigs.


> I tried using your script for the latest results, and it works like a
> wonder:


That is how ALL of _my_ code works!

heh.


[snip code fragments]


> But, both your version of the script and my version stops after
> processing approx. the 90th student number unconditionally although the
> loop extends beyond that.


It gets all 318 of them when I try it.


> Could you or someone explain why? 


Nope, since I cannot duplicate the problem.

(but I do see that 64 of the regno's return no results,
 invalid registration numbers I assume...
)



[snip 150 lines of TOFU]

-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 15 Mar 2005 16:24:29 +0000 (UTC)
From: kj <socyl@987jk.com.invalid>
Subject: Re: How to make a blessable anonymous scalar ref?
Message-Id: <d1727t$dvn$1@reader1.panix.com>

In <d13hm0$9he$2@mamenchi.zrz.TU-Berlin.DE> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:

>J Krugman  <jkrugman345@yahbitoo.com> wrote in comp.lang.perl.misc:
>> 
>> 
>> 
>> [] and {} are blessable anonymous refs.  I.e., both
>> 
>>  bless [], 'Foo';
>> 
>> and
>> 
>>  bless {}, 'Bar'; 
>> 
>> Is there a way to get a blessable anonymous ref to a scalar?  The
>> typical example of an anonymous scalar ref is something like \3,
>> but if one tries to bless such a ref, the compiler chokes on the 
>> "attempt to modify a read-only value".

>    bless  \ "$_", 'Foo' for 3;


Why do you need the "for 3"?

  bless \"$_", 'Foo'

would a reference to a (possibly empty) string scalar.  No harm in
that.  \"$_" is succinct enough to be a good candidate for idiomhood.
Or else \"$$", \"$]", etc.

kj

-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.


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

Date: 15 Mar 2005 16:41:45 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to make a blessable anonymous scalar ref?
Message-Id: <d17389$koq$1@mamenchi.zrz.TU-Berlin.DE>

J Krugman  <jkrugman345@yahbitoo.com> wrote in comp.lang.perl.misc:
> In <20050314145658.526$uo@newsreader.com> xhoster@gmail.com writes:

> >> Is there a way to get a blessable anonymous ref to a scalar?  The

[...]

> >I see no reason this won't work:
> 
> >bless \\undef, "Foo";
> 
> I like this one a lot.  And also Anno's
> 
>     bless  \ "$_", 'Foo' for 3;
> 
> but I'm mystified by both.  Specifically, I don't understand why
> the following:
> 
>   bless \undef,  'Foo'  ===> Modification of a read-only value attempted
>   bless \\undef, 'Foo'  ===> [ no error ]
>   bless \1,      'Foo'  ===> Modification of a read-only value attempted
>   bless \\1,	 'Foo'  ===> Modification of a read-only value attempted
> 
> Why are the behaviors for undef and 1 different?

I think it shouldn't work in the case of undef either.  A spelled-out
reference is basically a memory address.  It depends on whatever the
reference is taken of and cannot be changed.

> I can only guess at why Anno's idea works.  It looks like interpolation
> causes a new memory location to be created.  But I have never seen
> anything like this documented anywhere, so I'm just guessing wildly.

So am I, I must confess.  I don't know if it is documented anywhere.
I have used it (in variants) for so long, it doesn't bother me anymore.
In a similar way

    for ( qw( fie foe fum) ) {
        $_ .= 'X';
    }

doesn't work, but

    for ( map "$_", qw( fie foe fum) ) {
        $_ .= 'X';
    }

does.

I added "my" solution

    bless  \ "$_", 'Foo' for 3;

in the spirit of TIMTOWTDI, but it has disadvantages.  For one, it doesn't
return a value ("for" doesn't), so if you need the value (you will) it must
be assigned inside the for "loop".  Then you can't declare the variable
right there (not in a modified statement), so it becomes

    my $obj;
    $obj = bless \ "$_", 'Foo' for 3;

If it's the last thing happening in a sub,

    return bless \ "$_", 'Foo' for 3;

is okay, but return is necessary.  In general I'd go with 

    my $obj = bless \ do { my $x }, 'Foo';

The do {} block is optional, but with it you strictly have an anonymous
scalar ref.

Anno


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

Date: 15 Mar 2005 16:47:36 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to make a blessable anonymous scalar ref?
Message-Id: <d173j8$koq$2@mamenchi.zrz.TU-Berlin.DE>

kj  <socyl@987jk.com.invalid> wrote in comp.lang.perl.misc:
> In <d13hm0$9he$2@mamenchi.zrz.TU-Berlin.DE>
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:

[...]

> >    bless  \ "$_", 'Foo' for 3;
> 
> Why do you need the "for 3"?

It gives a working equivalent of "bless \ 3, 'Foo'".  "for" isn't needed.

Anno


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

Date: 15 Mar 2005 17:04:41 GMT
From: xhoster@gmail.com
Subject: Re: How to make a blessable anonymous scalar ref?
Message-Id: <20050315120441.273$W2@newsreader.com>

J Krugman <jkrugman345@yahbitoo.com> wrote:
>
>   bless \undef,  'Foo'  ===> Modification of a read-only value attempted
>   bless \\undef, 'Foo'  ===> [ no error ]
>   bless \1,      'Foo'  ===> Modification of a read-only value attempted
>   bless \\1,     'Foo'  ===> Modification of a read-only value attempted
>
> Why are the behaviors for undef and 1 different?

I don't know why they behave the precise way they do, but I can rationalize
why they don't behave the same way.  1 is a constant, while undef is
actually a function invokation, even thought it is often used as if it were
a constant.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Tue, 15 Mar 2005 11:21:46 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Is there a perl array for...
Message-Id: <CNKdnax4nZYBlqrfRVn-rQ@adelphia.com>

advice please wireless 802.11 on RH8 wrote:

> No, I meant an array to contain matches such as for:
> 
>    $_ = 'cat  12  Felix  17 Anytown NY';
> 
>    print "yes!"\n" if /^(cat|dog)\s+(\d+)\s+(\w+)\s+(\d+)/;
> # this mystery array would now contain qw(cat 12 Felix 17)
> 
>   ---------------------------------------
> 
> It seems to me this would be common enough to store as a system array
> somewhere? By system array I mean one like @_ or @ARGV, etc.. ,
> something created for us by Perl...

Like I said before, just assign the results of the comparison to any array
you like:

    #!/usr/bin/perl

    use warnings;
    use strict;

    my @animals = ('cat 12 Felix', 'horse 20 Ed');

    foreach (@animals) {
        if (my @matches = /^(cat|dog)\s+(\d+)\s+(\w+)/) {
            print join(',', @matches), "\n";
        }
        if (my ($species, $age, $name) = /^(cat|dog)\s+(\d+)\s+(\w+)/) {
            print "Name=$name, age=$age, species=$species\n";
        }
    }

Why are you so insistent on a built-in array, anyway? I can understand being
lazy, but c'mon - is typing "my @matches = " such a hardship???

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: 15 Mar 2005 08:12:05 -0800
From: bart@nijlen.com (Bart Van der Donck)
Subject: Re: Module should not work, but works
Message-Id: <b5884818.0503150812.c605f1d@posting.google.com>

Arne Ruhnau wrote:

> Maybe you misinterpret the filename and the packagename, which happen to 
> be different?

Yes this one - I have always worked with same names there.

Bart


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

Date: Tue, 15 Mar 2005 18:43:25 +0000
From: Andrew Tkachenko <pobugfix@peterlink.ru>
Subject: perl & corba
Message-Id: <d16vuh$hmt$1@news.rol.ru>

Hello.
I'm sure it is offtopic, but I was absolutely unsuccessfull
looking for suitable response in "non-perl community". I have lots of code
written in perl, and now I came to neccessity to use corba as middleware
between perl, java and probably C++ clients/servers. After 2 weeks of
research I've found that there is no good IDL binding for perl. So, the
question is - does anybody has experience in developing corba
client/servers in perl nowadays? Does anybody use it (or plan to use) in
some serious projects ?
I'd greatly appreciate any hints and directions.

P.S. please don't point me to comp.object.corba newsgroup - I've been there
too.

Thanks for advance.
-- 
Andrew


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

Date: Tue, 15 Mar 2005 12:00:58 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: perl & corba
Message-Id: <AsmdnTkYbpNXiarfRVn-tg@comcast.com>

Andrew Tkachenko wrote:

> Hello.
> I'm sure it is offtopic, but I was absolutely unsuccessfull
> looking for suitable response in "non-perl community". I have lots of code
> written in perl, and now I came to neccessity to use corba as middleware
> between perl, java and probably C++ clients/servers. After 2 weeks of
> research I've found that there is no good IDL binding for perl. So, the
> question is - does anybody has experience in developing corba
> client/servers in perl nowadays? Does anybody use it (or plan to use) in
> some serious projects ?
> I'd greatly appreciate any hints and directions.
> 
> P.S. please don't point me to comp.object.corba newsgroup - I've been
> there too.
> 
> Thanks for advance.

You mean to say that *none* of 119 search results for CORBA I found on
search.cpan.org were any help?  Although I will admit, I was less than
impressed when I found out the CORBA Perl Mailinglist had a blank
homepage...
-- 
             Christopher Mattern

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


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

Date: Tue, 15 Mar 2005 09:16:12 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: perl & corba
Message-Id: <150320050916129309%jgibson@mail.arc.nasa.gov>

In article <d16vuh$hmt$1@news.rol.ru>, Andrew Tkachenko
<pobugfix@peterlink.ru> wrote:

> Hello.
> I'm sure it is offtopic, but I was absolutely unsuccessfull
> looking for suitable response in "non-perl community". I have lots of code
> written in perl, and now I came to neccessity to use corba as middleware
> between perl, java and probably C++ clients/servers. After 2 weeks of
> research I've found that there is no good IDL binding for perl. So, the
> question is - does anybody has experience in developing corba
> client/servers in perl nowadays? Does anybody use it (or plan to use) in
> some serious projects ?
> I'd greatly appreciate any hints and directions.
> 
> P.S. please don't point me to comp.object.corba newsgroup - I've been there
> too.

Perhaps one of the forty CORBA modules on CPAN might be useful. See
<http://search.cpan.org>.

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----


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

Date: Tue, 15 Mar 2005 20:32:23 +0000
From: Andrew Tkachenko <pobugfix@peterlink.ru>
Subject: Re: perl & corba
Message-Id: <d176ar$jah$2@news.rol.ru>

Jim Gibson wrote on 15 Март 2005 17:16:

> In article <d16vuh$hmt$1@news.rol.ru>, Andrew Tkachenko
> <pobugfix@peterlink.ru> wrote:
> 
>> Hello.
>> I'm sure it is offtopic, but I was absolutely unsuccessfull
>> looking for suitable response in "non-perl community". I have lots of
code
>> written in perl, and now I came to neccessity to use corba as middleware
>> between perl, java and probably C++ clients/servers. After 2 weeks of
>> research I've found that there is no good IDL binding for perl. So, the
>> question is - does anybody has experience in developing corba
>> client/servers in perl nowadays? Does anybody use it (or plan to use) in
>> some serious projects ?
>> I'd greatly appreciate any hints and directions.
>> 
>> P.S. please don't point me to comp.object.corba newsgroup - I've been
there
>> too.
> 
> Perhaps one of the forty CORBA modules on CPAN might be useful. See
> <http://search.cpan.org>.
> 

No, thanks. As i said above, I'm looking for points from people who use perl
bindings in their projects. IMHO except MICO and ORBit bindings the rest
are not supported and all and useful just for home work rather than for
serious proj.

Thanks.

-- 
Andrew


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

Date: Tue, 15 Mar 2005 20:26:55 +0000
From: Andrew Tkachenko <pobugfix@peterlink.ru>
Subject: Re: perl & corba
Message-Id: <d1760j$jah$1@news.rol.ru>

All of them generally point to MICO and ORBit - both mappings were written
by he same authors. I'm asking not for tutorial on playing with google and
span search. I ask for comments form people who use corba with perl in
their projects. 

Thanks

Chris Mattern wrote on 15 Март 2005 17:00:

> Andrew Tkachenko wrote:
> 
>> Hello.
>> I'm sure it is offtopic, but I was absolutely unsuccessfull
>> looking for suitable response in "non-perl community". I have lots of
code
>> written in perl, and now I came to neccessity to use corba as middleware
>> between perl, java and probably C++ clients/servers. After 2 weeks of
>> research I've found that there is no good IDL binding for perl. So, the
>> question is - does anybody has experience in developing corba
>> client/servers in perl nowadays? Does anybody use it (or plan to use) in
>> some serious projects ?
>> I'd greatly appreciate any hints and directions.
>> 
>> P.S. please don't point me to comp.object.corba newsgroup - I've been
>> there too.
>> 
>> Thanks for advance.
> 
> You mean to say that *none* of 119 search results for CORBA I found on
> search.cpan.org were any help?  Although I will admit, I was less than
> impressed when I found out the CORBA Perl Mailinglist had a blank
> homepage...

-- 
Andrew


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

Date: 15 Mar 2005 07:58:21 -0800
From: lqueryvg@gmail.com (john)
Subject: Re: problem writing to stdin of child process
Message-Id: <9190653e.0503150758.1ce23090@posting.google.com>

lqueryvg@gmail.com (john) wrote in message news:<9190653e.0503150246.43158967@posting.google.com>...
> Big and Blue <No_4@dsl.pipex.com> wrote in message news:<IcCdnUFCopeG3avfRVnysA@pipex.net>...
> > john wrote:
> > 
> > > #!/usr/bin/perl
> > > use strict;
> > > use warnings;
> > > 
> > > use IO::Handle;
> > > use IO::Pipe;
> > > 
> > > my $cr = IO::Handle->new();     # child reader
> > > my $pw = IO::Handle->new();     # child writer
> > > 
> > > new IO::Pipe($cr, $pw) or die 'pr/cw pipe';
> > 
> >     Have you read the IO::Pipe documentation?
> > (e.g. http://search.cpan.org/~nwclark/perl-5.8.6/ext/IO/lib/IO/Pipe.pm)
> > 
> >     It starts with (almost) exactly what you want under the SYNOPSIS.  (It 
> > has the child writing to the parent - just swap the if/else codew blocks).
> 
> I've seen this on my travels, but for some reason it didn't sink in
> that this was what I needed. Terms such as "re-blessed" confuse me and
> I've been sticking to stuff that I *thought* I understood. Anyway
> you're right. This is exactly what I need and it'll make my code a lot
> neater. I was going to post the modified and working testcase, however
> it's so close to the example in the IO:Pipe doc that there doesn't
> seem much point.
> 
> > 
> >     No need to mention IO::Handle (IO::Pipe gets them for you).
> 
> I'm using autoflush in my larger program, but you're right; it's not
> needed in this testcase.
> 
> > 
> > 
> > >   my $fd = fileno($cr);
> > >   open(my $stdin, "<", \$fd) or die "STDIN open: $!";
> > >   *STDIN = $stdin;
> > > 
> > >   my $line = <STDIN>;   # hopefully reading from the parent
> > 
> >     Not sure why you would want to do this anyway.  You shouldn't be 
> > reading from STDIN - you want to read from the read-side of the pipe opened 
> > in the parent.  Don't assume that just because your want to read from it 
> > you have to make it STDIN.  STDIN is "STanDard INput" - reading from a pipe 
> > isn't "standard" in this sense.
> 
> The children will each exec an external command which will read from
> stdin, and the parent has to manage sending data to each.
> 
> Thanks for your help "Big and Blue".


Sorry, I spoke too soon. I'm still left with my original problem of
how to attach the pipe to STDIN of the child. The various approaches
I've tried either raise an invalid argument error or the child appears
to read the number of the file descriptor rather than the data.


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

Date: 15 Mar 2005 08:56:16 -0800
From: lqueryvg@gmail.com (john)
Subject: Re: problem writing to stdin of child process
Message-Id: <9190653e.0503150856.21d3f0ff@posting.google.com>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<d16ekt$5mo$1@mamenchi.zrz.TU-Berlin.DE>...
> john <lqueryvg@gmail.com> wrote in comp.lang.perl.misc:
> > Hello everyone,
> > 
> > I have a program which forks multiple children and needs to have
> > bidirectional communication with each child. Each child needs to use
> > STDIN and STDOUT to talk back to the parent.
> 
> Have you considered IPC::Open2?
> 
> Anno

This is close to what I want because it connects the reader and writer
filehandles to STDIN and STDOUT of the child, however I wanted to
control the exec of the child myself, so that I could have a test
harness within the same program file which simulates the child
behaviour.

I still don't understand why what I'm trying to do doesn't work but if
no-one has any better ideas I'll try with IPC::Open2 (or maybe Open3
if I need STDERR) as suggested.

Thanks for tip.


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

Date: Tue, 15 Mar 2005 07:43:08 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: regular expression help with apostrophe
Message-Id: <slrnd3dpjb.6bn.tadmc@magna.augustmail.com>

Peter Wyzl <wyzelli@yahoo.com> wrote:
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnd3cog8.52n.tadmc@magna.augustmail.com...
>> dmalhotr2001@yahoo.com <dmalhotr2001@yahoo.com> wrote:


>> > I would want it to ignore it if Local's Settings folder has an
>> > apostrophe.
>>
>>
>> What is a Local's Settings folder?
> 
> That is like asking "What is a /usr/var directory?"
> 
> Whilst not a direct equivalent, it is a common enough environment to be
> accepted as known by any competent windows user.


But I am an incompetent windows user, so I though I might
learn some(off-topic)thing:

Does windows have a way to specify the characters allowed in pathnames?

That's what it sounded like to me...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 15 Mar 2005 09:08:28 -0800
From: dmalhotr2001@yahoo.com
Subject: Re: regular expression help with apostrophe
Message-Id: <1110906507.977082.212230@g14g2000cwa.googlegroups.com>

Jesus christ,

You guys are overthinking this to death.  keep the thing simple

c:\testing's folder\filename.ext

I want a regular expression to ignore the above because - testing's
folder is a directory.

But if its:

C:\testing folder\what's_up.ext

I want the regular expression to yield.

Any questions??



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

Date: Tue, 15 Mar 2005 17:16:00 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: regular expression help with apostrophe
Message-Id: <Xns961A7CCA7B76Basu1cornelledu@127.0.0.1>

dmalhotr2001@yahoo.com wrote in news:1110906507.977082.212230
@g14g2000cwa.googlegroups.com:

> Jesus christ,
>
> 
> You guys are overthinking this to death.  

And you are in a position to judge how?

> keep the thing simple
> 
> c:\testing's folder\filename.ext
> 
> I want a regular expression to ignore the above because - testing's
> folder is a directory.

Here is what you originally stated:

<blockquote>
I have a regular expression [^\']+ that checks whether there's a
apostrophe in a particular string.  In my case I'm using a file path
and filename so for example.
</blockquote>

The requirement you set out in this message does not match the original 
requirement.

In any case, Peter pointed you to File::Basename. Have you not read the 
documentation for that module yet.

Using that module, split the string into the various components. You 
will be interested in one of those components I presume. Then, check if 
that string contains an apostrophe.

If you are only interested in the existence of a single character in a 
string, you should also look at:

perldoc -f index

> I want the regular expression to yield.
> 
> Any questions??

*PLONK*


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

Date: 15 Mar 2005 09:23:06 -0800
From: dmalhotr2001@yahoo.com
Subject: Re: regular expression help with apostrophe
Message-Id: <1110907386.358792.160870@f14g2000cwb.googlegroups.com>

Thanks, thats exactly what i needed.

:D



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

Date: Tue, 15 Mar 2005 13:02:36 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: regular expression help with apostrophe
Message-Id: <4n1xag23er.fsf@lifelogs.com>

On Mon, 14 Mar 2005, tadmc@augustmail.com wrote:

> Regular expressions do not "yield" characters.
> 
> They either match (succeed), or they don't match (fail).

This is not always true, e.g.

perl -n -e '@all = m/(.)/g; print @all'

to give a simple example of a regex that returns characters.  Maybe I
misunderstood your intent, Tad.

Ted


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

Date: Tue, 15 Mar 2005 08:43:35 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: side by side concatenation
Message-Id: <slrnd3dt4n.6bn.tadmc@magna.augustmail.com>

man.postman@gmail.com <man.postman@gmail.com> wrote:
> I have an output
> 
> RowId  Col1 Col2 Col3
> ..
> ..
> ..
> ..
> 
> 
> --------------------------------------
> 
> RowId   Col4 Col5 Col6
> 
> ...
> ..
> ..
> 
> -----------------------------------------
> 
> I am trying to write a perl script to make it..
> 
> Row Id Col1 Col2 Col3 Col4 Col5 Col6
> 
> any advice???



Here is a program that does that:

===================================================
#!/usr/bin/perl
use warnings;
use strict;

my $output = 'RowId  Col1 Col2 Col3
 ..
 ..
 ..
 ..


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

RowId   Col4 Col5 Col6

 ...
 ..
 ..

-----------------------------------------
';

$output =~ s/RowId/Row Id/;
$output =~ s/RowId//;
$output =~ tr/a-zA-Z0-9/ /cs;

print "$output\n";
===================================================


> thanks to everyone who responds....


You're welcome.

Have you seen the Posting Guidelines that are posted here frequently?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 15 Mar 2005 17:07:31 +0100
From: Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de>
Subject: Re: Win32: How to find out the number of serial ports?
Message-Id: <42370842$0$18084$bb690d87@news.main-rheiner.de>

Josef Moellers wrote:
> Hi,
> 
> I'm helping a friend revive some old hardware (a timekeeping device 
> using smart cards). I've sorted out all the communications details (ISO 
> 7816) and most of it is working fine. The program is written in (you 
> guessed it) Perl using Win32::API and Serial-Port.
> 
> Now I'd like to add a feature to scan the serial ports for the device, 
> but rather than assume that any modern PC has 2 serial ports, I'd like 
> to determine exactly how many serial ports the current system supports.
> 
> I've looked at the Registry, but that only carried some information 
> about the serial ports (if you know which ports you have, you can find 
> out more). A colleague suggested something like cfgmgr, but there 
> doesn't seem to be a module for this.
> 
> Under a more familiar OS, I'd look at /proc/tty/driver/serial, but on XP?

Here's a way using the WMI interface. I guess you could do the same by 
going through the registry after resolving a bunch of cryptic device_ids, 
but this is a case where WMI actually saves time and nerves.

use strict;
use warnings;

use Win32::OLE qw/in/;
   Win32::OLE->Option(Warn => 1);

my $wmi = Win32::OLE->GetObject(
    "winmgmts:{impersonationLevel=impersonate,(security)}"
) or die
    "error initializing WMI interface, ",
    Win32::OLE->LastError;

print $_->{DeviceID}, "\n"
    for in($wmi->InstancesOf('Win32_SerialPort'));

If you need more information about the properties of the serial port, get 
the "WMI Object Browser" with the free "WMI Tools" from M$.

Thomas

-- 
$/=$,,$_=<DATA>,s,(.*),$1,see;__END__
s,^(.*\043),,mg,@_=map{[split'']}split;{#>J~.>_an~>>e~......>r~
$_=$_[$%][$"];y,<~>^,-++-,?{$/=--$|?'"':#..u.t.^.o.P.r.>ha~.e..
'%',s,(.),\$$/$1=1,,$;=$_}:/\w/?{y,_, ,,#..>s^~ht<._..._..c....
print}:y,.,,||last,,,,,,$_=$;;eval,redo}#.....>.e.r^.>l^..>k^.-


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

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


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