Thread aktuelles Verzeichnis (43 answers)
Opened by J-jayz-Z at 2005-05-15 02:55

J-jayz-Z
 2005-05-16 22:24
#54912 #54912
User since
2005-04-13
625 Artikel
BenutzerIn
[Homepage] [default_avatar]
Ich bekomm trotz hash und die "$!"; folgendes:
Code: (dl )
1
2
3
4
5
rootcris@ingo:~/scripts$ ./filesize.pl -d /home/rootcris/filme/
Use of uninitialized value in hash element at ./filesize.pl line 82.
Use of uninitialized value in sort at ./filesize.pl line 86.
Use of uninitialized value in sort at ./filesize.pl line 86.
Use of uninitialized value in hash element at ./filesize.pl line 91.

Zeile 82:
Code: (dl )
$for{$file} = $_;

Zeile 86:
Code: (dl )
my @sort = sort { $a <=> $b } @size;

Zeile 91:
Code: (dl )
if (-f "$for{$_}")

Da muss irgendwas mit dem hash nicht stimmen,wenn -d ein Verzeichniss ist... :(
Hat da keiner ne idee? Ich denke mal, es hat etwas damit zu tun:
Code: (dl )
$hash{$_} = (-s $_);

Nur wieso geht es bei dem normalen Aufruf und bei -d nicht?
Ich bin voll am Verzweifeln... :rock:
perl -Mstrict -Mwarnings -e 'package blub; sub new { bless {} } sub bar {my $self=shift; $self->{bla}="5065726c2d436f6d6d756e697479"; return $self->{bla};} my $foo=blub->new();print "Hallo ";print pack("H*",$foo->bar()); print "\n"'

http://perl-tutor.de

View full thread aktuelles Verzeichnis