in reply to Error opening a file

Well, that line will not produce that error. We've been through this before, you need to post complete/runnable programs. How (Not) To Ask A Question
$ perl -MO=Deparse,-p -e " my $perl_file = <$dir/scripts/*.pl> use File::Glob (); (my $perl_file = glob(($dir . '/scripts/*.pl'))); -e syntax OK

Replies are listed 'Best First'.
Re^2: Error opening a file
by toniax (Scribe) on Dec 03, 2010 at 14:08 UTC
    This is just a crazy guess , but maybe the variable is not what you expect.
    -X-
Re^2: Error opening a file
by iphone (Beadle) on Dec 03, 2010 at 08:39 UTC

    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> ) { }
      A reply falls below the community's threshold of quality. You may see it by logging in.

      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.