in reply to Open Files in Unix
Rather than using an external, non-portable program, you can use File::Find - it comes with Perl, and works pretty well. It also seems like you were trying to imitate the functionality of Tie::File without actually using it - so that didn't work either. Here's an example of how you might use those two to do what you want:
#!/usr/bin/perl -w use strict; use File::Find; use Tie::File; find(\&wanted, '/opt/tivoli/itcam/was/DC/'); sub wanted { return unless /cynlogging.properties/; tie my @file, 'Tie::File', $_ or die "$_: $!\n"; s/DEBUG_MIN/WARN/g for @file; untie @file; }
The second script is close enough to the first one that I'm going to take the easy way out and say "Solution is trivial, and left as an exercise for the student." :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Open Files in Unix
by JavaFan (Canon) on Oct 08, 2008 at 06:44 UTC | |
by oko1 (Deacon) on Oct 08, 2008 at 16:50 UTC | |
by JavaFan (Canon) on Oct 08, 2008 at 19:11 UTC | |
|