Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: appending file name
by kcott (Archbishop) on Jul 17, 2013 at 10:19 UTC | |
by marinersk (Priest) on Jul 17, 2013 at 16:09 UTC | |
Re: appending file name
by hdb (Monsignor) on Jul 17, 2013 at 09:56 UTC | |
by Anonymous Monk on Jul 17, 2013 at 10:10 UTC | |
by Anonymous Monk on Jul 17, 2013 at 10:25 UTC | |
Re: appending file name
by Rahul6990 (Beadle) on Jul 17, 2013 at 10:09 UTC | |
Re: appending file name
by Skeeve (Parson) on Jul 17, 2013 at 10:46 UTC | |
Re: appending file name
by poj (Abbot) on Jul 17, 2013 at 10:47 UTC | |
Re: appending file name
by mtmcc (Hermit) on Jul 17, 2013 at 10:38 UTC | |
by Anonymous Monk on Jul 17, 2013 at 10:50 UTC | |
by poj (Abbot) on Jul 17, 2013 at 11:26 UTC | |
Re: appending file name
by marinersk (Priest) on Jul 17, 2013 at 16:07 UTC |
Back to
Seekers of Perl Wisdom