The value of $string could include dashes or not.  If it is, I'd like
the value of $foo to be set to the portion of the string to the left
of the first dash.  If not, I'd like the value of $foo to be null.

I'm doing the following, but $foo is equal to "1" if there are no
dashes in the string:

$foo = (split('-',$string)),[0];

Can anyone tell me why this is happening?

- Grant

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to