CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
Need script for compare values and send error message


New User

Dec 7, 2009, 8:50 PM

Post #1 of 1 (2301 views)
Need script for compare values and send error message Can't Post

Hi Guys,

I am new to perl...M working in PERL scripting for Informatica Projects,

My Requirement belows:


First it will search for source path for source file and control file.

Once it get these files it go to next step

else send a error

Get source file information from control file

Get in the control file whether the file size filed is 0 or not

IF it is 0 byte file then send a error

IF not then get the record count and file size value

Matches the file size and records count values



Control file structure




I have made some pseudocode but dont know how to implement this,as its not working properly

use strict;
use warnings;
use Cwd;

use File::Find;

$mypath = "D:\Documents and Settings\Desktop";
chdir($mypath) or die "Cant chdir to $mypath $!";
system("ls -lt");

my $search_pattern=$ARGV[0];
my $file_pattern =$ARGV[1];

find(\&d, cwd);

sub d {

my $file = $File::Find::name;

$file =~ s,/,\\,g;

return unless -f $file;
return unless $file =~ /$file_pattern/;

open F, $file or print "couldn't open $file\n" && return;

while (<F>) {
if (my ($found) = m/($search_pattern)/o) {
print "found $found in $file\n";

close F;

Any help will be appreciated.




Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives