[28126] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9490 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 17 18:05:32 2006

Date: Mon, 17 Jul 2006 15:05:04 -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, 17 Jul 2006     Volume: 10 Number: 9490

Today's topics:
    Re: Cool Ebooks Site bigskipster@gmail.com
    Re: Cool Ebooks Site <sigzero@gmail.com>
    Re: Cool Ebooks Site <1usa@llenroc.ude.invalid>
        Free Advertisement! Dan2837@gmail.com
    Re: Interfacing with Matlab using Win32::OLE <fleming.scott@gmail.com>
    Re: Interfacing with Matlab using Win32::OLE <benmorrow@tiscali.co.uk>
    Re: Net::Telnet - Library Application <laff7430@bellsouth.net>
    Re: Net::Telnet - Library Application <hjp-usenet2@hjp.at>
        Perl Problem Resolution Checklist (was Re: Perl equival <tadmc@augustmail.com>
    Re: skip path prune <mritty@gmail.com>
    Re: What is a type error? [correction] <david.nospam.hopwood@blueyonder.co.uk>
    Re: What is a type error? [correction] <dnew@san.rr.com>
    Re: What is a type error? [correction] <dnew@san.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 17 Jul 2006 11:17:39 -0700
From: bigskipster@gmail.com
Subject: Re: Cool Ebooks Site
Message-Id: <1153160259.044637.126000@b28g2000cwb.googlegroups.com>


Robert Hicks wrote:
> bigskipster@gmail.com wrote:
> > http://cooldogebooks.blogspot.com
> >
> >
> > Submit your comments because I need them!
> >
>
> My comment would be that you need some ethics training.
>
> Robert

Robert Hicks

With that name you are of the ancestors of hillbilies. You do realize
the hillbillies are not very smart?

If you have any problems please notifity google for they are where I
find my links from.

Thank You



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

Date: 17 Jul 2006 14:39:16 -0700
From: "Robert Hicks" <sigzero@gmail.com>
Subject: Re: Cool Ebooks Site
Message-Id: <1153172356.536460.42490@p79g2000cwp.googlegroups.com>


bigskipster@gmail.com wrote:
> Robert Hicks wrote:
> > bigskipster@gmail.com wrote:
> > > http://cooldogebooks.blogspot.com
> > >
> > >
> > > Submit your comments because I need them!
> > >
> >
> > My comment would be that you need some ethics training.
> >
> > Robert
>
> Robert Hicks
>
> With that name you are of the ancestors of hillbilies. You do realize
> the hillbillies are not very smart?
>
> If you have any problems please notifity google for they are where I
> find my links from.
>
> Thank You

Yes, that makes it Google's fault doesn't it. Let's apply that logic to
everything and see where it leads. You do know what logic is don't you?

Robert



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

Date: Mon, 17 Jul 2006 22:01:04 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Cool Ebooks Site
Message-Id: <Xns9803B760CA22asu1cornelledu@127.0.0.1>

"Robert Hicks" <sigzero@gmail.com> wrote in
news:1153172356.536460.42490@p79g2000cwp.googlegroups.com: 

> 
> bigskipster@gmail.com wrote:
>> Robert Hicks wrote:
>> > bigskipster@gmail.com wrote:
 ...
>> > > Submit your comments because I need them!
>> > >
>> >
>> > My comment would be that you need some ethics training.

 ...

>> With that name you are of the ancestors of hillbilies. You do realize
>> the hillbillies are not very smart?
 ...

>> You do know what logic is don't you? 

I think we would all appreciate it if you did not engage the spamming 
troll. A more effective strategy is to complain to Google. He is posting 
from a Gmail account, and blogspot is owned by Google.

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: Mon, 17 Jul 2006 21:13:18 GMT
From: Dan2837@gmail.com
Subject: Free Advertisement!
Message-Id: <O3Tug.51451$e77.44999@tornado.texas.rr.com>

www.get-free-advertisement.com
www.have-bad-credit.com



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

Date: 17 Jul 2006 12:54:50 -0700
From: "scottmf" <fleming.scott@gmail.com>
Subject: Re: Interfacing with Matlab using Win32::OLE
Message-Id: <1153166090.443043.246500@m73g2000cwd.googlegroups.com>

> OK... again, my knowledge of COM+ is not good, but...
>
> Firstly, in the common case that there is only one instance of matlab
> running then GetActiveObject will do the right thing.
>
> If you don't trust that, then as far as I can understand from OLE.xs and
> MSDN
>
>     my $ml_file = $ARGV[0];
>     my $ML = Win32::OLE->GetObject($ml_file)
>         or die "can't get a handle on '$ml_file'";
>
> should allow you to invoke Perl passing it the current filename, and
> will use the currently open instance of that file, if any, or open it in
> a currently running matlab, if any, or create a new matlab editing that
> file. That is, it gets a handle on that file somehow; and I'm *pretty*
> sure that if you have it opened and unsaved you get that instance rather
> than a new instance from the file. Try it and see (I can't, having
> neither matlab nor win32 :) ).

I tried using MS Excel to check and see if it functions differently
from Matlab and found that if I have an Excel file open

    my $Count;
    $Count = Win32::OLE->EnumAllObjects(sub {
        my $Object = shift;
        my $Class = Win32::OLE->QueryObjectType($Object);
        printf "# Object=%s Class=%s\n", $Object, $Class;
    });
    print "Found $Count OLE Object(s)\n";

Still finds no OLE objects

but:

  my $file = "C:\\MATLAB6p5\\work\\Book1.xls";
  my $ML = Win32::OLE->GetObject($file)
      or print "can't get a handle on '$file'";
  print "$ML\n";

Finds the OLE object just fine!!  I'm not sure why passing the filename
specifically allows it to find the object, but asking for a listing of
all OLE objects using EnumAllObjects does not work??

As far as Matlab goes, if I have my perl_link.m file open in the matlab
program editor (just a text editor in matlab), or if I run perl_link.m
in matlab, and this runs my perl script:

  my $Count;
  $Count = Win32::OLE->EnumAllObjects(sub {
      my $Object = shift;
      my $Class = Win32::OLE->QueryObjectType($Object);
      printf "# Object=%s Class=%s\n", $Object, $Class;
  });
  print "Found $Count OLE Object(s)\n";

finds 0 OLE objects (the same as with MS Excel), but unlike excel:

  my $file = "C:\\MATLAB6p5\\work\\perl_link.m";
  my $ML = Win32::OLE->GetObject($file)
      or print "can't get a handle on '$file'\n";

Returns the following:

Win32::OLE(0.1601) error 0x800401e6: "Bad extension for file" at
test.pl line 22
	eval {...} called at test.pl line 22
can't get a handle on 'C:\MATLAB6p5\work\perl_link.m'

I'm not sure exactly what this error is, or why ".m" is a "bad
extension for file".  I'm wondering (Not knowing much about OLE) if
there is some way for a program to start without this turned on, and
that is why perl is not finding the active instance of matlab??

Any other suggestions on ways I might be able to go about doing this
before I go ahead and try temp files??  

Thanks,
~Scott



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

Date: Mon, 17 Jul 2006 21:24:33 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: Interfacing with Matlab using Win32::OLE
Message-Id: <198to3-ne6.ln1@osiris.mauzo.dyndns.org>


Quoth "scottmf" <fleming.scott@gmail.com>:
> > OK... again, my knowledge of COM+ is not good, but...
> >
> > Firstly, in the common case that there is only one instance of matlab
> > running then GetActiveObject will do the right thing.
> >
> > If you don't trust that, then as far as I can understand from OLE.xs and
> > MSDN
> >
> >     my $ml_file = $ARGV[0];
> >     my $ML = Win32::OLE->GetObject($ml_file)
> >         or die "can't get a handle on '$ml_file'";
> >
> > should allow you to invoke Perl passing it the current filename, and
> > will use the currently open instance of that file, if any, or open it in
> > a currently running matlab, if any, or create a new matlab editing that
> > file. That is, it gets a handle on that file somehow; and I'm *pretty*
> > sure that if you have it opened and unsaved you get that instance rather
> > than a new instance from the file. Try it and see (I can't, having
> > neither matlab nor win32 :) ).
> 
> I tried using MS Excel to check and see if it functions differently
> from Matlab and found that if I have an Excel file open
> 
>     my $Count;
>     $Count = Win32::OLE->EnumAllObjects(sub {
>         my $Object = shift;
>         my $Class = Win32::OLE->QueryObjectType($Object);
>         printf "# Object=%s Class=%s\n", $Object, $Class;
>     });
>     print "Found $Count OLE Object(s)\n";
> 
> Still finds no OLE objects

Well, no. It's not supposed to. I admit the docs for Win32::OLE are not
entirely clear, but EnumAllObjects enumerates all OLE objects that have
been bound to Perl objects in this program, so you can do various sorts
of cleanup if you need to. It certainly doesn't attempt to enumerate all
the OLE objects on the system: that would produce quite a list ! The
docs say it's mostly for debugging.

