in reply to working with contents of diff. files

Yes we can help. It is nice to see you helping yourself though. This is untested but should do what you want:

#!/usr/bin/perl -w use strict; undef $/; my $all; while (<Dev*.txt>) { open F, $_ or die "Can't open $_: $!\n"; my $content = <F>; close F; $all .= "Name: $_\n$content"; if ($content =~ /\b(\w+\d\d\d)\b/) { my $found = $1; (my $first_two) = $content =~ m/(^[^\n]*\n[^\n]*\n)/; print "Found $found\n$first_two\n"; } } open F, ">res.txt" or die "Can't write res.txt $!\n"; print F $all; close F;

doc

print(s<>ecode?scalar reverse :p)

Replies are listed 'Best First'.
Re: Re: working with contents of diff. files
by Anonymous Monk on Oct 31, 2001 at 00:32 UTC
    Thanks man !! it works ...

      Excellent. Now get a f@#$%^n login and join the crew.

      Yo later dude, see you round like a rissole.

      d-d-doc