[28413] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9777 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 27 18:05:55 2006

Date: Wed, 27 Sep 2006 15:05:10 -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, 27 Sep 2006     Volume: 10 Number: 9777

Today's topics:
    Re: An interactive interpreter/shell? <brian.raven@osbsl.co.uk>
        ANN: CGI::ContactForm 1.31 <noreply@gunnar.cc>
    Re: Battlefield Weapon Popularity Trend <wahab@chemie.uni-halle.de>
    Re: Computer Language Popularity Trend <adamm_at_@blic_dot_.net>
    Re: Computer Language Popularity Trend cartercc@gmail.com
    Re: Computer Language Popularity Trend <iamtheari@gmail.com>
    Re: Computer Language Popularity Trend <jstroud@mbi.ucla.edu>
    Re: How to dynamically generate function name and call  <uri@stemsystems.com>
    Re: How to dynamically generate function name and call  <uri@stemsystems.com>
    Re: How to initialize class data? <me@ralphm.info>
    Re: How to initialize class data? <me@ralphm.info>
    Re: How to initialize class data? <bik.mido@tiscalinet.it>
    Re: How to read perl-cgi-crash-outputs WITHOUT telnet a usenet@DavidFilmer.com
        Limit FORM mailer submissions to 5 on website, then pau <lance.botha@gmail.com>
    Re: Limit FORM mailer submissions to 5 on website, then <mgarrish@gmail.com>
    Re: list vs. array <bik.mido@tiscalinet.it>
    Re: Need help with pattern matching/substitution. <shah@typhoon.xnet.com>
    Re: Problem with glob and filenames containing '[' and  <bik.mido@tiscalinet.it>
    Re: sort with Perl .. <joe@inwap.com>
    Re: Spreadsheet::ParseExcel on Windows with out Win32:: (reading news)
    Re: Spreadsheet::ParseExcel on Windows with out Win32:: <mgarrish@gmail.com>
    Re: Spreadsheet::ParseExcel on Windows with out Win32:: (reading news)
    Re: WIn32API and keyboard <rmay@popeslane.clara.co.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 27 Sep 2006 22:19:24 +0100
From: Brian Raven <brian.raven@osbsl.co.uk>
Subject: Re: An interactive interpreter/shell?
Message-Id: <8xk5vwgz.fsf@osbsl.co.uk>

Michele Dondi <bik.mido@tiscalinet.it> writes:

> On 26 Sep 2006 10:22:46 -0700, "robb@acm.org" <robb@acm.org> wrote:
> Err, well, yes: it's a debugger and not an actual interpreter,
> although it offers much of the functionality of the latter. It has
> some commands and stuff that is not a command gets eval()'d in the
> context of the current package. So you may still write basically any
> amount of code you like provided it's all on one line.

See the section on multiline commands in 'perldoc
perldebug'. Essentially, newlines can be escaped with '\'.

HTH

-- 
Brian Raven


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

Date: Wed, 27 Sep 2006 21:56:11 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: ANN: CGI::ContactForm 1.31
Message-Id: <4o03atFc9nmaU1@individual.net>

CGI::ContactForm is a module for generating web contact forms. It lets 
you create an unlimited number of forms with a minimum of effort, and 
makes it possible for e.g. web hosting providers to offer their 
customers an easy way to set up a contact form.

Version 1.31 takes care of an embarrassing bug: under certain (odd) 
conditions, the module entered into an infinite loop. Consequently, if 
you are using CGI::ContactForm, please upgrade ASAP.

     http://search.cpan.org/src/GUNNAR/CGI-ContactForm-1.31/readme.html

Enjoy!

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Wed, 27 Sep 2006 21:46:53 +0200
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: Battlefield Weapon Popularity Trend
Message-Id: <efeko0$bqg$1@mlucom4.urz.uni-halle.de>

Thus spoke Chris Mattern (on 2006-09-27 19:09):
> In article <efd9g0$sn5$1@mlucom4.urz.uni-halle.de>, Mirco Wahab wrote:
>>
>>When the Samurai of medieval Japan were confronted
>>with new 'battlefield language', e.g. early Shotguns,
> 
> "early Shotguns" :D.  Your mastery of the history of
> firearms overwhelms me.

