Thread Filehandler als Parameter an Subroutine übergeben (4 answers)
Opened by beany at 2005-01-21 02:04

betterworld
 2005-01-21 22:30
#4190 #4190
User since
2003-08-21
2614 Artikel
ModeratorIn

user image
Hallo,
so geht es auch:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use strict;
use warnings;

sub lock(*$){
flock($_[0],$_[1]);
}

my $file="foo";
my $text="hallo";
open(FH, ">$file") or die $!;
lock (FH,2);
print FH $text;
lock FH, 8;
close(FH);

View full thread Filehandler als Parameter an Subroutine übergeben