[TAG] (forw) Re: [sf-perl] TMTOWTDI
Benjamin A. Okopnik
ben at linuxgazette.net
Tue Oct 10 23:47:40 MSD 2006
On Mon, Oct 09, 2006 at 04:31:35PM -0700, Rick Moen wrote:
> Doing my part to make your day more surreal.
> ----- Forwarded message from David Fetter <david at fetter.org> -----
> Date: Mon, 9 Oct 2006 16:22:23 -0700
> From: David Fetter <david at fetter.org>
> To: San Francisco Perl Mongers User Group <sanfrancisco-pm at pm.org>
> Reply-To: San Francisco Perl Mongers User Group <sanfrancisco-pm at pm.org>
> Subject: Re: [sf-perl] TMTOWTDI
> On Mon, Oct 09, 2006 at 04:12:19PM -0700, David Alban wrote:
> > But I've never (until now) seen anyone do:
> > $somevar *= 0;
> > Everyone's gotta have their own style, I guess.
> That's just beyond weird. I half expected to get something strange
> happening when it was undef, various kinds of references, etc., but
> they didn't.
Ya want style? I'll show ya style.
open(F, "/dev/tty1") or die "tty1: $!\n";
# Turn on the scroll lock LED
$ret = ioctl(F, 0x4b32, 1);
# Sleep for 1 second
# Turn it off
ioctl(F, 0x4b32, 0);
print "And now, the return code: $ret\n";
Unix processes normally return either '0' (success) or 1-255 (something
other than success), right? Right.
ben at Fenrir:/tmp$ su -c ./led
And now, the return code: 0 but true
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *
More information about the TAG