in reply to Re: How to access directly an element of an array / list returned by a function?
in thread How to access directly an element of an array / list returned by a function?
That doesn't work with the dereferencing operator (->), since the return of File::Spec->splitpath is not a reference. This works:
Stevemy $name = ( File::Spec->splitpath($path) )[2];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to access directly an element of an array / list returned by a function?
by vic2608 (Initiate) on Aug 26, 2010 at 17:47 UTC | |
by Anonymous Monk on Aug 26, 2010 at 19:04 UTC |