> but:
> 
>   my $file = "C:\\MATLAB6p5\\work\\Book1.xls";
>   my $ML = Win32::OLE->GetObject($file)
>       or print "can't get a handle on '$file'";
>   print "$ML\n";
> 
> Finds the OLE object just fine!!  I'm not sure why passing the filename
> specifically allows it to find the object, but asking for a listing of
> all OLE objects using EnumAllObjects does not work??
> 
> As far as Matlab goes, if I have my perl_link.m file open in the matlab
> program editor (just a text editor in matlab), or if I run perl_link.m
> in matlab, and this runs my perl script:
> 
>   my $Count;
>   $Count = Win32::OLE->EnumAllObjects(sub {
>       my $Object = shift;
>       my $Class = Win32::OLE->QueryObjectType($Object);
>       printf "# Object=%s Class=%s\n", $Object, $Class;
>   });
>   print "Found $Count OLE Object(s)\n";
> 
> finds 0 OLE objects (the same as with MS Excel), but unlike excel:

Well, yes, again :).

>   my $file = "C:\\MATLAB6p5\\work\\perl_link.m";
>   my $ML = Win32::OLE->GetObject($file)
>       or print "can't get a handle on '$file'\n";
> 
> Returns the following:
> 
> Win32::OLE(0.1601) error 0x800401e6: "Bad extension for file" at
> test.pl line 22
> 	eval {...} called at test.pl line 22
> can't get a handle on 'C:\MATLAB6p5\work\perl_link.m'

Hmm... 0x800401e6 is MK_E_INVALIDEXTENSION, which means (basically) that
 .m is not properly registered to Matlab. Maybe Matlab doesn't support
OLE objects for individual files? Alternatively, is there any way you
can get an OLE moniker for the current document from your matlab macro?
I've no idea if matlab-macro has any support for OLE stuff, but
essentially you want to call IMoniker::GetDisplayName on the current
document object...

> I'm not sure exactly what this error is, or why ".m" is a "bad
> extension for file".  I'm wondering (Not knowing much about OLE) if
> there is some way for a program to start without this turned on, and
> that is why perl is not finding the active instance of matlab??

I don't really understand what you're asking here...

> Any other suggestions on ways I might be able to go about doing this
> before I go ahead and try temp files??  

As I said before,

> > Firstly, in the common case that there is only one instance of matlab
> > running then GetActiveObject will do the right thing.

Ben

-- 
Every twenty-four hours about 34k children die from the effects of poverty.
Meanwhile, the latest estimate is that 2800 people died on 9/11, so it's like
that image, that ghastly, grey-billowing, double-barrelled fall, repeated
twelve times every day. Full of children. [Iain Banks]  benmorrow@tiscali.co.uk


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

Date: Mon, 17 Jul 2006 14:48:04 -0400
From: Carl Lafferty <laff7430@bellsouth.net>
Subject: Re: Net::Telnet - Library Application
Message-Id: <%WQug.5978$IB.2118@bignews1.bellsouth.net>

Dr.Ruud wrote:
> Carl Lafferty schreef:
> 
>>>         ($info) = $galaxy->waitfor('/\\\b/');
>> worked like a charm!!
>> Thank you!!!!!!!
> 
> You're welcome. In the mean time I have read some of the documentation
> of the module, which says that you can give either a string or a regex
> to waitfor(). If the extra interpolation only happens with regexes, just
> waitfor("\x5C\x62") might work as well.
> 
I tried that and it didn't work.  I tried the single quotes you 
suggested and it worked like a charm.

ANy idea on how to get it to read x characters from the buffer with no 
delimiter???

I THINK I can fake a delimiter if I can use an expression to check 
between different things it CAN be.  Some may end in 'ion' or may be 
'fic'....



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

Date: Mon, 17 Jul 2006 23:15:33 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Net::Telnet - Library Application
Message-Id: <pan.2006.07.17.21.15.32.962072@hjp.at>

On Mon, 17 Jul 2006 12:44:46 +0200, Stephan Titard wrote:

> Joe Smith escribió:
>> Stephan Titard wrote:
>>> robic0 escribió:
>>>> 759 lines
>>>
>>> I have used for years the telnet module and never experienced any problem
>> 
>> Did you _HAVE_ to quote the entire article?  All 759 lines of it?
> Sorry, I did not even notice there was so much code in there. I usually 
> keep all of the context (and I have my newsgroup client setup this way 
> actually, which I realize is not a good idea...will need something better)

