Tux

...making Linux just a little more fun!

[sf-perl] TMTOWTDI

Rick Moen [rick at linuxmafia.com]
Mon, 9 Oct 2006 16:31:35 -0700

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.

Cheers, D (wondering why not every data type has a NULL)

-- 
David Fetter <david at fetter.org> https://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!
_____________________________________________
SanFrancisco-pm mailing list
SanFrancisco-pm at pm.org
https://mail.pm.org/mailman/listinfo/sanfrancisco-pm

----- End forwarded message -----

Top    Back


Benjamin A. Okopnik [ben at linuxgazette.net]
Tue, 10 Oct 2006 15:47:40 -0400

On Mon, Oct 09, 2006 at 04:31:35PM -0700, Rick Moen wrote:

> > 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.

#!/usr/bin/perl -w

open(F, "/dev/tty1") or die "tty1: $!\n";

# Turn on the scroll lock LED
$ret = ioctl(F, 0x4b32, 1);
# Sleep for 1 second
sleep 1;
# Turn it off
ioctl(F, 0x4b32, 0);

print "And now, the return code: $ret\n";

close F;

Unix processes normally return either '0' (success) or 1-255 (something other than success), right? Right.

ben at Fenrir:/tmp$ su -c ./led 
Password: 
And now, the return code: 0 but true

Top    Back