I have a piece of code:
$s = "<sekar kapoor>";
($name) = $s =~ /<([\S\s]*)>/;
print "$name\n"; # Output is 'sekar kapoor'
If the parentheses are removed in the second line of code like this, in the variable $name
:
$name = $s =~ /<([\S\s]*)>/; # $name is now '1'
I don't understand why it behaves like this. Can anyone please explain why it is so?