[Kc] sort by mod date

JYOUNG79 at kc.rr.com JYOUNG79 at kc.rr.com
Wed Jun 16 07:57:41 CDT 2004


Hi Garrett,

Sorry for my delayed response.


> > but I never could make it work.  It kept giving me these errors:
> > 
> > *  Argument (file name) isn't numeric in numeric comparison (<=>)
> > *  (62) Use of uninitialized value in string comparison (cmp)
> 
> 
> The script works for me on a Win32 system. Did you cut and past 
> from your
> script or re-type it? 

I had pasted it.


> You might see what the following produces:
> 
> opendir(DIR, shift || "/Users/jay/Desktop/Other Stuff/old stuff 4");
> for my $i (grep { !/^\.{1,2}$/ } readdir(DIR)) {
>  print '['. (stat($i))[9] . ", $i]\n"
> }

Hmm.  I can't seem to make this work.  It's giving me this error:

(19) Use of uninitialized value in concatenation (.) or string

The debugger is giving me this:

[1086789289, .DS_Store]
[, 3002 copy 2]
[, BullsEye Builder]
[, BullsEye Builder copy]
[, BullsEye Builder-Prefs.txt]
[, BullsEye Builder-Prefs.txt old just in case]
[, Convert Quark 4 to 6.applescript]
[, droplet and applett
 test]
[, dude]
[, dude2]
[, GA_Template.qxd 1]
[, illust1.scpt]
[, illust2.scpt]
[, illust3.scpt]
[, Indigo Proofer X]
[, Indigo Proofer X = backup]
[, Personal Macro Workbook]
[, property test]
[, untitled folder]
[, • IndigoPPDs]
Use of uninitialized value in concatenation (.) or string at /Volumes/Data 1/Perl Stuff/Garrett's sort example.pl line 3.
...
(That last line is repeated 19 times (basically for each item))

The debugger points to line 3 as the error:

print '['. (stat($i))[9] . ", $i]\n" 

It looks like it doesn't want to work with 'stat' for some reason.  It might also be this program I'm using (as well as it being on a Mac).  I'm sure I'm just missing something simple here with my lack of knowledge, but let me know if you see something I'm missing.

Thanks for your help.

Jay





More information about the kc mailing list