>>>>> "Eric" == Eric Veith <erve...@de.ibm.com> writes:
Eric> sudo perl -e 'open($fh, "<", "/tmp/foo"); @f = <$fh>; close($fh); open($fh, Eric> ">", "/tmp/foo"); foreach(@f) { s/^(Key1=).*/$1NewValue1/; print $fh $_; } Eric> close($fh);' Eric> As always, TIMTOWTDI. Much easier way is in-place editing: perl -pi.bak -e 's/^Key1=/Key1=NewValue1/' configfile.cfg -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <mer...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/