At 15:34 +0200 09.06.98, Johan Almqvist wrote: >Remember: a pattern is not a string. It's neighter an rvalue nor an >lvalue(or so I think) -- you cannot assign from it, and you can't assign >to it. While a pattern isn't an lvalue you can of course use it as an rvalue: - in scalar context it returns true or false if it matches (or not) $x = /foo/; - in list context it returns the list of values matched by the partial matches in parenthesis ($head, $tail) = ( /([a-z]+)foo([a-z]+)/ ); That is patterns are a great tool to destructure your input! What you get depends on the context you put your pattern in. You might want to try the following four cases and check the return values: $x = /[a-z]+/; ($x) = /[a-z]+/; $x = /([a-z]+)/; ($x) = /([a-z]+)/; --jc -- JŸrgen Christoffel, GMD - Forschungszentrum Informationstechnik GmbH E-Mail: christoffel@gmd.de or one of {ftp,news,web}master@gmd.de ***** Want to unsubscribe from this list? ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch