perl

perl

am 10.01.2008 04:30:58 von siri isha

--===============2034126482==
Content-Type: multipart/alternative;
boundary="----=_Part_24019_5560194.1199935858066"

------=_Part_24019_5560194.1199935858066
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi
I have a small doubt regarding perl. Can please help me out...

Usually in perl to count the occurance of a specific variable in the input
we will use "count".
I want to know whether we can assign differnt variables and can be able to
count the total no of that variables in the input...

EXAMPLE:
m_sites = ' ggwxy ', ' ggvtew ', ' gyhtdj ' , ' hhhwqr ' .
i want to know what we can do to count the total no of m_sites in the
input



Thanks in advance
siri

------=_Part_24019_5560194.1199935858066
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


Hi


I have a small doubt regarding perl. Can please help me out...





Usually in perl to count the occurance of a specific variable in the input


we will use "count".


 I want to know whether we can assign differnt variables and can be able to


 count the total no of that variables in the input...





 EXAMPLE:


       m_sites  =  ' ggwxy ',  ' ggvtew ', '  gyhtdj ' , ' hhhwqr ' .


 i want to know what we can do to count the total no of m_sites in the


 input






Thanks in advance

siri



------=_Part_24019_5560194.1199935858066--

--===============2034126482==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============2034126482==--

Re: perl

am 10.01.2008 04:46:42 von Bill Luebkert

siri isha wrote:
> Hi
> I have a small doubt regarding perl. Can please help me out...
>
> Usually in perl to count the occurance of a specific variable in the input
> we will use "count".
> I want to know whether we can assign differnt variables and can be able to
> count the total no of that variables in the input...
>
> EXAMPLE:
> m_sites = ' ggwxy ', ' ggvtew ', ' gyhtdj ' , ' hhhwqr ' .
> i want to know what we can do to count the total no of m_sites in the
> input

That's pretty cryptic. Is m_sites supposed to be a Perl vrbl (ie: $m_sites)
or maybe a config file line ?

If it's a Perl vrbl, you could do a split on /\s*,\s*/ and the array size
would be your count.

Better to post actual code than some strange looking example as above.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs