| 1 |
#! /usr/local/bin/perl -w |
| 2 |
# |
| 3 |
# wave - draw a pretty picture. On broken platforms the 'select' |
| 4 |
# call may need to be commented out. |
| 5 |
# |
| 6 |
# This file is part of the Tie::Cycle::Sinewave perl extension |
| 7 |
# Copyright (c) 2005 David Landgren. All rights reservered. |
| 8 |
|
| 9 |
use strict; |
| 10 |
use Tie::Cycle::Sinewave; |
| 11 |
|
| 12 |
my $period = shift || 100; |
| 13 |
|
| 14 |
tie my $c, 'Tie::Cycle::Sinewave', { |
| 15 |
start_min => 1, |
| 16 |
min => 2, |
| 17 |
max => 76, |
| 18 |
period => $period, |
| 19 |
}; |
| 20 |
|
| 21 |
while( 1 ) { |
| 22 |
print +(' ' x $c), "*\n"; |
| 23 |
select undef, undef, undef, 0.05; |
| 24 |
} |