http://www.perlmonks.org?node_id=607515

sawoy has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

i found some interesting issue during my work.
in simplified way it looks like:

1. enviroment:

perl is v5.8.8, system is debian Eth.

2. files:
$ cat ./conf.conf $a = 'a'; $ cat ./test.pl #!/usr/bin/perl use strict; use warnings; my $file = 'conf.conf'; do $file; if ($! || $@) { die("Can't load $file due: '$!' or '$@'"); } exit 0;

It is major - loaded files should not have \n at the end.

3. result of test.pl run:
$ ./test.pl
Can't load conf.conf due: 'Bad file descriptor' or '' at ./test.pl line 11.

If i add newline symbol then all is ok.

Can somebody tell me: - why perl do that ?
- is it normal (known issue or something else) ?
- is it for my perl version only or not? (haven't now access to other servers for check)


Updated:
1. fix `cat ./conf.conf` -
i used this for show that file has not \n at the end.

2. 2sgifford:
ok, i understand.
but my answer is "why perl can't read file w/o \n in the end "?

Thanks,
alex|sawoy|slex.