You want a fight? With a muzzle-loaded gun?
Three shots for everybody -- 5 minutes time?

BTW: (http://en.wikipedia.org/wiki/Musket)
    The date of the origin of muskets remains
    unknown, but they are mentioned as early as
    the late 15th century, and they were primarily
    designed for use by infantry. Muskets became
    obsolete by the middle of the 19th century,
    as rifles superseded them.



Regards

Mirco


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

Date: Wed, 27 Sep 2006 19:59:03 +0200
From: Mladen Adamovic <adamm_at_@blic_dot_.net>
Subject: Re: Computer Language Popularity Trend
Message-Id: <efee4p$50r$1@ariane.blic.net>

There is one index at : http://www.tiobe.com/tpci.htm

It isn't much reliable, put still I think it is a bit reliable.

Also, you might use number of open source projects at Sourceforge for 
the given language for giving assumptions, or number of job openings at 
Monster, i.e.




-- 
Mladen Adamovic
http://www.online-utility.org
http://www.cheapvps.info
http://www.vpsreview.com




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

Date: 27 Sep 2006 11:51:16 -0700
From: cartercc@gmail.com
Subject: Re: Computer Language Popularity Trend
Message-Id: <1159383076.926175.55510@m73g2000cwd.googlegroups.com>

sjdevnull@yahoo.com wrote:
> At the site I'm working on, you'd see a URL like
> http://www.whatever.com/login or http://www.whatever.com/boards?id=131
> -- how would you count them?  Such (extensionless) URLs are far more
> common in the Python, Ruby, and Java world in my experience than the
> PHP, Perl, and ASP world, so my first instinct looking at your numbers
> is to believe they're just biased toward languages that more often put
> the extension in the URL.

Yeah. CGI is more than Perl, CGI also includes TCL and Python, and
perhaps some others. In my limited JSP developments, we didn't use file
extensions.

I don't think you can use any measure as an accurate yardstick, but
rather as an impressionistic canvas. Just because there are five times
as many .cgi extensions as .jsp extensions doesn't mean that Perl is
five times more popular that Java. Also, web apps tend to stick around,
and we don't have a sure way to gauge the age of these pages, so it
could be that, in the last year, the ration of JSP to CGI pages is five
to one in favor of JSP.

To some extent, the popularity of technologies is driven by the
available resources. If there are many more Java programmers than Perl
programmers, then Java wil appear to be more popular, and vice versa. I
know that colleges and universities teach Java in their CS and IS
courses, and they don't teach Perl.

CC



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

Date: Wed, 27 Sep 2006 15:25:31 -0400
From: Ari Johnson <iamtheari@gmail.com>
Subject: Re: Computer Language Popularity Trend
Message-Id: <m2fyed9kno.fsf@nibbler.theari.com>

cartercc@gmail.com writes:

> I don't think you can use any measure as an accurate yardstick, but
> rather as an impressionistic canvas.

Exactly.  You can't measure "popularity" without defining the term.
Xah Lee appears to define popularity based on the number of posts made
in a given language's Usenet group (for his choice of which group
belongs to a given language).  Given that a substantial portion of the
recent posts in each group is likely an off-topic Xah Lee crosspost,
this metric is probably unreliable even for measuring his own intended
metric: the amount of discussion taking place about each language on
Usenet.

How do you define popularity?  Do you define it by how much people
talk about a language on the internet?  How many programs are written
in it?  How many lines of code are written in it?  How many CPU cycles
are used to run code written in it?

None of these is fair, as it is.  More people use Ada than talk about
it online, because it is a common language in classified government
work.  More people talk about Lisp online than use it, because their
jobs or other circumstances limit their choice to other languages.
Moreover, most people use more than one language, and after a long day
at the office of pumping out Java or Perl, they go home and talk about
Lisp or C#.  Online discussion isn't a measure of actual use, even if
you can actually measure the total amount of discussion.

