SHARE
TWEET

Untitled

a guest Oct 12th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /usr/tmp/env perl
  2.  
  3. use strict;
  4. use 5.010;
  5.  
  6. my $user = $ENV{USER};
  7. my $logname = $ENV{LOGNAME};
  8. my $file_directory = "./ranby.txt";
  9. # my $second_log = "./second.txt";
  10. my $filename = "ranby.txt";
  11. # my $second = "second.txt";
  12. my $timestamp = localtime(time);
  13. # my $path = shift || '/';
  14.  
  15. # traverse($path);
  16.  
  17. # sub traverse {
  18.    # my @queue = @_;
  19.  
  20.     #while (@queue) {
  21.        # my $thing = shift @queue;
  22.         #say $thing;
  23.         #next if not -d $thing;
  24.         #opendir my $dh, $thing or die;
  25.         #while (my $sub = readdir $dh) {
  26.             #next if $sub eq '.' or $sub eq '..';
  27.             #push @queue, "$thing/$sub";
  28.        # }
  29.         #closedir $dh;
  30.     #}
  31.     #return;
  32. #}
  33.  
  34. open(my $filename, ">>", $file_directory)   || die "cant open $file_directory: $!";
  35. binmode($filename);
  36. print $filename "$timestamp, by $user, on $logname\n";
  37. close($filename)    || die "cant close $file_directory: $! ";
RAW Paste Data
Top