SPUG: lenght of string

O'neil, Jerome joneil at cobaltgroup.com
Wed Oct 6 11:30:12 CDT 2004

Jebuz, Tim, of all the people in the universe, I wouldn't have expected
pedantry from you.

perldoc -f length
     length EXPR
     length  Returns the length in characters of the value of
             EXPR.  If EXPR is omitted, returns length of $_.
             Note that this cannot be used on an entire array or
             hash to find out how many elements these have.  For
             that, use "scalar @array" and "scalar keys %hash"

Works for me, every time.


-----Original Message-----
From: Tim Maher [mailto:tim at consultix-inc.com]
Sent: Tuesday, October 05, 2004 4:15 PM
To: O'neil, Jerome
Cc: 'tim at consultix-inc.com'; spug-list at mail.pm.org
Subject: Re: SPUG: lenght of string

On Tue, Oct 05, 2004 at 03:22:20PM -0700, O'neil, Jerome wrote:
> Yes it has!

Really?  Please explain.  What's %length EXPR, if not just a typo
for length EXPR?

| Tim Maher, CEO     (206) 781-UNIX      (866) DOC-PERL     (866) DOC-UNIX |
| tim(AT)Consultix-Inc.Com  http://TeachMePerl.Com  http://TeachMeUnix.Com |
| Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" |
| Classes! 10/4: UNIX Fundamentals  11/30: Perl  12/6: Shell & Utilities   |

More information about the spug-list mailing list