The number of programs written is likely to be grossly inaccurate.
People write millions of small C or Perl utilities all the time, to a
combined effect of less problem-solving than one big Java application.

The number of lines of code written in a language is also unfair,
because it takes more lines of C than of almost any other language to
solve most problems.

The number of CPU cycles spent running code that was written in a
given language is also unfair, because, for instance, Ruby code burns
more CPU cycles to do something than C code does, in the average case.

So, how do you define popularity?


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

Date: Wed, 27 Sep 2006 20:52:25 GMT
From: James Stroud <jstroud@mbi.ucla.edu>
Subject: Re: Computer Language Popularity Trend
Message-Id: <dwBSg.5266$TV3.2811@newssvr21.news.prodigy.com>

Sherm Pendley wrote:
> "mark.hoemmen@gmail.com" <mark.hoemmen@gmail.com> writes:
> 
> 
>>Xah Lee wrote:
>>
>>>Computer Language Popularity Trend
>>>
>>
>>Careful there with the sweeping generalizations and quick judgments
> 
> 
> Such things are all Xah does. Look at the distribution list for this
> message - of what possible use is cross-posting something like this to
> five different language groups, unless you're trying to start a cross-
> group argument?
> 
> In short - Please don't feed the trolls.
> 
> sherm--
> 

While Xah does have a reputation for trolling, and the crossposting 
borders on pathological, you must admit that he presents here a bit of 
nice and illuminating research. We probably should encourage him when he 
does worthwhile things, and perhaps, in the future, he will put more 
time towards them and less time towards the trolling for which he is famous.

James

-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/


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

Date: Wed, 27 Sep 2006 17:39:04 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: How to dynamically generate function name and call it?
Message-Id: <x7r6xxq9af.fsf@mail.sysarch.com>

>>>>> "HS" == Hemant Shah <shah@typhoon.xnet.com> writes:

  HS> While stranded on information super highway Brian McCauley wrote:
  >> 
  >> Robert 'phaylon' Sedlacek wrote:
  >> 
  >>> *{'Create' . $TableName . 'Table'}->(@arguments);
  >> 
  >> Or, more simply:
  >> 
  >> "Create${TableName}Table"->(@arguments);

  HS>  Thanks.

why are you saying thanks and quoting the symref answer? i am always
appalled to see symref answers given out when a dispatch table (as you
were shown) is much safer and a better solution.

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: Wed, 27 Sep 2006 17:42:57 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: How to dynamically generate function name and call it?
Message-Id: <x7mz8lq93y.fsf@mail.sysarch.com>

>>>>> "BM" == Brian McCauley <nobull67@gmail.com> writes:

  BM> Tad McClellan wrote:
  >> my %actions = (    # a "dispatch table", untested
  >> TRAC => \&CreateTRACTable,
  >> TRCO => \&CreateTRCOTable
  >> );

  BM> There are two entries in that hash. A soon as you add another one
  BM> you'll hit the rule-of-3. You'll be manually doing the same thing three
  BM> times in succession. In programming this is generally a sign that you
  BM> are doing it wrong.  This is no exception.  You probably should be
  BM> going down the symbolic references path. There are a lot of reasons not
  BM> to use symbolic references in a lot of contexts. This leads some
  BM> people, most vocally Tad, to say they are always a bad thing.  And
  BM> indeed I'll admit that in some purist sense they are always a bad
  BM> thing. But in this case they are not as bad as breaking the rule-of-3
  BM> (IMNSHO).

 i agree with tad about avoiding symrefs. if the command is truly part
 of the function name, then another choice is to use class method calls
 which can be generated without symrefs or breaking strict.

	my $meth = "Create${command}able" ;
	MyClass->$meth( ... ) ;

just make sure all those methods expect (and probably ignore) the class
name as their first argument.

remember:

symrefs are for munging the symbol table, not for flow control or data
structures.

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: Wed, 27 Sep 2006 21:38:34 +0200
From: Ralph Moritz <me@ralphm.info>
Subject: Re: How to initialize class data?
Message-Id: <87u02tnlqd.fsf@ralphm.info>

"Paul Lalli" <mritty@gmail.com> writes:

[snip]
> That is, instead of:
> {
>   package Foo;
>   my $FirstTime = 1;
>   my $data;
>
>   sub new {
>       #...
>       initialize_data() if $FirstTime;
>   }
>
>   sub initialize_data {
>       $data = "Stuff";
>       $FirstTime = 0;
>   }
> }
>
> why aren't you just doing:
>
> {
>   package Foo;
>   my $data = "Stuff";
>
>   sub new {
>      #...
>   }
> }
>
> ?

Because I need to read the value of $data from a config file.

-- 
Ralph Moritz     Ph: +27 846 269 070
GPG Public Key:  http://ralphm.info/public.gpg

"Faith is believing something you know ain't true."


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

Date: Wed, 27 Sep 2006 21:51:44 +0200
From: Ralph Moritz <me@ralphm.info>
Subject: Re: How to initialize class data?
Message-Id: <87psdhnl4f.fsf@ralphm.info>

"Brian McCauley" <nobull67@gmail.com> writes:

> Ralph Moritz wrote:
>> Hi,
>>
>> I've got some class data which I want to initialize once.
[snipped the rest of my original post]
> The canonical way would be an INIT block.
>
> Or sometimes you'll see people just not put the code in a subroutine at
> all.
>
> But both of these will make the initialization code be called even if
> Foo is never instanciated.
>
> If you really want to defer until the first object is instanciated then
> what you are doing is approximately correct. However you should not be
> calling $class->init() you should call Foo->init() or simply init().
> With your code if the first Foo object that's instanciated happens to
> be a of a subclass you'll call init() in that subclass.
>
> Oh and it's probably more ideomatic to reverse the sense of your flag.
>
> my $initialized;
>
> sub init {
>        $initialized++; # Slower than =1 but the more common idiom
>        # etc...
> }
>
> sub new {
>        init unless $initialized;
>        my $class = shift;
>        my $self = bless {}, $class;
>        # etc...
> }

Excellent. Thank you.

-- 
Ralph Moritz     Ph: +27 846 269 070
GPG Public Key:  http://ralphm.info/public.gpg

"Faith is believing something you know ain't true."


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

Date: 27 Sep 2006 22:48:29 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How to initialize class data?
Message-Id: <0rolh2tp973thgg201m5ekd31o8ahe2inl@4ax.com>

On Wed, 27 Sep 2006 21:38:34 +0200, Ralph Moritz <me@ralphm.info>
wrote:

>> why aren't you just doing:
>>
>> {
>>   package Foo;
>>   my $data = "Stuff";
>>
>>   sub new {
>>      #...
>>   }
>> }
>>
>> ?
>
>Because I need to read the value of $data from a config file.

Or because, more generally, you want for some reason to do that
initialization only at the first instantiation of the class, which
indeed is a good point, IMHO...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 27 Sep 2006 11:17:28 -0700
From: usenet@DavidFilmer.com
Subject: Re: How to read perl-cgi-crash-outputs WITHOUT telnet access ?
Message-Id: <1159381048.466986.212600@m7g2000cwm.googlegroups.com>

Patricia Mindanao wrote:
> How can I get the information about what went worng with a certain cgi-script otherwise

use CGI::Carp qw{ carpout fatalsToBrowser warningsToBrowser };

will show you runtime error messages and warnings in your browser
window.

However, it will not show compile-time errors. The script needs to
compile and run for CGI::Carp to do anything.  If the script cannot
compile (for example, if you forgot to close a parenthesis) then Carp
won't help you.

> Imagine I entered in the HTML page a wrong path to the perl cgi script.

You cannot run a script unless you run it.  If your path is wrong the
script cannot run. If the script cannot run then it cannot give you any
debugging info.

FWIW, you should ask your admin to give you HTML access to your
server's error logs. You can look at error logs in a browser without
needing to use telnet.

