I am attaching you the full code that I am executing. Here for every input files I am parsing lines starting with / RULECHECK/ .In each line there are 8 set of entries separated by spaces but i have to insert only 2 and 8th entry in output.txt

#!/usr/local/bin/perl -w open (OUT, ">output.txt"); use warnings; use strict; #use Data::Dump; # Debug use File::Basename qw/fileparse/; use File::stat; my %filelist; for my $file (glob '/user/*/ws/*/BLK_*/*.txt') { my $bn = fileparse($file); my $mtime = stat($file)->mtime; #dd $file, $bn, $mtime; # Debug $filelist{$bn} = [$file,$mtime] unless $filelist{$bn} && $filelist{$bn}[1]>$mtime; } #dd \%filelist; # Debug my @filelist = sort map {$_->[0]} values %filelist; #dd \@filelist; # Debug for my $file (@filelist) { my $fname = substr($file, rindex($file,"/")+1, length($file)-ri +ndex($file,"/")-1); #for printing file name in my output printf OUT $fname; open (IN, "<",$file); while ($line = <IN>){ chomp($line); if ($line =~/ RULECHECK/){ @temp = split (/\s+/,$line); $start = $temp[2]; $count = $temp[8]; if($count > 1000){ printf OUT "%-60s %-10s\n",$start,$count; } } } } system ("gedit output.txt");

In reply to Re^4: GLOB function by rahu_6697
in thread GLOB function by rahu_6697

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.