[29033] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 277 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 28 14:10:15 2007

Date: Wed, 28 Mar 2007 11:09: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           Wed, 28 Mar 2007     Volume: 11 Number: 277

Today's topics:
    Re: Beginning OO help <john.swilting@wanadoo.fr>
    Re: Beginning OO help <nomail@sorry.com>
        DBI MS SQL connection error <vaqas@hotmail.com>
    Re: DBI MS SQL connection error <vaqas@hotmail.com>
    Re: how to list all loaded modules of a perl program anno4000@radom.zrz.tu-berlin.de
    Re: how to set script vars in commadline anno4000@radom.zrz.tu-berlin.de
    Re: how to set script vars in commadline <jurgenex@hotmail.com>
    Re: how to set script vars in commadline <jurgenex@hotmail.com>
    Re: LWP hangs yahavba@gmail.com
    Re: perl + script files from only one directory <rprp@gmx.net>
        Perl package install dll problems <christopher.m.collins@gmail.com>
        Problem in the Perl script <spuurthi@gmail.com>
    Re: Replacing characters in file anno4000@radom.zrz.tu-berlin.de
    Re: Replacing characters in file <tadmc@augustmail.com>
    Re: Replacing characters in file <uri@stemsystems.com>
    Re: Seeking recommendation for Web framework <zen13097@zen.co.uk>
    Re: Sweetest Accessor? anno4000@radom.zrz.tu-berlin.de
    Re: Troubleshooting cpan <brian.d.foy@gmail.com>
    Re: Win32::OLE error in thread (ActiveSatate 5.8) on XP <lev.weissman@kodak.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 28 Mar 2007 19:07:05 +0200
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: Re: Beginning OO help
Message-Id: <C2306D59.4F08%john.swilting@wanadoo.fr>

dans l'article eubtv1$1j6f$1@agate.berkeley.edu, Arvin Portlock à
nomail@sorry.com a écrit le 27/03/07 23:14 :

> I'm creating my very first object oriented module. I've read about
> objects in so many perl books and online tutorials, and yet I still
> can't get the hang of it. It's very frustrating. I've started by
> designing a very simple class that has similar functionality to
> what I eventually want to come up with, but not nearly as complex.
> Just to get the hang of the basics before I get more complicated.
> The class encapsulates an XML file. It has two attributes: the
> file size and a linked list of the element names in the order they
> are encountered in the file. Use it like this:
> 
> use Pete::MyFirstClass;
> 
> my $xmldoc = new Pete::MyFirstClass ('filename.xml');
> 
> print "The size of the document is ", $xmldoc->size, "\n";
> print "Here is a list of the elements in the document:\n";
> 
> my $element = $xmldoc->elements;
> while ($element) {
> print $element->{name}, "\n";
> $element = $element->{next};
> }
> 
> __END__
> 
> Question 1: How do I turn {name} and {next} into accessor methods
> rather than raw hash values?
> 
> Here's what I have so far:
> 
> package Pete::MyFirstClass;
> require Exporter;
> @ISA = qw(Exporter);
> use strict 'vars';
> 
> sub new {
> my ($self, $file) = @_;
> my $size = -s $file;
> my $elements = {};
> my $last_element;
> open (FILE, $file);
> while (my $line = <FILE>) {
> while ($line =~ /<([a-z0-9]+)[^<>]*>/g) {
> my $name = $1;
> my $tag = {};
> $tag->{name} = $name;
> if ($elements) {
> $last_element->{next} = $tag;
> $last_element = $tag;
> } else {
> $elements = $tag;
> $last_element = $tag;
> }
> }
> }
> close (FILE);
> return bless [$size, $elements];
> }
> 
> sub size { return $_[0]->[0]; }
> sub root { return $_[0]->[1]; }
> 
> __END__
> 
> ## I'm guessing I'll need to create a new Element class with methods
> ## "next" and "name"? But I can't seem to get it to work right
> 
> package Elements;
> 
> sub new {
> my $self = shift;
> }
> 
> sub name {};
> sub next {};
> 
do not reinvent the whell me it does not answer me in all the cases
perl  -e -mCPAN shell
install XML::*



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

