in reply to Perl doesn't read whole file
update: *Please* don't edit your original post deleting parts: if you do, answers are out of context and just look like being delirated out of the blue. To delete something, use <strike> tags, mark additions with a prominent "update". Thanks.
I can't think of why (in normal circumstances) perl would read only part of a file.
Perhaps the file is UTF8 encoded, while your terminal is set to latin1? I have seen terminals been blown up by UTF8, and after the shell gained control, the terminal settings being restored and the prompt returning as if nothing happened.
Do you see the last line of the file in question with the following?
#!/usr/bin/perl -w open(GRADE, "/home/jesse/Desktop/grades/history.txt"); while ($test = <GRADE>) { ; # do nothing } print $test; # print last line close GRADE;
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl doesn't read whole file
by ikegami (Patriarch) on Dec 03, 2007 at 00:42 UTC | |
|
Re^2: Perl doesn't read whole file
by colonelcrayon (Novice) on Dec 02, 2007 at 23:28 UTC | |
by shmem (Chancellor) on Dec 02, 2007 at 23:31 UTC | |
by colonelcrayon (Novice) on Dec 02, 2007 at 23:56 UTC |