[30283] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1526 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 9 18:09:40 2008

Date: Fri, 9 May 2008 15:09:08 -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           Fri, 9 May 2008     Volume: 11 Number: 1526

Today's topics:
        Dear gurus how can I extract an ARRAY from a scalar reg <buellboy@gmail.com>
    Re: Dear gurus how can I extract an ARRAY from a scalar <wahab-mail@gmx.de>
    Re: DROP TABLE customers <cartercc@gmail.com>
    Re: Get variable from its name string or vice versa? (Jens Thoms Toerring)
    Re: Get variable from its name string or vice versa? <buellboy@gmail.com>
    Re: Get variable from its name string or vice versa? jerrykrinock@gmail.com
    Re: Get variable from its name string or vice versa? <simon.chao@fmr.com>
    Re: Get variable from its name string or vice versa? <ben@morrow.me.uk>
    Re: Get variable from its name string or vice versa? <1usa@llenroc.ude.invalid>
        I need to extract an array from a scalar regex-wise ? <buellboy@gmail.com>
    Re: I need to extract an array from a scalar regex-wise <simon.chao@fmr.com>
    Re: I need to extract an array from a scalar regex-wise <wahab-mail@gmx.de>
    Re: Installing arch-specific PM without shell access <smallpond@juno.com>
    Re: Is this expected in a foreach()? <uri@stemsystems.com>
    Re: MySQL and Perl <cartercc@gmail.com>
    Re: MySQL and Perl xhoster@gmail.com
    Re: MySQL and Perl <cartercc@gmail.com>
    Re: Net::SMTP fails <smallpond@juno.com>
    Re: Net::SSH::Perl error <smallpond@juno.com>
    Re: Perl OLE Excel - edit width/height Comment window <slick.users@gmail.com>
    Re: The Importance of Terminology's Quality <gneuner2/@/comcast.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 9 May 2008 11:18:11 -0700 (PDT)
From: "advice please wireless 802.11 on RH8" <buellboy@gmail.com>
Subject: Dear gurus how can I extract an ARRAY from a scalar regex-wise
Message-Id: <cfa0ee28-9702-4546-a2d8-04e2e885f684@e39g2000hsf.googlegroups.com>

This is not a homework assignment. I have written this already in

Let's say I want to extract all of the days of the week out of a
scalar like:

"We went to the beach on Monday but it turned out that Sunday would
have been better. The weather report Saturday said no rain until
Thursday but I asked Tuesday (a trick!) and she said it rained
Wednesday."

I want a regex/map/etc (no iterative clauses PLEASE!) that yields:

@days = qw( Monday Sunday Saturday Thursday Tuesday (Wednesday )

My best shot is:
 my @days = keys %{  /((mon|tues|wednes|thurs|fri|satur|sun)day)/gi };

Which, oddly, doesn't seem to work. I say "oddly", because

   /((mon|tues|wednes|thurs|fri|satur|sun)day)/gi

=

  0  'Saturday'
  1  'Satur'
  2  'Thursday'
  3  'Thurs'
  4  'Tuesday'
  5  'Tues'
  6  'Wednesday'
  7  'Wednes'

Yet %{  /((mon|tues|wednes|thurs|fri|satur|sun)day)/gi }

is an empty array!? *TILT*


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

Date: Fri, 09 May 2008 20:30:47 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: Dear gurus how can I extract an ARRAY from a scalar regex-wise
Message-Id: <g025at$3or$1@mlucom4.urz.uni-halle.de>

advice please wireless 802.11 on RH8 wrote:
> Let's say I want to extract all of the days of the week out of a
> scalar like:
> "We went to the beach on Monday but it turned out that Sunday would
> have been better. The weather report Saturday said no rain until
> Thursday but I asked Tuesday (a trick!) and she said it rained
> Wednesday."
> I want a regex/map/etc (no iterative clauses PLEASE!) that yields:
> @days = qw( Monday Sunday Saturday Thursday Tuesday (Wednesday )
> My best shot is:
>  my @days = keys %{  /((mon|tues|wednes|thurs|fri|satur|sun)day)/gi };
> 
> Which, oddly, doesn't seem to work. I say "oddly", because
> 
>    /((mon|tues|wednes|thurs|fri|satur|sun)day)/gi


Your solution was close. Just after some more hours
playing w/regular expressions - you'd have made it ;-)

Maybe you intended sth. like:

  ...
  my @daynam = qw' mon tues wednes thurs fri satur sun ';
  my $regexp = '((?:' . join('|', @daynam) . ')day)';
  my @keys   = $scalar =~ /$regexp/gi;
  ...

Regards

M.


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

Date: Fri, 9 May 2008 11:25:36 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: Re: DROP TABLE customers
Message-Id: <bf8510b6-4d16-4986-b6b0-2132af9889de@w7g2000hsa.googlegroups.com>

On May 9, 11:11 am, Ignoramus26246 <ignoramus26...@NOSPAM.
26246.invalid> wrote:
> I would like to know if Perl's DBI supports an attribute that would
> make a database handle read only.

mysql> GRANT SELECT ON database.* TO 'webuser'@'localhost' IDENDIFIED
BY 'webuserpassword';

Then, use webuser as your user for your application.

CC


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

Date: 9 May 2008 18:21:21 GMT
From: jt@toerring.de (Jens Thoms Toerring)
Subject: Re: Get variable from its name string or vice versa?
Message-Id: <68jj11F2t2768U2@mid.uni-berlin.de>

A. Sinan Unur <1usa@llenroc.ude.invalid> wrote:
> Jerry Krinock <jerry@sheepsystems.com> wrote in news:a2761c7e-8820-4f16-
> 98d7-64c1bc9ef4e3@k13g2000hse.googlegroups.com:

> > I have written a function to log variables like this:
> > 
> >      "         varName: varValue"

> This is a FAQ:

> perldoc -q "How can I use a variable as a variable name"

> Sinan

I think the OP is looking for something a bit different, i.e.
a way to get the name of variable from the variable itself.
I.e. some hypothetical code like

my $x = 10;
logvar( \$x );

sub logvar {
   my $varref;
   print get_name_from_reference( $var ) . " " . $$var . "\n";
}

It's clear that for something like this to work a reference to
the variable has to be passed to the function. But I have no
idea how to write a function like get_name_from_reference()
and also have my doubts that it is possible at all (but then
this is Perl and there's so much magic that it is hard to be
sure;-)
                             Regards, Jens
-- 
  \   Jens Thoms Toerring  ___      jt@toerring.de
   \__________________________      http://toerring.de


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

Date: Fri, 9 May 2008 11:24:23 -0700 (PDT)
From: "advice please wireless 802.11 on RH8" <buellboy@gmail.com>
Subject: Re: Get variable from its name string or vice versa?
Message-Id: <e88c2697-9635-41ec-9521-5a9c8fe0d793@27g2000hsf.googlegroups.com>

On May 9, 1:21 pm, Jerry Krinock <je...@sheepsystems.com> wrote:
> I have written a function to log variables like this:
>
>      "         varName: varValue"
>
> but it takes two arguments: the variable name as a string, and the
> variable symbol:
>
> logVar ("myVar", $myVar) ;
>
> sub logVar {
>         my $varName = shift ;
>         my $varValue = shift ;
>         if (!defined($varValue)) {
>                 $varValue = "<undef>" ;
>         }
>         printf ("%16s: %s\n", $varName, $varValue) ;
>
> }
>
> Is there any way to get "myVar" from $myVar or vice versa, without
> foregoing 'strict' and 'warnings'?
>
> Note: My actual code uses Std::Log but the problem is the same.
>
> Thanks,
>
> Jerry Krinock

sounds like you need the (non-existent) Perl func uneval()



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

Date: Fri, 9 May 2008 12:38:37 -0700 (PDT)
From: jerrykrinock@gmail.com
Subject: Re: Get variable from its name string or vice versa?
Message-Id: <2643728c-7f39-43d9-8c46-ca63cee3018e@m73g2000hsh.googlegroups.com>

On May 9, 11:21=A0am, j...@toerring.de (Jens Thoms Toerring) wrote:

> I think the OP is looking for something a bit different...

Yes, I am.

On May 9, 10:43 am, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
> This is a FAQ:
>
> perldoc -q "How can I use a variable as a variable name"

I'd read that, and now studied it further, but I get the impression
that the only solution is to always define all of my variables in my
own hash, just in case I ever decided that I wanted to log one of
them.

That's not going to be any fun, and not very readable by earthlings.
Indeed, this code works:

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

my %MY_VARS ;

# New Way to declare a Loggable Variable...
# Instead of just "my $fred",
# I now have to write:
my $fred =3D $MY_VARS{"fred"} ;

# New Way to assign a Loggable Variable
# Instead of just "$fred =3D 23",
# I now have to write:
$MY_VARS{"fred"} =3D 23 ;

# Well, after all that yuck, indeed, as desired,
# I can log it with only one argument, :

logVar("fred") ;

# Using this handy function
sub logVar {
    my $varName =3D shift ;
    my $varValue =3D $MY_VARS{$varName} ;
    if (!defined($varValue)) {
        $varValue =3D "<undef>" ;
    }
    printf ("%32s: %s\n", $varName, $varValue) ;
}

But it's hardly worth all that massive obfuscation.  Can someone
confirm that there is indeed no way to simply log a "regular" variable
and its name without having to type both of them, or is Jens correct
that it can't be done?

Jerry


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

Date: Fri, 9 May 2008 12:39:32 -0700 (PDT)
From: nolo contendere <simon.chao@fmr.com>
Subject: Re: Get variable from its name string or vice versa?
Message-Id: <df24bf65-bba2-42b7-bcf5-3916b1e93ac9@27g2000hsf.googlegroups.com>

On May 9, 1:43=A0pm, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
> Jerry Krinock <je...@sheepsystems.com> wrote in news:a2761c7e-8820-4f16-
> 98d7-64c1bc9ef...@k13g2000hse.googlegroups.com:
>
> > I have written a function to log variables like this:
>
> > =A0 =A0 =A0" =A0 =A0 =A0 =A0 varName: varValue"
>
> This is a FAQ:
>
> perldoc -q "How can I use a variable as a variable name"
>

I don't think this is quite it...perhaps the Debugger's DumpPackages?
This displays the symbol tables of packages.


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

Date: Fri, 9 May 2008 20:37:03 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Get variable from its name string or vice versa?
Message-Id: <vnlef5-125.ln1@osiris.mauzo.dyndns.org>


Quoth Jerry Krinock <jerry@sheepsystems.com>:
> I have written a function to log variables like this:
> 
>      "         varName: varValue"
> 
> but it takes two arguments: the variable name as a string, and the
> variable symbol:
> 
> logVar ("myVar", $myVar) ;
> 
> sub logVar {
> 	my $varName = shift ;
> 	my $varValue = shift ;
> 	if (!defined($varValue)) {
> 		$varValue = "<undef>" ;
> 	}
> 	printf ("%16s: %s\n", $varName, $varValue) ;
> }
> 
> Is there any way to get "myVar" from $myVar or vice versa, without
> foregoing 'strict' and 'warnings'?

You can do this with PadWalker. If you need more hints than that, you
probably shouldn't be trying... :)

Ben

-- 
I have two words that are going to make all your troubles go away.
"Miniature". "Golf".
                                                         [ben@morrow.me.uk]


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

Date: Fri, 09 May 2008 21:48:54 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Get variable from its name string or vice versa?
Message-Id: <Xns9A99B5383E3D9asu1cornelledu@127.0.0.1>

jerrykrinock@gmail.com wrote in news:2643728c-7f39-43d9-8c46-
ca63cee3018e@m73g2000hsh.googlegroups.com:

> On May 9, 11:21 am, j...@toerring.de (Jens Thoms Toerring) wrote:
> 
>> I think the OP is looking for something a bit different...
> 
> Yes, I am.

I jumped the gun, sorry!

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://www.rehabitation.com/clpmisc/


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

Date: Fri, 9 May 2008 11:22:57 -0700 (PDT)
From: "advice please wireless 802.11 on RH8" <buellboy@gmail.com>
Subject: I need to extract an array from a scalar regex-wise ?
Message-Id: <7bd33e14-8fe5-457d-a2d7-e9e175d4fc50@k37g2000hsf.googlegroups.com>

This is not a homework assignment. I'd be interested in more elegante'
solutions than mine is all..

Let's say I want to extract all of the days of the week out of a
scalar such as :

$_ =
'We went to the beach on Monday but it turned out that Sunday would
have been better. The weather report Saturday said no rain until
Thursday but I asked Tuesday (a trick!) and she said it rained
Wednesday.'

I want a regex/map/grep/etc (no iterative clauses PLEASE!) that
yields:

@days = qw( Monday Sunday Saturday Thursday Tuesday Wednesday )

My best shot is:
 my @days = keys %{  /((mon|tues|wednes|thurs|fri|satur|sun)day)/gi };

Which, oddly, doesn't seem to work. I say "oddly", because

   /((mon|tues|wednes|thurs|fri|satur|sun)day)/gi

=

  0  'Saturday'
  1  'Satur'
  2  'Thursday'
  3  'Thurs'
  4  'Tuesday'
  5  'Tues'
  6  'Wednesday'
  7  'Wednes'

yet %{  /((mon|tues|wednes|thurs|fri|satur|sun)day)/gi }

is an empty array!? *TILT*

I'm also not crazy about the hash solution because order may be
significant.




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

Date: Fri, 9 May 2008 11:40:07 -0700 (PDT)
From: nolo contendere <simon.chao@fmr.com>
Subject: Re: I need to extract an array from a scalar regex-wise ?
Message-Id: <89007471-06d2-4c2e-a4fa-df08072f9d83@f63g2000hsf.googlegroups.com>

On May 9, 2:22=A0pm, "advice please wireless 802.11 on RH8"
<buell...@gmail.com> wrote:
> This is not a homework assignment. I'd be interested in more elegante'
> solutions than mine is all..
>
> Let's say I want to extract all of the days of the week out of a
> scalar such as :
>
> $_ =3D
> 'We went to the beach on Monday but it turned out that Sunday would
> have been better. The weather report Saturday said no rain until
> Thursday but I asked Tuesday (a trick!) and she said it rained
> Wednesday.'
>
> I want a regex/map/grep/etc (no iterative clauses PLEASE!) that
> yields:
>
> @days =3D qw( Monday Sunday Saturday Thursday Tuesday Wednesday )
>
> My best shot is:
> =A0my @days =3D keys %{ =A0/((mon|tues|wednes|thurs|fri|satur|sun)day)/gi =
};
>
> Which, oddly, doesn't seem to work. I say "oddly", because
>
> =A0 =A0/((mon|tues|wednes|thurs|fri|satur|sun)day)/gi
>
> =3D
>
> =A0 0 =A0'Saturday'
> =A0 1 =A0'Satur'
> =A0 2 =A0'Thursday'
> =A0 3 =A0'Thurs'
> =A0 4 =A0'Tuesday'
> =A0 5 =A0'Tues'
> =A0 6 =A0'Wednesday'
> =A0 7 =A0'Wednes'
>
> yet %{ =A0/((mon|tues|wednes|thurs|fri|satur|sun)day)/gi }
>
> is an empty array!? *TILT*
>
> I'm also not crazy about the hash solution because order may be
> significant.


you need non-capturing parens around the "roots" of your weekday and
weekend names.

use strict; use warnings;
use Data::Dumper;

$_ =3D
'We went to the beach on Monday but it turned out that Sunday would
have been better. The weather report Saturday said no rain until
Thursday but I asked Tuesday (a trick!) and she said it rained
Wednesday.' ;

my @days =3D /((?:mon|tues|wednes|thurs|fri|satur|sun)day)/gi;

print Dumper( \@days ), "\n";

$ ./extract_from_str.pl
$VAR1 =3D [
          'Monday',
          'Sunday',
          'Saturday',
          'Thursday',
          'Tuesday',
          'Wednesday'
        ];



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

Date: Fri, 09 May 2008 20:34:33 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: I need to extract an array from a scalar regex-wise ?
Message-Id: <g025hv$3or$2@mlucom4.urz.uni-halle.de>

advice please wireless 802.11 on RH8 wrote:

[ALERT: double posting w/different title]

> My best shot is:
>  my @days = keys %{  /((mon|tues|wednes|thurs|fri|satur|sun)day)/gi };
> Which, oddly, doesn't seem to work. I say "oddly", because
>    /((mon|tues|wednes|thurs|fri|satur|sun)day)/gi
> =
> 
>   0  'Saturday'
>   1  'Satur'
>   2  'Thursday'
>   3  'Thurs'
>   4  'Tuesday'
>   5  'Tues'
>   6  'Wednesday'
>   7  'Wednes'

The riddles solution involves the (?: ... ) non-capturing
(grouping only) parentheses (See the other answer to your
first posting).

Regards

M.



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

Date: Fri, 09 May 2008 14:39:46 -0400
From: smallpond <smallpond@juno.com>
Subject: Re: Installing arch-specific PM without shell access
Message-Id: <94059$48249a80$11377@news.teranews.com>

Travis Spencer wrote:
> Good Morning All,
> 
> I am hosting my Web site with Yahoo! small business services. 

I think I found your problem.
--S
** Posted from http://www.teranews.com **


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

Date: Fri, 09 May 2008 20:14:55 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Is this expected in a foreach()?
Message-Id: <x78wyj2q0w.fsf@mail.sysarch.com>

>>>>> "G" == Gowtham  <gowthamgowtham@gmail.com> writes:

  G> Yes, got it.
  G> So, this is a feature rather than a bug/annoyance. This
  G> feature is particularly useful when manipulating a very
  G> large list.

s/a very large//;

aliasing in for is very useful in many things. among other things it
also speeds up the loops as only aliases need to be made and not copies
of all the data. the length of the list is not a factor in the
usefulness of this feature.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Fri, 9 May 2008 11:20:06 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: Re: MySQL and Perl
Message-Id: <607d4b03-69e5-45fa-8856-0aed60e63411@m45g2000hsb.googlegroups.com>

On May 9, 9:18 am, Bill H <b...@ts1000.us> wrote:
> I am about to dive into working with MySQL databases in perl and am
> looking for any information you all may have on the subject, website
> links, modules etc.
>
> Bill H

Dubois wrote two books, one on MySQL and one on Perl and MySQL. The
one on Perl and MySQL is outstanding. I bought it years ago and am
still reading it. Yeah, it's that helpful.

On the database, look at PostgreSQL. It's far superior to MySQL, and
you can use Perl as the PL. It has far more in common with DB2 and
Oracle than with MySQL. I've used MySQL for about ten years and
PostgreSQL for almost four, and have had ample opportunity to compare
them side by side, and PostgreSQL is by far the superior product.

The big selling point for MySQL is speed, but there really isn't a
difference. I suppose if you get into big, industrial sized databases
MySQL may have a speed advantage, but if you are into big, industrial
sized databases, you won't be using MySQL.

CC


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

Date: 09 May 2008 18:27:54 GMT
From: xhoster@gmail.com
Subject: Re: MySQL and Perl
Message-Id: <20080509142756.203$SZ@newsreader.com>

cartercc <cartercc@gmail.com> wrote:
>
> The big selling point for MySQL is speed, but there really isn't a
> difference.

To me the biggest selling point of MySQL is simplicity, not speed.  But
the speed is nice.

> I suppose if you get into big, industrial sized databases
> MySQL may have a speed advantage, but if you are into big, industrial
> sized databases, you won't be using MySQL.

I use MySQL for big, industrial sized databases.  I also use Oracle for
other big, industrial sized databases.  Horses for courses.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


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

Date: Fri, 9 May 2008 11:42:42 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: Re: MySQL and Perl
Message-Id: <d08ed7c7-cbd3-49e1-a0b9-2bd18e5eb882@i76g2000hsf.googlegroups.com>

On May 9, 2:27 pm, xhos...@gmail.com wrote:
> To me the biggest selling point of MySQL is simplicity, not speed.  But
> the speed is nice.

Simplicity is in the eye of the beholder. One reason I like PGSQL is
because of its simplicity. When you use MySQL, you have all the
databases in the same server. When you use PGSQL, each database is in
its own server. Log into MySQL and you can see all the other
databases. You can't do that with PGSQL.

> I use MySQL for big, industrial sized databases.  I also use Oracle for
> other big, industrial sized databases.  Horses for courses.

Depends on what you mean by 'big, industrial size.' Last time I
checked, which was a couple of versions ago, PGSQL could hold a lot
more data than MySQL. May have changed and I haven't looked at it
recently, but PGSQL also does subselects, user defined datatypes and
user defined functions. PGSQL also has an array datatype, which is
real nifty if you ever have to struggle with data that can't be
normalized.

Don't get me wrong. I like MySQL and am a long time user of MySQL. I
just like PGSQL better. I also like vi better than emacs, Perl better
than Python, and Windows better than Mac, so chalk this up to merely
personal preference.

CC


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

Date: Fri, 09 May 2008 15:07:16 -0400
From: smallpond <smallpond@juno.com>
Subject: Re: Net::SMTP fails
Message-Id: <a87fb$4824a0f2$18442@news.teranews.com>

Peter J. Holzer wrote:
> On 2008-05-07 20:10, smallpond <smallpond@juno.com> wrote:
> 
>>This line:
>>250-AUTH LOGIN PLAIN XYMCOOKIE
>>says that you must authenticate with one of the types: LOGIN, PLAIN or XYMCOOKIE.
> 
> 
> No, it says that you *can* authenticate using one of these methods. 
> 
> 	hp


The response from the server when Dave tried not authenticating already told us
that you *must* authenticate:

Net::SMTP=GLOB(0x82ccfac)<<< 530 authentication required

So are you suggesting that Dave try to authenticate with a method not from the list?
--S
** Posted from http://www.teranews.com **


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

Date: Fri, 09 May 2008 14:32:37 -0400
From: smallpond <smallpond@juno.com>
Subject: Re: Net::SSH::Perl error
Message-Id: <d656a$482498d3$11377@news.teranews.com>

Ani wrote:
> Hi,
> 
> I am encountering the following error while using Net::SSH::Perl, from
> within a Perl CGI script:
> 
>     Bad packet length <some number> at /usr/lib/perl5/site_perl/5.8.0/
> Net/SSH/Perl/Packet.pm
> 
> Has anyone faced this issue before? Any idea what might be causing
> this?
> 
> Some help is much appreciated.
> 
> thanks,
> anirban

That error isn't coming from perl.  It would have printed the bad
packet length and the line number in Packet.pm where the error occurred.

However, if it had been, it would be due to receiving a packet that is
either too short or too long to be valid.
--S
** Posted from http://www.teranews.com **


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

Date: Fri, 9 May 2008 15:06:06 -0700 (PDT)
From: Slickuser <slick.users@gmail.com>
Subject: Re: Perl OLE Excel - edit width/height Comment window
Message-Id: <fcbaf04d-712c-4346-ba8b-890790103dc1@t12g2000prg.googlegroups.com>

Thanks but my original question is still asking how to use selection
method with the ScaleWidth function call.

On May 8, 1:16 pm, Brian Helterline <brian.helterl...@hp.com> wrote:
> Slickuser wrote:
> > I have achieved adding comments but I can't change the width and
> > height of the comment box. Any help?
>
> > This is the VBA macro code:
> >        Range("C23").Comment.Text Text:= _
> >         "Slickuser:" & Chr(10) & "Helllo              " & Chr(10) & ""
> > & Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "wowow this
> > is awesome!!!!!!!!!!!! " & Chr(10) & "what!!"
> >     Selection.ShapeRange.ScaleWidth 1.76, msoFalse,
> > msoScaleFromTopLeft
> >     Selection.ShapeRange.ScaleHeight 0.54, msoFalse,
> > msoScaleFromTopLeft
> >     Range("C23").Comment.Shape.Select True
> >     ActiveWindow.SmallScroll Down:=6
> >     Range("F19").Select
>
> > Perl OLE Browser info:
>
> > Comment: Property Shape As Shape readonly
> > ShapeRange: Sub ScaleHeight(Factor As VT_R4, RelativeToOriginalSize As
> > MsoTriState, [Scale])
>
> > Here is the Perl code:
>
> > $Range_Enter = $Worksheet->Range("C23");
>
> > $Range_Enter->{AddComment};
>
> $my $comment = $Range_Enter->{AddComment};
>
> > $Range_Enter->{Comment}->{Visible} = 0;
>
> $comment->{Visible} = 1;
>
> > my $string = "".$Range_Enter->{Comment}->{Author}.":
> > \nHelllo              \n\n\n\n\nwowow this is awesome!!!!!!!!!!!!
> > \nwhat!!" ;
>
> my $string = $comment->{Author} . ":.........";
>
> > $Range_Enter->{Comment}->Text($string);
>
> $comment->Text($string);
>
>
>
> > //not sure how to translate this with Selection
> > #$Range_Enter>{ShapeRange}->ScaleWidth("1.76, msoFalse, msoScaleFromTopLeft");
> > #$Range_Enter->{ShapeRange}->ScaleHeight("0.54, msoFalse, msoScaleFromTopLeft");
>
> use constant msoFalse => 0;  # or import the entire Office typelib
> use constant msoScaleFromTopLeft => 0;
>
> my $shape = $comment->{Shape};       # now you have your shape object
> $shape->ScaleWidth( 1.76, msoFalse, msoScaleFromTopLeft );
> $shape->ScaleHeight(0.54, msoFalse, msoScaleFromTopLeft );
>
> In your excel macro, the ScaleWidth and ScaleHeight functions were
> called on the current selection,  you need to make get that "selection"
> in perl before you can operate on it.
>
> --
> -brian



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

Date: Fri, 09 May 2008 17:56:48 -0400
From: George Neuner <gneuner2/@/comcast.net>
Subject: Re: The Importance of Terminology's Quality
Message-Id: <eth9249j65rkqhiuok07tbpisl07o569n9@4ax.com>

On Thu, 8 May 2008 22:38:44 -0700, "Waylen Gumbal" <wgumgfy@gmail.com>
wrote:

>Sherman Pendley wrote:
>> kodifik@eurogaran.com writes:
>> >
>> > > PLEASE DO NOT | :.:\:\:/:/:.:
>> > > FEED THE TROLLS | :=.' - - '.=:
>> >
>> > I don't think Xah is trolling here (contrary to his/her habit)
>> > but posing an interesting matter of discussion.
>>
>> It might be interesting in the abstract, but any such discussion, when
>> cross-posted to multiple language groups on usenet, will inevitably
>> devolve into a flamewar as proponents of the various languages argue
>> about which language better expresses the ideas being talked about.
>> It's like a law of usenet or something.
>>
>> If Xah wanted an interesting discussion, he could have posted this to
>> one language-neutral group such as comp.programming. He doesn't want
>> that - he wants the multi-group flamefest.
>
>Not everyone follows language-neutral groups (such as comp,programming 
>as you pointed out), so you actually reach more people by cross posting. 
>This is what I don't understand - everyone seems to assume that by cross 
>posting, one intends on start a "flamefest", when in fact most such 
>"flamefests" are started by those who cannot bring themselves to 
>skipping over the topic that they so dislike.

The problem is that many initial posts have topics that are misleading
or simplistic.  Often an interesting discussion can start on some
point the initial poster never considered or meant to raise.

George
--
for email reply remove "/" from address


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

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


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