Revision 24a9ad0e
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
SL/USTVA.pm | ||
---|---|---|
562 | 562 |
|
563 | 563 |
# return unless (-f $filename); |
564 | 564 |
|
565 |
local *FH; |
|
566 |
|
|
565 | 567 |
open(FH, "$filename") or $form->error("$filename : $!\n"); |
566 | 568 |
my $query = ""; |
567 | 569 |
my $sth; |
... | ... | |
1014 | 1016 |
|
1015 | 1017 |
my ($self, $userpath, $filename) = @_; |
1016 | 1018 |
|
1019 |
local (*FACONF, *FANEW); |
|
1020 |
|
|
1017 | 1021 |
my $form = $main::form; |
1018 | 1022 |
|
1019 |
if (!open(FACONF, "$userpath/$form->{login}_$filename")) { |
|
1020 |
open(FANEW, ">$userpath/$form->{login}_$filename") || |
|
1021 |
$form->error("$userpath/$filename : $!"); |
|
1023 |
$filename = "$form->{login}_$filename"; |
|
1024 |
$filename =~ s|.*/||; |
|
1025 |
$filename = "$userspath/$filename"; |
|
1026 |
|
|
1027 |
if (!open(FACONF, "<", $filename)) { |
|
1028 |
open(FANEW, ">", $filename) || $form->error("$filename : $!"); |
|
1022 | 1029 |
close(FANEW); |
1023 |
open(FACONF, "$userpath/$form->{login}_$filename") || |
|
1024 |
$form->error("$userpath/$form->{username}_$filename : $!"); |
|
1030 |
open(FACONF, "<", $filename) || $form->error("$filename : $!"); |
|
1025 | 1031 |
} |
1026 | 1032 |
|
1027 | 1033 |
while (<FACONF>) { |
Auch abrufbar als: Unified diff
Filehandles lokal deklarieren. open() nur mit "sicherem" Argument aufrufen.