Leser: 1
|< 1 2 >| | 11 Einträge, 2 Seiten |
a39e432b46dd245ab73ff64fc65b17497ec9ae3d date # <hier kein newline oO>
date => "a39e432b46dd245ab73ff64fc65b17497ec9ae3d"
1 2 3 4 5 6 7 8 9 10 11
my @array = ( 'a39e432b46dd245ab73ff64fc65b17497ec9ae3d date', 'a39e432b46dd245ab73ff64fc6asdfijijsdkksdjfks date2', 'a39e432b46dd245ab73ff64fc6asdfijijsdkksdjfks date3', ); my %hash = map{ reverse split / /, $_ }@array; for my $date ( sort keys %hash ){ print $date,"\n"; }
sysopen(FH, "/$directories[$d]/$files[$i]", 'O_RDONLY');
Argument "O_RDONLY" isn't numeric in sysopen at file-check.pl line 33.
Bareword "O_RDONLY" not allowed while "strict subs" ...
Gast+2007-10-04 10:55:07--Wenn ich es ohne die single quotes schreibe gibts den BAREWORD fehler:
Code: (dl )Bareword "O_RDONLY" not allowed while "strict subs" ...
use Fcntl qw(:DEFAULT);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
sub verify_files{ my @correct_hashes = (); ## abgeguckt von renee :P aetsch! open( FILE, '<', "$whitelist" ) or die "Could not open file: $!"; while ( my $f = <FILE> ) { chomp $f; push( @correct_hashes, $f ); } close(FILE); print $correct_hashes[0]; }
Gast+2007-10-04 15:57:46--Code (perl): (dl )1 2 3 4 5 6 7 8## abgeguckt von renee :P aetsch! open( FILE, '<', "$whitelist" ) or die "Could not open file: $!"; while ( my $f = <FILE> ) { chomp $f; push( @correct_hashes, $f ); } close(FILE);
1 2 3 4 5 6 7 8 9
sub verify_files { my( $whitelist ) = @_; open( my $FILE, '<', $whitelist ) or die "Could not open file '$whitelist': $!"; chomp( my @correct_hashes = <$FILE> ); close $FILE; ... }
Quotesysopen(FH, "/$directories[$d]/$files[$i]", 'O_RDONLY');
Gast+2007-10-04 16:09:48--Aber ich hab doch local benutzt. Ist der Gueltigkeitsbereich dann noch in der anderen Funktion?
1 2 3 4 5 6
my $fileContent = do { open( my $FH, '<', $filename ) or die "Error: couldn't read file '$filename': $!\n"; local $/; # slurp mode <$FH>; }; # do
$/ = "\n";
|< 1 2 >| | 11 Einträge, 2 Seiten |