Advertisement
Guest User

Untitled

a guest
May 11th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.47 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. foreach $datoteka (@ARGV){
  4.    
  5.     @naziv = split /\./, $datoteka;
  6.     $datum = $naziv[1];
  7.  
  8.     print "Datum: $datum\n";
  9.     print "sat : broj pristupa\n";
  10.     print "------------------------------\n";
  11.  
  12.     %rjecnikSati = ();
  13.    
  14.    
  15.     while(defined($line = <>)){
  16.         chomp($line);
  17.        
  18.         @sati = split /:/, $line;
  19.         $praviSati = $sati[1];
  20.        
  21.         $rjecnikSati{$praviSati} += 1;
  22.     }
  23.  
  24.     foreach $sat (sort keys %rjecnikSati){
  25.         print "$sat : $rjecnikSati{$sat}\n";
  26.     }
  27.    
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement