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
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
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:
-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).
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
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,
:)
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};
}
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:
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
-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
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
___
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
- 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)
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:
14 matches
Mail list logo