the file format does not write to the output file

[email protected] (Aruna Goke)
Newsgroups perl.beginners
Message-ID <[email protected]>
If i run the below code it does not right to the voucher.rtf file.

Can you guide on the best way to accomplish this.

#!/usr/bin/perl

use warnings;
use strict;


my ($pin, $pin1, $pin2, $val);

format MINE=


  Voucher @<<<		   Voucher  @<<<               Voucher   @<<<
          $val,                      $val,                        $val,

  PIN @<<<<<<<<<<<<<	   PIN @<<<<<<<<<<<<<        PIN  @<<<<<<<<<<<<<
      $pin,                      $pin1,                    $pin2,













.


my $outvou = '/perl/mycode/progperl/voucher.rtf';

#open the file voucher.rtf for inputs
open TESTFILE, "+>", $outvou or die "cannot open $outvou:$!";

my $testpins = '/perl/mycode/progperl/testpins.txt';
#open the file testpins.txt for reading
open my $fh, '<', $testpins or die "cannot open $testpins:$!";
my $c;

my @result = <$fh>;
my @pin;

for(@result){
	my @line = (split/ /);
	push @pin, $line[0] if $line[1] =~/200acct/
	}
for($c=0; $c <= $#pin; $c++){
	$pin = $pin[$c];
	$pin1 = $pin[$c=$c+1];
	$pin2 = $pin[$c=$c+1];
	$val = 200;
	select(TESTFILE);
	$~ = "MINE";
	write;
}

close $fh;
close (TESTFILE);

extract from  testpins.txt
==========================
5467054961946  200acct
5518935606936  200acct
5559810038657  100acct
5840143221892  200acct
5604116723026  200acct
5490024283962  200acct
5657499629585  200acct
5899894585741  200acct
5750426282431  200acct
5939183545596  200acct
5621825327200  200acct
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.