I try to get the first element of
$object->method()
that is returning a list.
My first though was to try:
$object->method()[0]
But I get this error:
syntax error at script.pl line 42, near ")["
Execution of script.pl aborted due to compilation errors.
so I tried:
print ($object->method())[0];
but Perl 'eat' the ( )
to use with print, and still have the error.
what I need is to do:
print((object->method())[0]);
Is there a simpler way to do this?