-- 
David Filmer (http://DavidFilmer.com)



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

Date: 27 Sep 2006 13:57:59 -0700
From: "Lance" <lance.botha@gmail.com>
Subject: Limit FORM mailer submissions to 5 on website, then pause until reviewed by webmaster
Message-Id: <1159390679.678965.208360@b28g2000cwb.googlegroups.com>

Hi everyone,

I was hoping someone could help or point me in the right direction.

I would like to install an intelligent Form mailer on my up and coming
website.
The purpose of the Form mailer will be to either submit to a database
or send an email. However, I would like the form mailer to pause and
prevent any further submissions after 5 submits. During this period new
users visiting the page should automatically be redirect to another URL
displaying a message similar to '5 forms have already been submitted,
please check back soon'.  Once I have reviewed the 5 submitted forms,
I should then be allowed to open the form up again.

Looking forward to your suggestions.

Many thanks,

Lance

P.S - my scripting knowledge is very limited  ;-)



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

Date: 27 Sep 2006 14:59:02 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Limit FORM mailer submissions to 5 on website, then pause until reviewed by webmaster
Message-Id: <1159394342.417409.80540@d34g2000cwd.googlegroups.com>


Lance wrote:

> Hi everyone,
>
> I was hoping someone could help or point me in the right direction.
>
> I would like to install an intelligent Form mailer on my up and coming
> website.
> The purpose of the Form mailer will be to either submit to a database
> or send an email. However, I would like the form mailer to pause and
> prevent any further submissions after 5 submits. During this period new
> users visiting the page should automatically be redirect to another URL
> displaying a message similar to '5 forms have already been submitted,
> please check back soon'.  Once I have reviewed the 5 submitted forms,
> I should then be allowed to open the form up again.
>

[realizing this has absolutely nothing to do with Perl...]

Your requirements are a bit vague, but I'm assuming all submissions go
into the database and the email goes out when you confirm the
submissions? If that is the case, the standard approach is to add a
confirmation column to your table. You can then count the number of
unconfirmed entries before displaying the page and if it already equals
five display your alternate text. You just have to bear in mind that
multiple people could see the form while it still only registers 4
submissions, and they could all try to submit to be the fifth, which
might make some users unhappy when they find out they're actually
number 6,7,8,9... and rejected after filling out the form. It also
means that as you confirm the entries new ones will be able to go in.

If you don't want to be counting all the time from your database, there
are other options but they require a good deal of care to implement.
One would be to create a separate table with just the current count and
check it each time (but you'll need to properly lock the tables during
transactions to ensure accuracy). Another would be to use a text file
for the count, holding a lock on it while the database update occurs
and then wrting the new count. You can then review the five submitted
entries at your leisure but until you reset the count table/text file
no one can submit (i.e., your database won't keep filling up as you
review).

With a limit of 5 it doesn't sound like you're dealing with enough
traffic that you'd need to worry yourself about the latter options,
though.

To give this some Perl content, there are many modules available that
make writing a script like you've described very simple. For databases,
have a look at DBI (and probably DBD::MySQL), and for sending emails
there's Net::SMTP, Mail::Mailer, etc.

Just don't post back asking someone here to write it for you, unless
you enjoy being flamed...

Matt



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

Date: 27 Sep 2006 20:43:51 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: list vs. array
Message-Id: <a9hlh2tn3r5u3l9jf5pq00jsr8ndi7scn7@4ax.com>

On Tue, 26 Sep 2006 21:58:43 +0100, Ben Morrow
<benmorrow@tiscali.co.uk> wrote:

>> For example, when I work with lists and arrays, I usually focus on
>> issues such as do I want to be manipulating arrays or arrayrefs...
>> Which do I want to be using in my APIs, etc.
>
>However, it is important to realize that you cannot pass an array to a
>function, in Perl. You can expand the array into a list of its elements,
>and pass that, or you can take a ref to the array and pass that: which
>you choose makes quite a difference.

