As you're only interested in the properties of one file, stat does indeed look like the more appropriate approach, especially since you seem to care about micro-optimizations in speed so much. It'll return you the user and group IDs as an integer, so look at getpwuid and getgrgid in scalar context, if you want the names.
And finally, as still one more an alternative to your solution while using `ls`, you could use unpack, since `ls` produces fixed with columns. This seems to work for me:
It will strip trailing spaces for the names, but it will not strip leading spaces, for the numbers. I don't know of a template that does strip leading spaces (see perldoc -f pack for the available templates), but it doesn't prevent you using these strings as a number anyway, so I wouldn't worry about them.my ($p, $l, $o, $g, $s) = unpack "A10xA4xA8xA8xA8", `ls -l "$fnm"`;
In reply to Re: Which witch is the quicker witch?
by bart
in thread Which witch is the quicker witch?
by Dismas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |