in reply to learning: why doesn't this split work?

$user eq split /.*\(/; - beccause $user is a scalar variable, the output of the split command is the number of items into which it split $_.

if you use  ( $var1, $var2, $var3 ) = split /.*\(/; then the first 3 elements of the list produced by split will be put in those variables.

But I'm suspicous of the regex you're using in the split. Also, the input got mangled - try enclosing it in code tags or pre tags.

--Bob Niederman, http://bob-n.com

All code given here is UNTESTED unless otherwise stated.

Replies are listed 'Best First'.
Re: Re: learning: why doesn't this split work?
by Anonymous Monk on Aug 26, 2003 at 11:15 UTC
    $user does not force scalar context, the eq operator does.