Date: Wed, 28 Mar 2007 11:03:51 -0800
From: Arvin Portlock <nomail@sorry.com>
Subject: Re: Beginning OO help
Message-Id: <eueamb$5vq$1@agate.berkeley.edu>

Jamie wrote:

> It's just a reference. (or pointer, if you perfer)

I have seen the light. Seriously, I understand it all now.

It was useful for me to finally list explicitely the things I
understood and the things I didn't understand in all of the
documents I read and examples I had seen. Actually, the examples
were more useful (as in real OO distributed perl modules). The
problem with the documents was that they almost never looked
like real-world examples. For examples, the perl objects and
references book I don't think ever had an example that looked
like what one sees in the real world. What would have been
most useful to me would have been to *start* with the finished
examples then parse it apart and explain it.

 >   return bless [$size, $elements];
 >                  ^^^^^^^^^^^^^^^^^
 >Woah! that's probably a bit much to start out with. It's valid, but
 >you might want to start with a plain old hash first, just to get
 >the feel for it.

Gotcha, though now I understand this part and the underlying
slight gain in efficiency the docs talk about. Strangely, the
square brackets didn't really register as a simple array
reference before. I thought it was some magic having to do
with bless. Now I see, as you explained, that it's ALL just
references.

my $xmldoc = new Pete::MyFirstClass ('filename.xml');

$xmldoc isn't an object! It's nothing more than an array reference.
I get it now. It could as easily be a hash reference as well.
$xmldoc is nothing more than [$size, $elements], the two
variables I returned. Within new one could invoke the size method
like this as well: bless ([$size, $elements])->size; Not something
you'd ever want to do but it sure clears up what's going on
behind the scenes.

Another thing that confused me:

sub new {
 ...
return bless [$size, $elements];
}

sub size { return $_[0]->[0]; }

How does the size subroutine know what &new returned? It's
accessing array elements returned by new. How do the two
subroutines know about and communicate with each other?
Answer is of course they don't. They're just like any other
subroutines. They "communicate" via the $xmldoc "object."
That is $xmldoc->size calls the size subroutine and passes
to it, secretly, itself (which is a reference to an array).

> All an object really is, is a reference. Even in other languages, it's 
> just a
> pointer. Big woop. (I use pointer/reference to mean more or less the same
> thing)
>
> The language may attach special meaning to the reference, inheritance, 
> etc.. but
> at the end of the day, it's still just a reference

Yup, something I've read in countless places but never sunk in until
now.

> There is more to it than this, of course. But if you "unlearn" the 
> business of
> class variables, instance variables and other techno-babble, 

Unlearning is definitely necessary to learn this stuff. OO
really is just grafted onto perl. It's plain old references
used in clever ways with the help of bless.

>
> There is no need to call Exporter or any of that stuff.

Thanks. I still don't understand Exporter but that will come.
No need to rush it for now. You've been very helpful. Now
it's time to start having some fun.

Arvin



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

Date: 28 Mar 2007 07:14:51 -0700
From: "Saya" <vaqas@hotmail.com>
Subject: DBI MS SQL connection error
Message-Id: <1175091291.905179.271010@l77g2000hsb.googlegroups.com>

Hi all,

I have run into a problem with DBI connection to MS SQL server. I have
a script within which the below is executed:

my $DSN = 'driver={SQL
Server};Server=servername;database=dbname;Network=DBMSSOCN';
my $dbh = DBI->connect("DBI:ODBC:$DSN",'dbuser', 'dbpass') or die
$DBI::errstr;

