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:
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.
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: do-ing of file without \n at the end
by sgifford (Prior) on Mar 30, 2007 at 16:43 UTC | |
by sawoy (Initiate) on Mar 31, 2007 at 04:38 UTC | |
by sgifford (Prior) on Mar 31, 2007 at 06:31 UTC | |
by ikegami (Patriarch) on Apr 02, 2007 at 00:34 UTC | |
Re: do-ing of file without \n at the end
by Old_Gray_Bear (Bishop) on Mar 30, 2007 at 16:39 UTC | |
Re: do-ing of file without \n at the end
by mreece (Friar) on Mar 30, 2007 at 17:04 UTC | |
by sawoy (Initiate) on Mar 30, 2007 at 17:38 UTC |
Back to
Seekers of Perl Wisdom