Hmmm, previous experience with you taught me that often you corrected
me on something that seemed to be clearly done in a certain way, but
actually wasn't. So I may well be wrong and I foresee the argument to
be controversial anyway, but aren't the \@ and \% prototypes (ok,
recommendations against using prototypes apart) a means to actually
"pass an array" (or hash) to a function. Indeed you pass a reference,
but this reference is taken transparently. From the syntactic pov of
function call it seems to me that the array or hash is actually passed
in. Again prototypes are limited, e.g. you can't pass in an arbitrary
number of arrays this way, yet the mechanism seems to provide an
exception to your claim.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Wed, 27 Sep 2006 18:06:56 +0000 (UTC)
From: Hemant Shah <shah@typhoon.xnet.com>
Subject: Re: Need help with pattern matching/substitution.
Message-Id: <efeek0$chj$3@new7.xnet.com>

While stranded on information super highway Peter Scott wrote:
> On Tue, 26 Sep 2006 22:31:57 +0000, Hemant Shah wrote:
>> I have a script that reads data from a file. Each line in a file is comma
>> seperated list of values.
>> 
>> Example:
>> 
>> DWH_TRRM|'001','A000855747',100,'02-20-2006','CAN DELETE                    '
>> DWH_TRRM|'002','A000855737',146,'02-20-2006','CAN'T DELETE                  '
> 
> That isn't valid in any CSV format I know.  To keep us from guessing,
> please post the specification for the syntax of the lines you are parsing.

 Yes, this is not a valid CSV format. The format is:

 TableName|CSV format for data values.


> 
> -- 
> Peter Scott
> http://www.perlmedic.com/
> http://www.perldebugged.com/
> 

-- 
Hemant Shah                           /"\  ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com       \ /  --------------------- 
                                       X     against HTML mail
TO REPLY, REMOVE NoJunkMail           / \      and postings      
FROM MY E-MAIL ADDRESS.           
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind,                Above opinions are mine only.
it's backed up on tape somewhere.      Others can have their own.


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

Date: 27 Sep 2006 20:32:59 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Problem with glob and filenames containing '[' and ']'
Message-Id: <g4clh2hvb3llm8rhj00tpg9pcgkdn6b5eg@4ax.com>

On Wed, 27 Sep 2006 15:30:20 +0100, David Squire
<David.Squire@no.spam.from.here.au> wrote:

>>   C:\TEMP>perl -le "print for glob 'foo\\[*\\]'"
>>   foo[bar]
>>   foo[baz]
>
>Yeah, as you will see from my second post, the critical thing seems to
>be the presence of an escaped space as well. Thanks.

Then the answer should be File::Glob::bsd_glob(), as of the module's
documentation.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Wed, 27 Sep 2006 12:16:59 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: sort with Perl ..
Message-Id: <Xt2dnar8Z9j5U4fYnZ2dnUVZ_r-dnZ2d@comcast.com>

Taher wrote:

> I dont know why people are annoyed by my request here  ??? I came across a
> problem which I could not solve ( after spending some time on it )

But the information you posted made it look as if you had not spent any
effort in solving your problem.  It's best to show the code you've tried.

> I though this newsgroup was for people to improve  and learned people to
> help others improve their  Perl...... ??

Yes, it is.  Show us the perl code you are attempting to use, and we will
tell you how to improve it.

	-Joe


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

Date: Wed, 27 Sep 2006 19:06:05 GMT
From: "Mumia W. (reading news)" <paduille.4058.mumia.w@earthlink.net>
Subject: Re: Spreadsheet::ParseExcel on Windows with out Win32::OLE
Message-Id: <xYzSg.13416$v%4.1205@newsread1.news.pas.earthlink.net>