my $sth = $dbh->prepare("Select categoryName, categoryID from
tblCategory Order By categoryName");

$sth->execute;

Now this script works on server1 and server2, but when I copy this
script to NewServer I get the following error:

DBI connect('driver={SQL Server};Server=servername,
1304;database=dbname;Network=
DBMSSOCN','dbname',...) failed: [Microsoft][ODBC SQL Server Driver]
[TCP/IP Sock
ets]General network error. Check your network documentation.
(SQL-08001)
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen
(Connect()). (
SQL-01000)(DBD: db_login/SQLConnect err=-1) at E:\custom\perl
\Category.ipl line 16
Can't call method "prepare" on an undefined value at E:\custom\perl
\Category.ipl line 18.

I can ping servername (the sql server) from the NewServer. The DBI
version on all the servers is the same (1.38). Also the perl version
is the same (v5.8.2 built for MSWin32-x86-multi).

Does anyone have any hints/clues as what might be going wrong here.

Any help will be greatly appreciated.

regards
Saya



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

Date: 28 Mar 2007 07:21:43 -0700
From: "Saya" <vaqas@hotmail.com>
Subject: Re: DBI MS SQL connection error
Message-Id: <1175091703.651421.35830@d57g2000hsg.googlegroups.com>

Sorry for the mishap but $DSN actuallu looks like the below line. I
was just experimenting when I removed 1304 from the servername.
my $DSN = 'driver={SQL Server};Server=servername,
1304;database=dbname;Network=DBMSSOCN';

On 28 Mar., 16:14, "Saya" <v...@hotmail.com> wrote:
> Hi all,
>
> I have run into a problem with DBI connection to MS SQL server. I have
> a script within which the below is executed:
>
> my $DSN = 'driver={SQL
> Server};Server=servername;database=dbname;Network=DBMSSOCN';
> my $dbh = DBI->connect("DBI:ODBC:$DSN",'dbuser', 'dbpass') or die
> $DBI::errstr;
>
> my $sth = $dbh->prepare("Select categoryName, categoryID from
> tblCategory Order By categoryName");
>
> $sth->execute;
>
> Now this script works on server1 and server2, but when I copy this
> script to NewServer I get the following error:
>
> DBI connect('driver={SQL Server};Server=servername,
> 1304;database=dbname;Network=
> DBMSSOCN','dbname',...) failed: [Microsoft][ODBC SQL Server Driver]
> [TCP/IP Sock
> ets]General network error. Check your network documentation.
> (SQL-08001)
> [Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen
> (Connect()). (
> SQL-01000)(DBD: db_login/SQLConnect err=-1) at E:\custom\perl
> \Category.ipl line 16
> Can't call method "prepare" on an undefined value at E:\custom\perl
> \Category.ipl line 18.
>
> I can ping servername (the sql server) from the NewServer. The DBI
> version on all the servers is the same (1.38). Also the perl version
> is the same (v5.8.2 built for MSWin32-x86-multi).
>
> Does anyone have any hints/clues as what might be going wrong here.
>
> Any help will be greatly appreciated.
>
> regards
> Saya




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

Date: 28 Mar 2007 11:08:02 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: how to list all loaded modules of a perl program
Message-Id: <56v0kiF2bb0l2U2@mid.dfncis.de>

Fei Liu <fei.liu@gmail.com> wrote in comp.lang.perl.misc:
> My apologies for the double posts. Google groups is choking...

Indeed. Trying to choke Usenet...

Anno


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

Date: 28 Mar 2007 10:25:59 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: how to set script vars in commadline
Message-Id: <56uu5nF29mb5qU1@mid.dfncis.de>

EN <moosegoose.elvis@iinvaaliid.gmail.com> wrote in comp.lang.perl.misc:
> Hi,
> 
> I have one script using evaled config files which has generated values 
> using preset variables.
> I want to keep preset vars out from config files and I don't want to put 
> them in script.
> 
> But I really liked to define them in commandline when calling my script.
> 
> In config file "my.config" there could be a line like this:
> 
> $target_path=$root_path."\\droppings";
> 
> my script read and eval this config file but how to define $root_path?
> 
> Of course I could another evaled config file to set those vars
> 
> "myscript.pl -c preset_temp.config -c my.config"
> 
> , or write starter script, or use env vars.
> 
> I really like to do it like this:
> 
> "myscript.pl -v $root_path="hiway\\to\\hell" -c my.config"

So what's stopping you?  What is your question?

Anno


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

Date: Wed, 28 Mar 2007 13:46:30 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: how to set script vars in commadline
Message-Id: <WkuOh.5634$Qi2.4102@trndny07>

EN wrote:
> I have one script using evaled config files which has generated values
> using preset variables.
> I want to keep preset vars out from config files and I don't want to
> put them in script.
[...]
> I really like to do it like this:
> "myscript.pl -v $root_path="hiway\\to\\hell" -c my.config"

Ok, where is the problem?

jue 




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

Date: Wed, 28 Mar 2007 14:01:52 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: how to set script vars in commadline
Message-Id: <kzuOh.5635$Qi2.1713@trndny07>

Jürgen Exner wrote:
> EN wrote:
>> I have one script using evaled config files which has generated
>> values using preset variables.
>> I want to keep preset vars out from config files and I don't want to
>> put them in script.
> [...]
>> I really like to do it like this:
>> "myscript.pl -v $root_path="hiway\\to\\hell" -c my.config"
>
> Ok, where is the problem?

Wait a sec. That line probably won't pass your shell (which is a shell 
limitation, not a Perl issue).

But if you write it like
    myscript.pl -v "root_path=hiway\to\hell" -c my.config
then you should be fine.

jue





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

Date: 28 Mar 2007 06:35:31 -0700
From: yahavba@gmail.com
Subject: Re: LWP hangs
Message-Id: <1175088931.660927.71200@y66g2000hsf.googlegroups.com>

On Mar 23, 3:32 am, nos...@geniegate.com (Jamie) wrote:
> In <1174592325.193879.192...@y66g2000hsf.googlegroups.com>,
> yaha...@gmail.com mentions:
>
> >On Mar 22, 9:18 pm, nos...@geniegate.com (Jamie) wrote:
> >> --http://www.geniegate.com                  Custom web programming
> >> Perl * Java * UNIX                        User Management Solutions
>
> >Hi,
> >It's hanging on get. I'm using get on a url which is secured (https),
> >and it works for quite a long time untill suddenly it stops and
> >hangs.
> >When you say you override the method - how exactly is it done? how can
> >i verify what parameters it is trying to use?
>
> >thanks for you help!
>
> Do this: perldoc -mLWP::UserAgent
>
> It'll give you the source code forLWP::UserAgent.
>
> Then, in a sub or another package or a variety of ways..
>
> NOTE:!!!!! Not-tested code, this is just a "for example" thing!
>
> I'll probably goof this up, I'm editing "live" so beware...
>
> sub get_ua {
>         {
>                 package My::Ua;
>                 useLWP::UserAgent;
>                 use base 'LWP::UserAgent';
>                 use strict;
>
>                 # Use our bugged version to snoop in on things.
>                 sub get {
>                         my($self,@args) = @_;
>                         print "CP1: $self called with " . join(',',@args), "\n";
>                         my $rv = $self->SUPER::get(@args);
>                         print "CP2: returning from get\n";
>                         return($rv);
>                 }
>         }
>         return(My::Ua->new(@_)); # Create our own version ofLWP::UserAgent.
>
> }
>
> When you construct yourLWP::UserAgent object, call get_ua() instead, in
> the customized get() method above, you can insert print statements and
> so on which will tell you the precise URL it's attempting to fetch. (you
> can make a note of the URL's and observe if it's always the same URL,
> this would be a key piece of information)
>
> Confirm things are as they should, then follow along the path ofLWP
> until you get to request() (and at that point.. it's probably just
> as easy to copy the whole thing over and pollute with print statements)
> placing "CPnnn" statements in along the way.
>
> At the end of it all, you'll get to a point where there isn't a "CPnnn"
> printed where you think there ought to be one. At that point, you'll
> have found exactly where it's hanging, and, if you're lucky.. it'll
> be something obvious. :-) If not, at least you'll have a good idea what's
> wrong.
>
> Do NOT modify the source ofLWP::UserAgent (or any other module for that
> matter) directly, always copy, or if it's more convenient, do a
> custom override as above. Otherwise you'll end up with corrupt modules.
>
> See Also:LWP::Debug  
>
> Though I've never used it, every problem I've ever had was as a result of me
> passing the wrong stuff into get/post, I've never had to go further than what
> I've described above. (and I usually overrideLWP::UserAgent in the beginning
> anyway, just in case I might want to change it's behavior later on in
> program development, ex: password fetching)
>
> The above is just a debugging method I've found useful for "tough cases".
>
> Jamie
> --http://www.geniegate.com                   Custom web programming
> Perl * Java * UNIX                        User Management Solutions

