Hi,
This piece of code works fine..the output is redirected correctly to mytest.out
#!/usr/bin/perl
$TEST="2005";
system("echo $TEST > mytest.out");
But the below piece of code does not work..the output file mytest.out is empty and display comes on the screen.
Assumption: The file "input" contains string 2005
#!/usr/bin/perl
open (TXNFILE, "input");
$TEST=<TXNFILE>;
system("echo $TEST > mytest.out");
Can someone please tell me why.
Thanks
This piece of code works fine..the output is redirected correctly to mytest.out
#!/usr/bin/perl
$TEST="2005";
system("echo $TEST > mytest.out");
But the below piece of code does not work..the output file mytest.out is empty and display comes on the screen.
Assumption: The file "input" contains string 2005
#!/usr/bin/perl
open (TXNFILE, "input");
$TEST=<TXNFILE>;
system("echo $TEST > mytest.out");
Can someone please tell me why.
Thanks