Thread windows attrib mit perl?
(40 answers)
Opened by bianca at 2009-10-10 12:31 2009-10-10T14:16:15 pq Keine Ahnung, was Du meinst. Aktueller Code: Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #!/usr/bin/perl -w use strict; use warnings; my $errorbindings = ''; BEGIN { eval "use Win32::File qw/ ARCHIVE /"; if ($@) { $errorbindings = $@; } } if (!$errorbindings) { my $test = Win32::File::GetAttributes ("eval.pl",ARCHIVE); print "test: >$test<\n"; } else { print "Schrott: >$errorbindings<\n" } Bringt: Quotewas allerdings kompletter Unfug ist, weil die Datei das Attribut nicht hat, trotzdem wird 1 geliefert?? Der Beschreibung "All of the functions return FALSE (0) if they fail, unless otherwise noted." nach würde ich vermuten, '0' statt '1' zu bekommen, wenn eine Datei mit der OR-ed combination 'ARCHIVE' diese Bedingung nicht erfüllt. Oder gehör ich in die Klapse? Wenn ich nun DEN NAMEN DES MODULS VERFÄLSCHE (nochmal in Großbuchstaben für pq!) um zu simulieren, dass das Modul nicht geladen werden kann erhalte ich immernoch Ausgabe auf STDOUT, die ich NICHT HABEN WILL: Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #!/usr/bin/perl -w use strict; use warnings; my $errorbindings = ''; BEGIN { eval "use Win32::Filex qw/ ARCHIVE /"; if ($@) { $errorbindings = $@; } } if (!$errorbindings) { my $test = Win32::File::GetAttributes ("eval.pl",ARCHIVE); print "test: >$test<\n"; } else { print "Schrott: >$errorbindings<\n" } Quote 10 print "Hallo"
20 goto 10 |