Hi Jamie,
thanks a lot for your help and advice.
i've tried your solution, and i see that the GET actually receive the
correct URL. Afterwards, usually after fetching pages for 1-2 hours,
it hangs. I tried to use "alarm" of 60 seconds (and mapped SIG{ALRM}
to a subroutine of my own) but it didn't help, even ctrl-C doesn't
kill the process - only Task Manager kill.
I'm thinking of another way of running the GET commands in a seperate
process or thread, and then if i can't see the results of the GET in
the main process i will kill this thread, what do you think?




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

Date: Wed, 28 Mar 2007 13:04:18 +0200
From: Reinhard Pagitsch <rprp@gmx.net>
Subject: Re: perl + script files from only one directory
Message-Id: <460a4bb3$0$90269$14726298@news.sunsite.dk>

magne.nilsen@gmail.com wrote:
[snip]

> not what I am looking for. Alternatively, is there any alternative
> "compilers" that truly compiles absolutely all needed files into a
> single EXE ?

Yes PAR do it also. Use pp.bat to compile the .pl script and the used 
modules. The documentation can be found under /perl/html/bin/pp.html

regards,
Reinhard

-- 
PM Mails an rpirpag <at> gmx dot at


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

Date: 28 Mar 2007 10:42:00 -0700
From: "ChrisC" <christopher.m.collins@gmail.com>
Subject: Perl package install dll problems
Message-Id: <1175103720.439454.155970@l77g2000hsb.googlegroups.com>

