Ok heres the deal, I am trying to parse the 'LIST' output of any unix directory. A file entry goes something like this:
drwx------ 5 anpatel students 512 Jan 13 2000 Desktop
Simple way of getting each field is:
my @properties = split(/s+/,$line);
But this code has one specific flaw. What if the file was "New Text Document.txt", there would be no way saying that $properties[9] was the full name of the file. I thought of improving the code:
my @properties = split( /s+/, $item );
my ( $perms, $lCount, $owner, $group, $size, $mod_mon, $mod_date, $mod_time ) = @properties;
my $file = join( "", @properties[8.. $#properties] );
But $file will be "NewTextDocument.txt" because the &join will compine all the rest of array elements with "".
I was looking for a perfect solution if some one could offer, of-course i am on the hunt. But lets see if some one figures out before me
hehehe
Thanks for reading this!