in reply to Pattern Matching Confusion

Look lenght > for finding length of string.
if (length($var) eq 58){ #do something }

Using an XML parser is much more advisable.

Replies are listed 'Best First'.
Re^2: Pattern Matching Confusion
by davido (Cardinal) on Aug 11, 2005 at 15:33 UTC

    You're trying to link to the length function at perldoc.com. That site is tremendously unstable these days, which is why the Monsatery's POD linking mechanism defaults to perldoc.perl.org. Using square brackets you can link to the pod like this: [doc://length] and get this result: length. Do be sure to spell it right when you link.

    if (length($var) eq 58) { #do something }

    ...should use ==, not eq since you're doing a numeric comparison.


    Dave