Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use warnings;
- # Mendapatkan daftar file text dalam direktori
- my @perl_files = glob("*.txt");
- # Loop melalui setiap file
- foreach my $file (@perl_files) {
- open my $fh, '<', $file or die "Tidak dapat membuka file '$file': $!";
- # Loop melalui setiap baris dalam file
- my $line_number = 0;
- while (my $line = <$fh>) {
- $line_number++;
- # Cari kata kunci dalam setiap baris
- if ($line =~ /\bpicoCTF\b/i) {
- print "File: $file, Baris: $line_number - $line";
- }
- }
- close $fh;
- }
- =begin comment
- 1.extension file .txt bisa dirubah menjadi apapun
- 2. kata picoCTF bisa dirubah menjadi apapun
- =cut
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement