Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:


I want to take the file name of a file as input as say abc.csv and separate its name as abc and open a new text file as abc_head.txt (where abc is taken from the input file )

so what I am doing is

my $filename = <>; chomp $filename; my @filenam = split ('\.', $filename); my $fi; my $fff=($filenam[0],"_header",".txt"); open($fi,">", $fff) or die "Open failed for $fff: $!";

so what am I doing wrong , because it is not creating abc_header.txt