On 09/27/2006 11:56 AM, Pam wrote:
> 
> Mumia W. (reading news) wrote:
>> On 09/26/2006 06:11 PM, Pam wrote:
>>> Mumia W. (reading news) wrote:
>>>> On 09/26/2006 04:34 PM, Pam wrote:
>>>>> Hello:
>>>>>
>>>>> I was wondering if anyone knew if it was possible to Parse a file in
>>>>> the Windows
>>>>> enviroment without using the Win32::OLE?  Most of the sample code I see
>>>>> is either
>>>>> writen for UNIX/Linux or Win32:OLE.  Currently I have a Perl script
>>>>> running on Unix
>>>>> on a cron job that works fine and I wrote it in the Windows enviroment
>>>>> but used the
>>>>> Spreadsheet:WriteExcel module and other modules which also works in the
>>>>> UNIX enviroment.  Now I am trying to add more code that will parse the
>>>>> file for a value. But I am having the hardest time I work in the
>>>>> Windows enviroment and the code is put on UNIX by another group so
>>>>> right now I don't have access to UNIX so my code must be written in
>>>>> Windows.  Since previous code was writen using Spreadsheet::WriteExcel,
>>>>> OLE dosen't seem to work with existing code because one writes to a
>>>>> sheet and Win32::OLE uses Workbook at least that is my conclusion from
>>>>> all of my efforts in trying to get my code working.  I am trying to
>>>>> parse an existing spreadsheet with
>>>>>
>>>>> $oBook = Spreadsheet::ParseExcel::Workbook->Parse($original_file)
>>>>>
>>>>> Am I correct in my conclusions? If anyone can answer this I would
>>>>> greatly appreciate it.
>>>>>
>>>>>
>>>>> Pam
>>>>>
>>>> You are correct. Win32::OLE most probably won't work with code written
>>>> for Spreadsheet::{Parse,Write}Excel.
>>>>
>>>> --
>>>> paduille.4058.mumia.w@earthlink.net
>>>
>>> Hi
>>>
>>> Do you know if Spreadsheet::ParseExcel can work on Windows without
>>> using
>>> Win32::OLE?
>>>
>>>
>>> Pam
>>>
>> I've had no experience with Spreadsheet::ParseExcel outside of Linux.
>> However, there is a 99% + 1% chance that Spreadsheet::ParseExcel has no
>> dependency upon Win32::OLE since Win32::OLE only works under Windows,
>> and Spreadsheet::ParseExcel doesn't only work under Windows.
>>
>> Try it for yourself. See if you can write a perl script that uses
>> Spreadsheet::ParseExcel and not Win32::OLE to parse an Excel file.
>>
>>
>> --
>> paduille.4058.mumia.w@earthlink.net
> 
> 
> Hello:
> 
> My original question stated the I was trying to parse an existing Excel
> file and all of the exmples I have seem to  specify using on Win32:OLE
> for Windows or  Spreadsheet_ParseExcel on UNIX/Linux.
> 
> I'm not saying that SpreadSheet::ParseExcel has to be used with
> Win32::OLE.
> I'm saying that when I have looked for sample code it points me to
> Win32:OLE for parsing  in Windows enviorment.
> 
> But I want to use code that will work on Windows or UNIX because the
> script will be put on UNIX for the cron job.
> 
> I have tried and tried and I can't get the Spreadsheet::ParseExcel to
> work in my Windows enviroment.  My original script gets its nformation
> from a database, that coma seperated data is parsed using Text:CSV  I
> create a workbook using  Spreadsheet::WriteExcel to  put that data into
> a sheet  and also to do other formating to that spreadsheet.  So now I
> want to parse that same spreadsheet to see  if a cell is defined or
> undef.
> 
> 
> I can't get Spreadsheet::ParseExcel to work in my Windows enviroment.
> Can someone/anyone point me to some sample code that uses
> Spreadsheet:Parse excel in Windows enviroment.
> 
> 
> 
> Thank You All,
> Pamela
> 

It sounds like your main problem is lack of access to the documentation 
for Spreadsheet::ParseExcel:

http://search.cpan.org/~kwitknr/Spreadsheet-ParseExcel-0.2603/ParseExcel.pm

It should also be on your computer. With Linux, when the module is 
installed, the documentation is also automatically installed. If you 
have ActiveState Perl for Windows, this is probably also the case.

Search in the Programs menu under Perl or Active State or Modules or 
other places. Also, you should be able to use the command line utility 
"perldoc." Open a command prompt and type "perldoc perl" like so:

C:\> perldoc perl

The command "perldoc Spreadsheet::ParseExcel" should show the module's 
documentation:

C:\> perldoc Spreadsheet::ParseExcel



