Difference between revisions of "Talk:ThinkLight"

From ThinkWiki
Jump to: navigation, search
 
m
Line 8: Line 8:
 
my $count = $ARGV[0];
 
my $count = $ARGV[0];
  
if ( $count eq "" || $count < 1 )
+
if ( ! defined($count) || $count < 1 )
 
         {
 
         {
 
         $count = 1;
 
         $count = 1;

Revision as of 23:35, 1 May 2006

[code]

  1. !/usr/bin/perl

use strict; use warnings;

  1. $count

my $count = $ARGV[0];

if ( ! defined($count) || $count < 1 )

       {
       $count = 1;
       }

$|=1;

for(my $i=0;$i<$count;$i++) { open(LICHT,">/proc/acpi/ibm/light"); print LICHT "on\n"; close(LICHT); select(undef,undef,undef,0.25); open(LICHT,">/proc/acpi/ibm/light"); print LICHT "off\n"; close(LICHT); select(undef,undef,undef,0.25); }

[/code]