Gossamer Forum
Home : General : Perl Programming :

How to check a length of a field entry?

Quote Reply
How to check a length of a field entry?
Hi,

let's say i do have a variable called $message - how do i check the length of it and display an error message if it's longer than a predefined length?

Thanks for code snippets!


Quote Reply
Re: How to check a length of a field entry? In reply to
perldoc -length

http://www.perl.com/...perlfunc/length.html

Other resources found if you search for length at http://www.perl.com

Please try doing your own research via PERL.COM or other online sources...many references to Perl related sites have been cited in this forum before.

Also, you might want to consider BUYING a Perl reference book, which many good ones have been cited in the support forums in the past!

Regards,

Eliot Lee
Quote Reply
Re: How to check a length of a field entry? In reply to
&error() if (length $message > 50);

Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/