Hello,

I'm using ActivePerl latest version and have installed the inline-0.44
package on a Win XP box.  Actually I tried this on 2 machines with
same result.

I'm now trying to install inline-java 0.52.  I've set the environment
variables PERL_INLINE_JAVA_J2SDK=c:
\jdk1.5.0_11 and PERL_INLINE_JAVA_JNI=1 and the nmake seems to
complete successfully.

When I run 'nmake test' I get a bunch of errors with a dll file,
however, the dll is located in the mentioned directories.  I search of
the dll dependency with Dependency Walker doesn't reveal any errors.

A snippet of the errors from 'nmake test' is below.  Any suggestions?

Chris

        cd ..
        C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'bl
ib\lib', 'blib\arch')" t/*.t
t/01_init..............Can't load JNI module. Did you build it at
install time?
Error: Can't load 'C:\inlinejava\Inline-Java-0.52\blib\arch/auto/
Inline/Java/JNI
/JNI.dll' for module Inline::Java::JNI: load_file:The specified module
could not
 be found at C:/Perl/lib/DynaLoader.pm line 230.
 at C:\inlinejava\Inline-Java-0.52\blib\lib/Inline/Java.pm line 193
 at C:\inlinejava\Inline-Java-0.52\blib\lib/Inline/Java.pm line 193
Compilation failed in require at C:\inlinejava\Inline-Java-0.52\blib
\lib/Inline/
Java.pm line 193.
INIT failed--call queue aborted.
t/01_init..............dubious
        Test returned status 2 (wstat 512, 0x200)
DIED. FAILED test 1
        Failed 1/1 tests, 0.00% okay
t/02_primitives........Can't load JNI module. Did you build it at
install time?
Error: Can't load 'C:\inlinejava\Inline-Java-0.52\blib\arch/auto/
Inline/Java/JNI
/JNI.dll' for module Inline::Java::JNI: load_file:The specified module
could not
 be found at C:/Perl/lib/DynaLoader.pm line 230.
 at C:\inlinejava\Inline-Java-0.52\blib\lib/Inline/Java.pm line 193
 at C:\inlinejava\Inline-Java-0.52\blib\lib/Inline/Java.pm line 193
Compilation failed in require at C:\inlinejava\Inline-Java-0.52\blib
\lib/Inline/
Java.pm line 193.
INIT failed--call queue aborted.
t/02_primitives........dubious
        Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-102
        Failed 102/102 tests, 0.00% okay
t/02_primitives_1_4....Can't load JNI module. Did you build it at
install time?
Error: Can't load 'C:\inlinejava\Inline-Java-0.52\blib\arch/auto/
Inline/Java/JNI
/JNI.dll' for module Inline::Java::JNI: load_file:The specified module
could not
 be found at C:/Perl/lib/DynaLoader.pm line 230.
 at C:\inlinejava\Inline-Java-0.52\blib\lib/Inline/Java.pm line 193
 at C:\inlinejava\Inline-Java-0.52\blib\lib/Inline/Java.pm line 193
Compilation failed in require at C:\inlinejava\Inline-Java-0.52\blib
\lib/Inline/



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