The setup of your client has little to do with it. Your client doesn't
understand the text you quote and cannot know what it relevant to your
answer and what isn't. You have to decide that and trim the irrelevant
parts.

See the section "use an effective followup style" in the guidelines for
details.


> does this also mean I should not post 2*759 code lines?

You probably shouldn't even post 1*759 code lines. This is a discussion
group, not a source code archive (we have CPAN for that). What point in
a discussion needs hundreds of lines of code to illustrate? And who is
going to read that?

> common sense should apply, I guess

Right.

	hp

-- 
   _  | Peter J. Holzer    | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR       | > ist?
| |   | hjp@hjp.at         | Was sonst wäre der Sinn des Erfindens?
__/   | http://www.hjp.at/ |	-- P. Einstein u. V. Gringmuth in desd



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

Date: Mon, 17 Jul 2006 13:55:55 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Perl Problem Resolution Checklist (was Re: Perl equivalent of this script?)
Message-Id: <slrnebnn9r.14o.tadmc@magna.augustmail.com>

Ted Zlatanov <tzz@lifelogs.com> wrote:
> On 17 Jul 2006, tadmc@augustmail.com wrote:
> 
> Paul Lalli <mritty@gmail.com> wrote: 
>> george.varsamopoulos@gmail.com wrote: 
>>> Tad McClellan wrote:
>>>>> You didn't even look in the Perl FAQ? That's not very nice.
>>>
>>>> I tried to "google" for it,
>>
>>> Allow me to suggest that when looking for assistance with Perl, Google
>>> be your *last* resort, not your first.  
>>
>> Allow me to suggest that when looking for assistance with Perl,
>> posting to a Usenet newgroup be your last resort.  :-)
> 
> I don't think you worded that well, Tad.  


I was trying to say that Google is not a last resort, since it
should come before posting to Usenet.


> Are you saying the OP should
> buy a book on Perl, look at the Perl source code, e-mail Larry Wall,
> etc. before he asks for help here?  


No. Let me try it again:

   Allow me to suggest that when looking for assistance with Perl,
   posting to a Usenet newgroup be something you do only after
   searching the std docs and a Usenet archive.

That is a paraphrasing of a Perl Problem Resolution Checklist
that I post from time to time.

<... time passes ...>

Golly! It looks like I haven't posted it since 2001,
so here it is again:


----------------------------------
Perl problem resolution checklist:
----------------------------------

1) check the Perl FAQs

   (word search with "perldoc -q". Or better, find where the
    *.pod's are on your system, and word search (grep) the
    entire contents of the files)

2) expand the above to _all_ of the standard *.pod files.

3) check a Usenet archive such as:

      http://groups.google.com/advanced_group_search

4) check books and websites (this step is optional)

5) write a Usenet article, but don't post it yet!

   5a) make a small and complete (including data) program that
       people can execute that shows your problem.

   5b) state how the program's output is not what you want. Describe
       what you want.

   5c) repeat steps 1-4 using search terms taken from your description
       of the problem or your Subject header (try some synonyms for
       the terms also)

6) Give up on a quick answer. Post to Usenet for a slow answer.

7) wait hours/days/forever for followups with answers rather than
   than the 5 or 10 minutes it would have taken if steps 1-3
   had worked.

8) Wonder at the quality of the answers given, rather than know
   it is a peer-reviewed, validated answer if steps 1-2 had worked.

9) Repeat steps 1-3 many times for many problems. You will seldom
   get past step 3, and even less often get past step 5a.

10) Now that you know so much, go *answer* some questions on Usenet  :-)


-----

To help with 1 and 2 above, I make "headlines" files to grep in,
because sometimes there is Too Much Information when grepping
the entire bodies:

   cd /an/INC/dir/pod/

   grep '^=' perlfaq[1-9].pod >faq.heads

   grep '^=' *.pod >all.heads



> I think most people on the
> newsgroup wouldn't call it a last resort.


It is certainly a resort that comes after "search Google" though.


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


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

Date: 17 Jul 2006 11:21:51 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: skip path prune
Message-Id: <1153160511.344516.302160@75g2000cwc.googlegroups.com>

weberw@adelphia.net wrote:
> How do you use the prune function to skip a printing all of the
> contents of a folder?  It will not print folder 3 but does print the
> contents of folder 3 which I do not want printed.

You have posted the same message (at least) three different times to
(at least) three different newsgroups.  This is called "Multiposting"
and is extremely rude.  I have answered you in perl.beginners, and
someone else answered you in comp.lang.perl.misc.  If I had realized
you multiposted in the first place, I probably wouldn't have replied at
all.

