Please ignore the message below b/c I worked through this.

Basically my format code is not printing in a sorted order based off of 'sz' 
yet it is correctly sorted in @sorted_large_files as you can see below SORTED.

How can I tell format to print it sorted based off of 'sz'?

Here is how I am sorting 

@sorted_large_files =
            sort { $meta{$b}->{'sz'} <=> $meta{$a}->{'sz'} } keys %meta ;





REPORT OF LARGE FILES on:
"hostname xxxxx"


Page 1

FileName                                                                 Owner  
  GroupOwner   Gecos                      LastModifiedDate    Size Mb
=========                                                                
=======  ===========  ======                     =================   =======
/var/opt/ignite/media/image.iso                                          root   
  sys          N/A                        17:01:21-09/27/06   98.84
/var/opt/ignite/media/pseudo_root/bootvol.lif                            root   
  sys          N/A                        17:01:20-09/27/06   98.49
/var/opt/ignite/clients/0x001321EAA5D2/recovery/2007-11-16,22:02/flist   bin    
  sys          N/A                        01:03:24-11/17/07   33.47
/var/opt/ignite/clients/0x001321EAA5D2/recovery/2007-10-16,23:39/flist   bin    
  sys          N/A                        02:40:23-10/17/07   32.28
/var/opt/ignite/clients/0x001321EAA5D2/recovery/2007-12-16,22:02/flist   bin    
  sys          N/A                        01:03:16-12/17/07   36.58
/var/opt/ignite/clients/0x00306E3842AF/recovery/2008-01-15,05:43/flist   bin    
  sys          N/A                        05:44:15-01/15/08   34.33
/var/opt/ignite/clients/0x00306E4B4C3A/recovery/2008-01-15,09:44/flist   bin    
  sys          N/A                        09:46:49-01/15/08   28.84
/var/adm/sw/save/PHCO_34255/VXVM-RUN/etc/vx/static.d/build/vold.o        bin    
  bin          N/A                        03:13:11-10/06/04   28.00
/var/opt/ignite/clients/0x00306E3842AF/recovery/2007-12-15,07:49/flist   bin    
  sys          N/A                        07:50:10-12/15/07   34.30
/var/opt/ignite/clients/0x001321EAA5D2/recovery/2008-01-16,23:50/flist   bin    
  sys          N/A                        02:50:59-01/17/08   37.92
/var/opt/ignite/clients/0x00306E4B2BA4/recovery/2008-01-16,06:16/flist   bin    
  sys          N/A                        06:18:46-01/16/08   65.12

SORTED
/var/opt/ignite/media/image.iso
/var/opt/ignite/media/pseudo_root/bootvol.lif
/var/opt/ignite/clients/0x00306E4B2BA4/recovery/2008-01-16,06:16/flist
/var/opt/ignite/clients/0x001321EAA5D2/recovery/2008-01-16,23:50/flist
/var/opt/ignite/clients/0x001321EAA5D2/recovery/2007-12-16,22:02/flist
/var/opt/ignite/clients/0x00306E3842AF/recovery/2008-01-15,05:43/flist
/var/opt/ignite/clients/0x00306E3842AF/recovery/2007-12-15,07:49/flist
/var/opt/ignite/clients/0x001321EAA5D2/recovery/2007-11-16,22:02/flist
/var/opt/ignite/clients/0x001321EAA5D2/recovery/2007-10-16,23:39/flist
/var/opt/ignite/clients/0x00306E4B4C3A/recovery/2008-01-15,09:44/flist
/var/adm/sw/save/PHCO_34255/VXVM-RUN/etc/vx/static.d/build/vold.o

----- Original Message ----
From: oryann9 <[EMAIL PROTECTED]>
To: Perl List <beginners@perl.org>
Sent: Thursday, January 31, 2008 4:57:10 PM
Subject: undefined format error


Hello 
List, 

I 
am 
hoping 
for 
some 
help 
with 
this. 
I 
did 
post 
this 
same 
question 
to 
PerlMonks.

Undefined 
format 
"STDOUT" 
called 
at 
find_hog.tdy 
line 
173.
Line 
173 
is 
the 
1st 
write 
statement, 
but 
since 
there 
are 
snips 
in 
there 
173 
is 
not 
the 
actual 
line 
in 
this 
email.
Just 
look 
for 
1st 
write 
statement.

thank 
you.  
:)


#!/usr/bin/perl


use 
strict 
;
use 
warnings 
;
use 
File::Find 
;
use 
File::Find::Closures 
qw(find_by_min_size) 
;
$ENV{"PATH"} 
= 
qq(/usr/bin:/bin) 
;
delete 
@ENV{qw 
(IFS 
CDPATH 
KSH_ENV)} 
;


my 
( 
$key, 
$keys, 
$user, 
$grp, 
$gcos, 
$mod, 
$mod2, 
$sz, 
) 
;
my 
( 
@sorted_large_files, 
@sorted_root_files, 
);

<snip>


<snip>
  
  
  
  
##-- 
Begin 
Format 
Code 
--##
  
  
  
  
#==========================#

  
  
  
  
$^L 
= 
q{};
  
  
  
  
format 
STDOUT_TOP 
=
  
  
  
  
REPORT 
OF 
LARGE 
FILES 
on:
  
  
  
  
@<<<<<<<<<<
  
  
  
  
qx(hostname)


  
  
  
  
Page 
@<<<
  
  
  
  
$%

  
  
  
  
FileName  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
Owner  
  
GroupOwner  
 
Gecos  
  
  
  
  
  
  
  
  
  
 
LastModifiedDate  
 
Size 
Mb
  
  
  
  
=========================  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
=======  
===========  
======  
  
  
  
  
  
  
  
  
  
=================  
=======
  
  
  
  
.

  
  
  
  
format 
STDOUT 
=
  
  
  
  
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
@<<<<<<< 
@<<<<<<  
  
@<<<<<<<<<<<<<<<<<<<<<<<  
@|||||||||||||  
@##.##
  
  
  
  
@sorted_large_files,  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
dateme($mod,$mod2)

  
  
  
 
.
  
  
  
 
<snip>
  
  
  
 
##-- 
End 
Format 
Code 
--##
  
  
  
 
#========================#

<snip>

END 
{
  
  
close( 
LOG 
) 
or 
warn 
"Log 
'$log' 
failed 
to 
close 
$!" 
;
}






      
____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to