On Friday 18 Dec 2009 15:13:24 Simphiwe Mkhize wrote:
> Here is my solution thank you for help
>
What? Have you read what I wrote to you? You didn't reply. This code still
contains many bad and ancient Perl paradigms that I've pointed to you. Please
read what I've written and correct your new code accordingly before
proceeding.
Regards,
Shlomi Fish
> ......
>
> &my_read_dms_booking_folders('c:/bookings') ;
>
> sub my_read_dms_booking_folders{
>
> my ($bookingspath) = @_ ;
>
> opendir(DIR, "$bookingspath") or die "cant open $bookingspath: $!\n";
>
> while(defined(my $folder = readdir(DIR))) {
> if ($folder eq '.') { next ; }
> if ($folder eq '..') { next ; }
>
> opendir(DIR_PHONE, "$bookingspath/$folder") or die "cant open
> $bookingspath/$folder: $!\n";
>
>
> while(defined(my $phone_data = readdir(DIR_PHONE))){
>
> if (substr($phone_data,0,8) eq 'PHONELOG'){
>
> &my_read_data_file($bookingspath,$folder,$phone_data);
> }
> }
> closedir(DIR_PHONE) ;
>
>
> }
>
> closedir(DIR) ;
>
>
> }#-------------------------------------------------------------------------
> -----------------
>
> sub my_read_data_file {
>
>
> my ($bookingspath,$folder,$phone_data) = @_ ;
>
>
> my $phonelog = "$bookingspath/$folder/$phone_data";
>
> $bookref = $folder;
>
> open (P1FILE, "$phonelog") or die "can't open $phonelog: $!";
>
> flock (P1FILE, LOCK_SH) or die "can't lock $phonelog: $!";
>
> while (<P1FILE>)
> {
> chomp;
> @linex = split(/\|/);
> &plfields;
>
>
> &build_days;
> }
>
> close (P1FILE);
>
>
> }
>
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
"The Human Hacking Field Guide" - http://shlom.in/hhfg
Bzr is slower than Subversion in combination with Sourceforge.
( By: http://dazjorz.com/ )
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/