- or download this
my %fh;
- or download this
while(<>) { # the line read is stored into $_
chomp; # remove line ending character from $_
...
}
- or download this
my( $data, $fh_token ) = split /\s*:\s*/;
- or download this
if( ! $fh{$fh_token}) {
open my $fh, '>', "$fh_token.txt"
...
$fh{$fh_token} = $fh; # store filehandle
}
my $fh = $fh{$fh_token}; # this is the filehandle to print to
- or download this
print $fh $data, "\n"; # append a line break. You'd use "\r\n" on
+windows.
- or download this
my %fh;
while(<>) { # the line read is stored into $_
...
my $fh = $fh{$fh_token};
print $fh $data, "\n"; # append a line break. You'd use "\r\n" on
+windows.
}