From: Alexey Tourbin <at@altlinux.ru> To: ALT Devel discussion list <devel@altlinux.ru> Subject: [devel] Re: Fwd: [AMaViS-user] Perl on Linux bug when reading and the last line does not terminate by a newline Date: Sun, 15 May 2005 22:42:43 +0400 Message-ID: <20050515184242.GO3554@solemn.turbinal.org> (raw) In-Reply-To: <b966c1e40505151021633e1cc8@mail.gmail.com> [-- Attachment #1: Type: text/plain, Size: 771 bytes --] On Sun, May 15, 2005 at 09:21:25PM +0400, Alexey Shabalin wrote: > День добрый. > У нас вроде тоже самое. > Чем это может грозить? Это гонево какое-то. > > http://marc.theaimsgroup.com/?l=amavis-user&m=111458535106056 $ echo -n 'xxxx' | perl -e 'undef $!; while(<>){last if $_ eq "\n"}; $!==0 or die $!' Bad file descriptor at -e line 1, <> line 1. $ Это вовсе не ошибка. $! -- это errno, его нельзя в произвольном месте программы проверять, а *только* сразу после вызова функции, которая вернула "плохой статус" (undef) и которая в этом случае документированно устанавливает errno. Т.е. # правильное использование errno: open(...) or die $!; # редиски: { ... } $!==0 or die $!; Посмотрите в errno(3), там то же самое написано. [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2005-05-15 18:42 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-05-15 17:21 ` [devel] " Alexey Shabalin 2005-05-15 18:42 ` Alexey Tourbin [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20050515184242.GO3554@solemn.turbinal.org \ --to=at@altlinux.ru \ --cc=devel@altlinux.ru \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Team development discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \ devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru public-inbox-index devel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git