Hi, I am totally new at perl, and everyone here has never used perl on Mac OS X. I am running Leopard 10.5.5
I have a perl script that is supposed to read from a text file with a list of words, input each word into a phrase and write that new phrase into a new file. I have the input and output files in the same folder as the .pl script. I run the script using " perl path/to/file " in the terminal. it does not seem to access the files in the same folder as the script, and creates the output file in /users/home (this really confuses me).
Here is the script:
---------------------------------------------
use strict;
use warnings;
my @inputfiles;
my $j;
my @column;
my $line;
@inputfiles=glob 'audio_file_list.txt';
open OUT, "+>file_path_list.txt";
for ($j=0;$j<=$#inputfiles;$j++)
{
open IN, "<$inputfiles[$j]";
print "$inputfiles[$j]\n";
while (defined ($line = <IN>))
{
chomp $line;
print OUT "sound {wavefile {filename = \"/Audio/$line.wav\";};} $line;\n";
}
}
close IN;
close OUT;
--------------------------------------
Using "use warnings" i get one warning:
readline() on closed filehandle IN at /Users/home/Desktop/EMOFR/Recordings/recording_list/writefromlist.pl line 20.
I think thats it. If you ask me something I will not be able to answer till tomorrow morning (I live in Germany)
Thanks!!!
I have a perl script that is supposed to read from a text file with a list of words, input each word into a phrase and write that new phrase into a new file. I have the input and output files in the same folder as the .pl script. I run the script using " perl path/to/file " in the terminal. it does not seem to access the files in the same folder as the script, and creates the output file in /users/home (this really confuses me).
Here is the script:
---------------------------------------------
use strict;
use warnings;
my @inputfiles;
my $j;
my @column;
my $line;
@inputfiles=glob 'audio_file_list.txt';
open OUT, "+>file_path_list.txt";
for ($j=0;$j<=$#inputfiles;$j++)
{
open IN, "<$inputfiles[$j]";
print "$inputfiles[$j]\n";
while (defined ($line = <IN>))
{
chomp $line;
print OUT "sound {wavefile {filename = \"/Audio/$line.wav\";};} $line;\n";
}
}
close IN;
close OUT;
--------------------------------------
Using "use warnings" i get one warning:
readline() on closed filehandle IN at /Users/home/Desktop/EMOFR/Recordings/recording_list/writefromlist.pl line 20.
I think thats it. If you ask me something I will not be able to answer till tomorrow morning (I live in Germany)

Thanks!!!