In the future, if you really *need* to post to many different groups,
please *crosspost* as I am doing here.  That is, send one message to
multiple groups, rather than sending multiple copies of a single
message to multiple groups.

Paul Lalli



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

Date: Mon, 17 Jul 2006 19:41:52 GMT
From: David Hopwood <david.nospam.hopwood@blueyonder.co.uk>
Subject: Re: What is a type error? [correction]
Message-Id: <4KRug.7756$5B3.7551@fe2.news.blueyonder.co.uk>

David Hopwood wrote:
> Darren New wrote:
> 
>>From what I can determine, the authors seem to imply that typestate is
>>dataflow analysis modified in (at least) two ways:
>>
>>1) When control flow joins, the new typestate is the intersection of
>>typestates coming into the join, where as dataflow analysis doesn't
>>guarantee that. (They imply they think dataflow analysis is allowed to
>>say "the variable might or might not be initialized here", while
>>typestate would ensure the variable is uninitialized.)
> 
> Right, but this is a disadvantage of their typestate algorithm. It is why
> the example in Figure 2 of
> <http://www.cs.ubc.ca/local/reading/proceedings/spe91-95/spe/vol25/issue4/spe950wk.pdf>
> fails to check, even though it "obviously" initializes all variables.
> 
> Consider the equivalent Java program:

I mixed up Figures 1 and 2. Here is the Java program that Figure 2 should
be compared to:

public class LoopInitTest {
    public static String getString() { return "foo"; }

    public static void main(String[] args) {
        String line = getString();
        boolean is_last = false;

        while (!is_last) {
            if (line.charAt(0) == 'q') {
                is_last = true;
            }

            // insert line into inputs (not important for analysis)

            if (!is_last) {
                line = getString();
            }
        }
    }
}

which compiles without error, because is_last is definitely initialized.

-- 
David Hopwood <david.nospam.hopwood@blueyonder.co.uk>


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

Date: Mon, 17 Jul 2006 19:55:28 GMT
From: Darren New <dnew@san.rr.com>
Subject: Re: What is a type error? [correction]
Message-Id: <QWRug.29144$uy3.1541@tornado.socal.rr.com>

David Hopwood wrote:
> 
> public class LoopInitTest {
>     public static String getString() { return "foo"; }
> 
>     public static void main(String[] args) {
>         String line = getString();
>         boolean is_last = false;
> 
>         while (!is_last) {
>             if (line.charAt(0) == 'q') {
>                 is_last = true;
>             }
> 
>             // insert line into inputs (not important for analysis)
> 
>             if (!is_last) {
>                 line = getString();
>             }
>         }
>     }
> }
> 
> which compiles without error, because is_last is definitely initialized.

At what point do you think is_last or line would seem to not be 
initialized? They're both set at the start of the function, and (given 
that it's Java) nothing can unset them.

At the start of the while loop, it's initialized. At the end of the 
while loop, it's initialized. So the merge point of the while loop has 
it marked as initialized.

Now, if the "insert line into inputs" actually unset "line", then yes, 
you're right, Hermes would complain about this.

Alternately, if you say
    if (x) v = 1;
    if (x) v += 1;
then Hermes would complain when it wouldn't need to. However, that's 
more a limitation of the typestate checking algorithms than the concept 
itself; that is to say, clearly the typestate checker could be made 
sufficiently intelligent to track most simple versions of this problem 
and not complain, by carrying around conditionals in the typestate 
description.

-- 
   Darren New / San Diego, CA, USA (PST)
     This octopus isn't tasty. Too many
     tentacles, not enough chops.


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

Date: Mon, 17 Jul 2006 20:18:20 GMT
From: Darren New <dnew@san.rr.com>
Subject: Re: What is a type error? [correction]
Message-Id: <ggSug.29146$uy3.2489@tornado.socal.rr.com>

Darren New wrote:
> Now, if the "insert line into inputs" actually unset "line", then yes, 
> you're right, Hermes would complain about this.

Oh, I see. You translated from Hermes into Java, and Java doesn't have 
the "insert into" statement. Indeed, the line you commented out is 
*exactly* what's important for analysis, as it unsets line.

Had it been
   insert copy of line into inputs
then you would not have gotten any complaint from Hermes, as it would 
not have unset line there.

In this case, it's equivalent to
if (!is_line) line = getString();
if (!is_line) use line for something...
except the second test is at the top of the loop instead of the bottom.

-- 
   Darren New / San Diego, CA, USA (PST)
     This octopus isn't tasty. Too many
     tentacles, not enough chops.


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

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


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