Hi,

  Try giving absolute path to your file like i.e

  $file = "/home/christo/public_html/files/f1.txt";

  Have a great day.

karthikeyan.

----- Original Message -----
From: Dichev, Christo <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 26, 2002 8:47 PM
Subject: Installation and file processing


>
> Hi,
>
> I am new to Perl - ActivePerl was installed on our local server a few days
> ago. Now I have a problem with opening and closing files. Actually my
> scripts can not handle any file processing. When I try to run the
following
> script from <http://152.12.5.18/dichev/file1.pl>
>
> #!/usr/bin/perl
> use strict;
> use warnings;
> use CGI qw( :standard );
>
> our $file = "f1.txt";
>
> print header(), start_html( "Search Results" );
>
> if( -e $file) { print p("$file exists\n\n!");}
> else {print p("Does not exist: $!\n\n");}
>
> print end_html();
>
> I got an error message:
>
> f1.txt does not exist:  No such file or directory
>
> Although f1.txt is in the same directory with the script. However if I
start
> it from the command line:
>
> F:\> perl file1.pl
>
> it runs without any complains. Also when I try the following simple script
> from <http://152.12.5.18/dichev/file2.pl>
>
> #!/usr/bin/perl
>
>   use strict;
>   use warnings;
>   use CGI qw( :standard );
>
> print header(), start_html( "Search Results" );
>
>   open(IN, "in.txt")
>   or die(print p("Cannot open in.txt for reading: $!"));
>   close(IN) or die(p("Cannot close file: $!"));
>
> print end_html();
>
> I got an error message:
>
>          Cannot open in.txt for reading: No such file or directory
>
>
> Although in.txt is in the same directory with the script. And again from
the
> command it runs without any complains.
>
> I think that the problem stems from installation and improper security
> settings or setting some variables. Any help would be greatly appreciated.
> The system administrator who installed ActivePerl on the (IIS/4.0) server
> has no clue how to solve the problem.
>
> Thanking in advance,
> christo
> _______________________________________________
> Perl-Win32-Web mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>


_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to