ok, i tried in UNIX and got no more errors but it doesnt expire after 30 seconds as expected.
-----Original Message-----
From: Timothy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 28, 2002 3:38 PM
To: 'Juban, Nix'; '[EMAIL PROTECTED]'
Subject: RE: alarm function not working

It looks like you tried to use the alarm function on a Win32 machine.  Like your error message says, the alarm() function is not supported on your system.
-----Original Message-----
From: Juban, Nix [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 27, 2002 8:49 PM
To: '[EMAIL PROTECTED]'
Subject: alarm function not working

I made the script below to have this line tumbling like  cartwheel and i want it to run for 30 seconds. Im receiving the error, "The Unsupported function alarm function is unimplemented at C:\PERL\TRAINING\PERL\timedroutine.pl line 11" for the script below. Need help in knowing what i did wrong.  Thanks!

##!/usr/intel/bin/perl -w
use strict;
use warnings;

my $time_to_die=0;
my $timeout=30; #in seconds
my @e=qw(| \ - /);
$SIG{ALRM} = sub { $time_to_die=1; };

alarm($timeout);
while(!$time_to_die)   

{
while (1)
    { foreach (@e)
        {
        print $_."\b";
        }
    }      
}

cheerio,
nix juban
Northwood-V Product Development Engineer
PG12 Tel. # 8-859-2354 (INET)
"While I don't claim to be a great programmer, I try to imitate one. An important trait of the great ones is constructive laziness. They know that you get an A not for effort but for results [...]" -- Eric S. Raymond, "The Cathedral and the Bazaar"

 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to