-- 
paduille.4058.mumia.w@earthlink.net


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

Date: 27 Sep 2006 13:53:24 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Spreadsheet::ParseExcel on Windows with out Win32::OLE
Message-Id: <1159390404.437228.117480@e3g2000cwe.googlegroups.com>


Mumia W. (reading news) wrote:

> On 09/27/2006 11:56 AM, Pam wrote:
> >
> > Mumia W. (reading news) wrote:
> >> On 09/26/2006 06:11 PM, Pam wrote:
> >>> Mumia W. (reading news) wrote:
> >>>> On 09/26/2006 04:34 PM, Pam wrote:
> >>>>>
> >>>>> I was wondering if anyone knew if it was possible to Parse a file in
> >>>>> the Windows
> >>>>> enviroment without using the Win32::OLE?

> >>>> You are correct. Win32::OLE most probably won't work with code written
> >>>> for Spreadsheet::{Parse,Write}Excel.

> >>> Do you know if Spreadsheet::ParseExcel can work on Windows without
> >>> using
> >>> Win32::OLE?
> >>>

> >> I've had no experience with Spreadsheet::ParseExcel outside of Linux.
> >> However, there is a 99% + 1% chance that Spreadsheet::ParseExcel has no
> >> dependency upon Win32::OLE since Win32::OLE only works under Windows,
> >> and Spreadsheet::ParseExcel doesn't only work under Windows.
> >>

> > My original question stated the I was trying to parse an existing Excel
> > file and all of the exmples I have seem to  specify using on Win32:OLE
> > for Windows or  Spreadsheet_ParseExcel on UNIX/Linux.
> >

> It sounds like your main problem is lack of access to the documentation
> for Spreadsheet::ParseExcel:
>
> http://search.cpan.org/~kwitknr/Spreadsheet-ParseExcel-0.2603/ParseExcel.pm
>

No, I think her real problem is she doesn't know Perl and she's trying
to hack things together from examples on the web in the hopes something
miraculous will come of it (probably examples that pre-date the
ParseExcel module, from the sound of it). She should take a couple of
steps back and learn some basic Perl (like how to determine if a
variable is defined).

Matt



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

Date: Wed, 27 Sep 2006 21:16:38 GMT
From: "Mumia W. (reading news)" <paduille.4058.mumia.w@earthlink.net>
Subject: Re: Spreadsheet::ParseExcel on Windows with out Win32::OLE
Message-Id: <WSBSg.3292$o71.58@newsread3.news.pas.earthlink.net>

On 09/27/2006 11:56 AM, Pam wrote:
> [...]
> I can't get Spreadsheet::ParseExcel to work in my Windows enviroment.
> Can someone/anyone point me to some sample code that uses
> Spreadsheet:Parse excel in Windows enviroment.
> [...]
> 

I sent a demo program with demo data to your e-mail.

-- 
paduille.4058.mumia.w@earthlink.net


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

Date: Wed, 27 Sep 2006 19:06:47 +0100
From: Robert May <rmay@popeslane.clara.co.uk>
Subject: Re: WIn32API and keyboard
Message-Id: <5rudnQ6raZYlIIfYnZ2dnUVZ8qednZ2d@pipex.net>

Sisyphus wrote:
> "mw" <mbw@vp.pl> wrote in message news:efbam2$t17$1@news.onet.pl...
>> Hi !
>>
>> I test GetAsyncKeyState function on my XP.
>> Here is my code :

[snip code calling GetAsyncKeyState(97)]

>> When I run this code and  press "a"  key I see only  :
>> ret = 0
>> .
>> It means that "a" key is not pressed.
>> What's wrong ?
> 
> No - it means that the numeric keypad "1" key has not been pressed. (These
> are "Virtual-Key" codes, not ascii codes. There should be a listing of them
> somewhere on the Microsoft website.)

URL may wrap:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/VirtualKeyCodes.asp

97 (or 0x61) is VK_NUMERIC1
65 (or 0x41) is the 'A' key - for English layout keyboards use the ascii 
code for the LOWER case letter.

Regards,
Rob.


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

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


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