How to best count the number of words in a sentence?

2006-03-23 Thread Foo Ji-Haw
Hi all, This is probably a fun trivial question: I'd like to count the number of words in a string. My command: my $count = split(/\s+/,$line); works. But Perl complains about: Use of implicit split to @_ is deprecated It works, but it's deprecated. I can assign split to an array, then do a

RE: How to best count the number of words in a sentence?

2006-03-23 Thread Chris
Hi all, This is probably a fun trivial question: I'd like to count the number of words in a string. My command: my $count = split(/\s+/,$line); works. But Perl complains about: Use of implicit split to @_ is deprecated It works, but it's deprecated. I can assign split to an array, then do a

RE: How to best count the number of words in a sentence?

2006-03-23 Thread Furnish, Trever G
Just ask for the scalar. Not that I'm saying this is the best way, but at least you're not keeping the array: my $count = scalar split(/\s+/,$line); -t. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Sent: Thursday, March 23, 2006 9:24 AM To:

RE: Get Service Description

2006-03-23 Thread Paul Sobey
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of eyal edri Sent: 23 March 2006 16:38 To: perl-win32-users@listserv.ActiveState.com Subject: Get Service Description I'm using Win32:::OLE('in') to retrive win32 service names (such as alerter).

RE: Reg Expression Help

2006-03-23 Thread Dirk Bremer
Try '^[\[\]a-zA-Z0-9-_. ]+$' Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO - USA Central Time Zone 636-755-2652 fax 636-755-2503 [EMAIL PROTECTED] www.nisc.coop From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

Reg Expression Help

2006-03-23 Thread Scott Purcell
Hello, I have a regular _expression_ in which I am ensuring the user enters some valid characters for our system. Currently the _expression_ is so: '^[a-zA-Z0-9-_. ]+$' Meaning, a user can enter a-z or A-Z or 0-9, dashes, underbars or periods and space. I have a problem now,

RE: Get Service Description

2006-03-23 Thread Steven Manross
:) Steven my $colItems = $objWMIService-ExecQuery(SELECT * FROM Win32_Service, WQL, wbemFlagReturnImmediately | wbemFlagForwardOnly); foreach my $objItem (in $colItems) { print Name: . $objItem-{Name}; print DisplayName: . $objItem-{DisplayName}; }

RE: Reg Expression Help

2006-03-23 Thread Bullock, Howard A.
Scott wrote: How can I incorporate the possibility of having a [ or ] in the user input? /^[a-zA-Z0-9-_. \[\]]+$/ ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe:

RE: Get Service Description

2006-03-23 Thread Ng, Bill
If you want to go the easy way: use Win32::Service; Bill in Brooklyn From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of eyal edriSent: Thursday, March 23, 2006 11:38 AMTo: perl-win32-users@listserv.ActiveState.comSubject: Get Service Description Hi , I'm using

RE: Reg Expression Help

2006-03-23 Thread Wagner, David --- Senior Programmer Analyst --- WGO
-Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Scott PurcellSent: Thursday, March 23, 2006 12:05To: Perl-Win32-Users@listserv.ActiveState.comSubject: Reg _expression_ Help Hello, I have a regular _expression_ in which I am

RE: Reg Expression Help

2006-03-23 Thread Joe Discenza
Scott Purcell wrote, on Thursday, March 23, 2006 3:05 PM : '^[a-zA-Z0-9-_. ]+$' The others helped you get [] in there. But hyphen (dash) has to be first, or it looks like a range operator. So try: ^[-a-zA-Z0-9_. \[\]]+$ Good luck, Joe ___

Possible DynaLoader or MinGW bug?

2006-03-23 Thread Robert May
I've run into an 'interesting' issue when building some of my own XS extensions - I've narrowed the issue somewhat, but am about at the limit of my knowledge (or possibly already beyond it). Can anyone else duplicate the problem? My setup: Win98 Perl 5.8.7 Activestate build 813 MingW (gcc

Re: Possible DynaLoader or MinGW bug?

2006-03-23 Thread Sisyphus
- Original Message - From: Robert May . . Steps to invoke problem: (1) run: h2xs -A -n SomeModule (2) cd into the created SomeModule directory (3) run the incantation: perl -MConfig_m Makefile.PL nmake nmake test Generally this works fine, and the (one)

RE: Reg Expression Help

2006-03-23 Thread lim Ee Wah
Hi, I think you should escape that period and dash as well.'^[a-zA-Z0-9-_. \[\]]+$''^[a-zA-Z0-9\-_\. \[\]]+$'or may be simpler:'^[\w\d_\-\. \[\]]+$' ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: