in reply to multiple commands before unless ?

do { commands; } unless $test;

If you don't need the array, you can read-and-print:

# open the file - read # open the file - write while( <FILE> ) { # swap the update_info=blah line to update_info=auto s/^update_info=(?:\w+)/update_info=auto/; print TOFILE $_; } # close file # close file

Replies are listed 'Best First'.
Re: Re: unless
by emilford (Friar) on Jun 25, 2003 at 18:26 UTC
    I could also have done it this way, but I was interested in trying to use/learn about map. That's the main reason why I did it the way I did. Plus, map is just cool. ;-)
      print TOFILE map {s/^update_info=(?:\w+)/update_info=auto/; $_ } <FILE>;