Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counting string length 1

Status
Not open for further replies.

broloc

Programmer
Jun 10, 2002
27
JP
any function in perl to count string length?i've tried length($string) but couldn't make it work.do i have to initialize any module to work with this function?
 
hang on....... before we go through a million workarounds

What's not working about length()? Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
<grin> he he he, well yes -- but even so, length() is a reliable function.... Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
I think his problem is that he is just not capturing the result of length.

$var1='2234';
$var2=length($var1);
print &quot;The length of Variable 1 is $var2&quot;;

This works just fine.
 
thnks a lot guys..got that code working already;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top