|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (7 bit)
Join Date: Mar 2002
Posts: 79
|
I have tried all combinations of quotes and parens in the 'rename ("$file.dat", "$file") || die "can't rename file.dat";' statement. Of course, I started with no quotes or parens at first. The rename to .orig works, the rename to $file does nothing (p.s. don't get the die message either?). Any idea what can be wrong here??
Print of $file and $file.dat From my logfile... 9/18/2002 14:32:43 Updating School Code for Spara9002.txt: 9/18/2002 14:32:43 in = Spara9002.txt 9/18/2002 14:32:43 out = Spara9002.txt.dat } sub doit { my $file; my $fdir; $file = @_[0]; $fdir = "D:\\Inetpub\\ftproot\\datafeeds\\Cardtrans\0000All" logit "Updating School Code for $file:"; open(IN,$file) || die "cannot open $file for READ: $!"; open(OUT,">$file.dat") || die "cannot WRITE $file: $!"; while ( $_ = substr($_, 134, 5) . substr($_, 5); print OUT $_; # print current line to $file.dat; } close IN; close OUT; chmod (0666,$file.dat); rename ("$file.dat", "$file") || die "can't rename file.dat"; rename $file, "$file.orig"; logit "in = $file"; logit "out = $file.dat"; } { |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|