Help for this page

Select Code to Download


  1. or download this
      foreach($_){
    
  2. or download this
       my ($num,$date,$time,$fw,$type,$action,$alert,$int,$dir,$proto,$src
    +,$dst,$service,$sport,$len,$rule) = (split /;/,$_);
    
  3. or download this
       my (undef, undef, undef, undef, undef, undef, undef, undef, undef, 
    +undef, undef, $dst, $service, undef, undef, undef) = split /;/; # spl
    +it() works on $_ if only one argument is given.
    
  4. or download this
       my ($dst, $service) = (split /;/)[11, 12];
    
  5. or download this
        %hash = (dest => $dst, service => $service); 
        foreach my $key (keys %hash){
    ...
        $count{$val}++;
        } #close foreach
    } #close while
    
  6. or download this
        $count{$_}++ for $dst, $service;
    }
    
  7. or download this
    foreach my $key1 (keys %count){
      print "$key1 appears $count{$key1} times\n"; 
    } #close foreach
    
  8. or download this
    print map "$_ appears $count{$_} times\n", keys %count;
    
  9. or download this
    #!/usr/bin/perl -w
    use strict; 
    ...
    }
    
    print map "$_ appears $count{$_} times\n", keys %count;
    
  10. or download this
    2;0 juerd@ouranos:~$ perl -e'undef christmas'
    Segmentation fault
    2;139 juerd@ouranos:~$