Date: 28 Mar 2007 11:04:45 -0700
From: "Rashmi Madhukara" <spuurthi@gmail.com>
Subject: Problem in the Perl script
Message-Id: <1175105085.396405.294510@d57g2000hsg.googlegroups.com>

Hello All,

For some reason, I am not able to reason out why this piece of
program is not working.

my $k = 1.0;
my $num = 3;


for($k = 2.0; $k <= 10.0;)
{
	$k = $k + 0.1;
	if($k == $num)
	{
		print "True\n";
	}
}

In the above program for some reason, it doesn't print True.

Thanks in advance
R



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

Date: 28 Mar 2007 10:51:02 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Replacing characters in file
Message-Id: <56uvkmF2bb0l2U1@mid.dfncis.de>

Anony-mouse  <anony-mouse@hole.in.the.wall.com> wrote in comp.lang.perl.misc:

> The terminology is irrelevant since some people have obvoiusly
> understood.

Thanks for making your attitude unmistakably clear.

Anno


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

Date: Wed, 28 Mar 2007 05:01:22 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Replacing characters in file
Message-Id: <slrnf0kf7i.l5q.tadmc@tadmc30.august.net>

Anony-mouse <anony-mouse@hole.in.the.wall.com> wrote:
>

> I now give up
> wasting time with Perl and this newsgroup. 


Thank you.


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


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

Date: Wed, 28 Mar 2007 07:17:33 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Replacing characters in file
Message-Id: <x7y7lhimua.fsf@mail.sysarch.com>

