You don't mention which one you are having problems with.
First off though, you should change
$custdir="/uhome/cachet/temp/temp1/cust/";
to
$custdir="/uhome/cachet/temp/temp1/cust";
as you are adding the trailing slash when you open the file.
open (CHAN, "<$custdir/mail.txt")
^
|
See ??
HTH
John
-----Original Message-----
From: Suresh Babu.A [Support] [mailto:[EMAIL PROTECTED]]
Sent: 30 August 2001 04:10
To: [EMAIL PROTECTED]
Subject: Help Me
Dear All,
I have problem in opening the file and closing it in the below mentioned
script. Kindly help me to fix it.
Thanks in advance.
Thanks
Suresh A.
#!/usr/local/bin/perl -w
$shipdir="/databin/OUTGOING/SHIPMENT/bis/suresh";
$custdir="/uhome/cachet/temp/temp1/cust/";
$tloca="/databin/OUTGOING/SHIPMENT/transferlog";
open (FHAN, "<$shipdir/mail-bis") or die "Couldn't open $shipdir for
reading: $!\n";
open (CHAN, "<$custdir/mail.txt") or die "Couldn't open $custdir for
reading: $!\n";
open (THAN, ">> $tloca/bis") or die "Couldn't open $tloca for writing:
$!\n";
$infile=<FHAN>;
while ($infile ne "") { chomp;
if ( $infile =~ /P\// ) {
@localmail=split (" ",$infile);
($val=$localmail[4])=~ s/\.//g;
$cfile=<CHAN>;
while ($cfile ne "") {
chomp;
if ( $cfile =~ /$val/ ) {
@clmail=split (" ",$cfile);
$count=@clmail;
$clmail[$count-3]=~
s/th|rd|nd//g;
}
$cfile=<CHAN>;
@lmail=join ("^", @localmail);
@smail=join ("^", $clmail[$count-3],$clmail[$count-2]);
$smail[0]=~ s/^P\///g;
printf THAN ("BIS^@lmail^");
printf THAN ("@smail * \n");
}
close (CHAN);
}
$infile=<FHAN>;
}
close (FHAN);
close (THAN);
Thanks
SureshA
[EMAIL PROTECTED]
============================================================================
===
The cause of evil is our desire to be superior to others and our
selfishness.
============================================================================
===
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------Confidentiality--------------------------.
This E-mail is confidential. It should not be read, copied, disclosed or
used by any person other than the intended recipient. Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful. If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]