This works and does what I want it to:
perl -e '@x = split("\\.", "a.b.c"); print $x[0];'
Why does not this work?
perl -e 'print @{split("\\.", "a.b.c")}[0];'
Is there a compact way to take a slice of a split (or other function that
returns an array) without creating a temporary variable?
Thanks,
Siegfried
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
