[prog] Length of a string in Perl

Wolfgang Petzold petzold at villa-chaos.de
Wed May 28 13:44:52 EST 2003


Hi all!

Dan Richter, 28.05.03:
> What Perl function can I use to get the length of a string?

There's a string function called 'length'. Just try:

$ perl -e '$a="seppel"; print "$a: ", length $a, "\n";'
seppel: 6
$ _

You can find a description in perlfunc(1) by searching for 'length'...


Wolfgang Petzold

PS.
Yes, I'm pretty new to this list, and I have quite enjoyed reading and
browsing through the archives a bit. Again, hello everybody!




More information about the Programming mailing list