Guest User

Untitled

a guest
Oct 17th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.33 KB | None | 0 0
  1. #!usr/bin/perl -w
  2.  
  3. use strict;
  4.  
  5. my($old, $new, $total) = (1, 1, undef);
  6.  
  7. open DATA, ">>data.txt"
  8.     or die "Couldn't access data.txt: $!";
  9. sub math
  10. {
  11.     $total = $old + $new;
  12.         print "$old + $new = $total\n";
  13.         print DATA "$old + $new = $total\n";
  14.     $old = $new;
  15.     $new = $total;
  16.     sleep(1);
  17. }
  18.  
  19. while(1 eq 1)
  20. {
  21.     &math;
  22. }
Add Comment
Please, Sign In to add comment