in reply to Re: Error opening a file
in thread Error opening a file

It's a very big program,I am trying my best not to confuse you guys by asking short questions. I have a "Datascript.exe",am running that script and saving it in "$Datafile" variable,after saving $Datafile has 100's of lines but now I want to parse each line using a while loop(any loop for that matter) and am running into the errors mentioned.What is the best way I can parse eachline in $Datafile?Please suggest

$Datafile =`Datascript -p=$perl_file`; open $file, '<', $Datafile or die "could not open '$file' $!"; while ( my $match = <$file> ) { }

Replies are listed 'Best First'.
Re^3: Error opening a file
by Anonymous Monk on Dec 03, 2010 at 08:53 UTC
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^3: Error opening a file
by jffry (Hermit) on Dec 09, 2010 at 18:33 UTC

    Run this:

    use strict; use warnings; my $perl_file = WHATEVER_VALUE_THIS_IS_SUPPOSED_TO_BE; my $Datafile = `Datascript -p=$perl_file`; print "Datafile = $Datafile\n";

    Is $Datafile what you expect? That is, is it the name of the file you expect to open?

    EDIT: Added $perl_file = line.