>>>>> "A" == Anony-mouse  <anony-mouse@hole.in.the.wall.com> writes:

  A> Many thanks to Klaus and a couple of others who actually tried to help
  A> me with this problem by posting sensible replies, but I now give up
  A> wasting time with Perl and this newsgroup. 

  A> It's simply not worth the hassle dealing with the pedantic fools in
  A> this newsgroup that simply want to prove how clever they are by
  A> nitpicking teminology. Thanks for nothing.  :o(

hmmm, methinks you are the fool for not understanding that computer
terminology matters (like it does in all technical worlds). they call it
jargon for a reason. i think perl is too good for you so stick with
cobol or fortran which are more your speed.

and thanx for dropping by and ignoring my recent posts which tell you
exactly (and pedantically) how to solve your coding problem. but i can't
solve your head problem. neither can you it seems.

or hire a programmer the next time because you aren't one.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 28 Mar 2007 11:27:52 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: Seeking recommendation for Web framework
Message-Id: <460a5138$0$27118$db0fefd9@news.zen.co.uk>

On Tue, 27 Mar 2007 07:59:03 -0400, Sherm Pendley <spamtrap@dot-app.org> wrote:
>  Michele Dondi <bik.mido@tiscalinet.it> writes:
> 
> > On Mon, 26 Mar 2007 18:46:19 -0400, Sherm Pendley
> > <spamtrap@dot-app.org> wrote:
> >
> >>> Often mentioned are Catalyst, Maypole, Jifty.
> >>
> >>IMHO, Catalyst is the cat's meow.
> >
> > <ot>
> > Can you explain this idiom? I haven't heard it before, and I'm not a
> > native English speaker. I'm eager to know!  :-)
> > </ot>
> 
>  Well, i can explain its meaning, but I don't know its origin for sure.
> 
>  From what I can find, it's from the 1920s. A "cool cat" was someone who
>  kept up with all the latest fads and trends. The "cat's meow" was something
>  too cool for words.

Similar phrases, in terms of both meaning and structure, are "bee's knees",
and (mainly UK English, more common, but more coarse) "dog's bollocks".




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

Date: 28 Mar 2007 10:09:02 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Sweetest Accessor?
Message-Id: <56ut5uF2ammm2U1@mid.dfncis.de>

Xiong Changnian  <please@nospam.net> wrote in comp.lang.perl.misc:
> In article <56sml4F2758v9U1@mid.dfncis.de>,
>  anno4000@radom.zrz.tu-berlin.de wrote:
> 
> > Another problem is that you won't be able to assign a boolean false
> > value that way.
> 
> Well, I'm not sure that's a problem. I abhor boolean false values as a 
> matter of taste. Reserving FALSE demands that every value assigned to a 
> variable have a TRUE value (obviously) and I think that's good style. I 
> realize that someone else will be quite comfortable with, say, integer 
> zero values in some places and require an accessor that permits them. I 
> just don't. 
> 
> If I ever thought I would want deliberately to set a variable inside a 
> complex data structure to 0, "", or undef, I'd write a distinct "clear" 
> method. 

I don't think you'll be happy with that in the long run.  Many fields
take values that happen to be false in the normal course of things.
Suppose you have a field "score" you want to count up and down:

    if ( $won ) {
        $player->score( $player->score + 1);
    } else {
        $player->score( $player->score - 1);
    }

That would fail to change the score if the score would have reached
zero.  You'd need an ugly workaround, even if you have a special method
"->clear_score" to set it to zero.

> > The standard get-set accessor in Perl is
> > 
> >     sub name {
> >         my $obj = shift;
> >         $obj->{ name} = shift if @_;
> >         $obj->{ name};
> >     }
> 
> No offense, but that's neither short nor sweet.

I'm not claiming short and sweet.  It's standard.

> I particularly don't 
> care for mixing shift and @_ in the same sub -- visually. 

Why?

> Of course, a working accessor might be written in any number of ways and 
> perhaps there are several idioms that will all compile to equivalent 
> byte code or be equally efficient. My immediate goal here is terseness, 
> sweetness -- "niftyness", if you will. Sorry if that sounds trivial. 
> 
> 
> >     sub name : lvalue { shift()->{ name} }
> 
> I really, really like the idea of lvalue subs. They make calling syntax 
> much more symmetrical and "natural". I was scared off by dire warnings 
> (eg):
> 
> "WARNING: Lvalue subroutines are still experimental and the 
> implementation may change in future versions of Perl." 

I'm not much worried by that.  There seems to be little ongoing
discussion of lvalue subs.  I think they are here to stay.

Anno


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

Date: Wed, 28 Mar 2007 10:38:02 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: Troubleshooting cpan
Message-Id: <280320071038029173%brian.d.foy@gmail.com>

In article <euc0g6$pv$1@reader2.panix.com>, kj
<socyl@987jk.com.invalid> wrote:

> When I try to use the cpan command, attempts to fetch files (e.g.
> 01mailrc.txt.gz) time out.  

If you have access to the net and this isn't working, I suspect you
have a configuration problem, or are using a bad CPAN mirror. Can you
post your configuration?

   $ cpan
   cpan> o conf

Thanks,

-- 
Posted via a free Usenet account from http://www.teranews.com



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

Date: 28 Mar 2007 06:55:22 -0700
From: "MoshiachNow" <lev.weissman@kodak.com>
Subject: Re: Win32::OLE error in thread (ActiveSatate 5.8) on XP
Message-Id: <1175090122.798147.222450@l77g2000hsb.googlegroups.com>

On Mar 26, 9:57 am, "MoshiachNow" <lev.weiss...@kodak.com> wrote:
> HI,
>
> Get error in the following scripts that gets a list of all installed
> SW:
>
> use Win32::OLE('in');
>
> use constant wbemFlagReturnImmediately => 0x10;
> use constant wbemFlagForwardOnly => 0x20;
>
> my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root
> \\CIMV2") or die "WMI connection failed.\n";
> my $colItems = $objWMIService->ExecQuery("SELECT * FROM
> Win32_ProductSoftwareFeatures", "WQL",
>                   wbemFlagReturnImmediately | wbemFlagForwardOnly);
>
> foreach my $objItem (in $colItems) {
>     print STDOUT "objitem=$objItem=\n";
>     my  $product1=$objItem->{Product};
>     $product1 =~ s/.*Name=\"(.*)\"/$1/;
>     $product1 =~ s/\"//g;
>     $products->{$product1}="YES";
>
> }
>
> The error is on one of the items in hash:
>
> Win32::OLE(0.1707): GetOleEnumObject() Not a Win32::OLE::Enum object
> at D:/Perl/lib/Win32/OLE/L
> ite.pm line 167.
>
> I guess that something is wrong with one of the returned hashes.
> How do I skip the bad entry and get only valid entries?
> Thanks

I will appreciate any help on this one.
Thanks



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

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


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