
Borderline
Deleted
Jan 9, 2000, 4:05 AM
Post #2 of 2
(1430 views)
|
The answer to this is in Perlfaq5 Files and Formats <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> local($^I, @ARGV) = ('.bak', 'file.txt'); while (<> ) { if ($. == 5) { $line5 = $_; print "his is the 5th line !\n"; next; } print; close ARGV if eof; # Reset $. } </pre><HR></BLOCKQUOTE> If you are doing this inside a block of code you want to do other stuf in undefine $^I line this undef $^I Hope this helped Scott
|