Skip to content
Advertisement

open command in perl

I am try to use open command in perl. But getting and error as follows.

Command

open(IN_TRIALS, '<', "F:/2010_nist_sre_test_set/data/eval/keys/coreext-coreext.trialkey.csv") or die "cannot open trials list";

Error cannot open trials.

how to fix this?

Advertisement

Answer

First, make sure the file exists in the location: F:/2010_nist_sre_test_set/data/eval/keys/coreext-coreext.trialkey.csv.

Use a modern way to read a file, using a lexical filehandle:

JavaScript

If you’re reading a csv file then it is recommended to use Perl Module Text::CSV_XS.

If you use Text::CSV_XS, here is the syntax:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement