AW: CGI-BIN Help/Advise - editing a file - HOW ?

2010-03-15 Thread Thomas Bätzler
newbie01 perl asked: > At the moment, I have some sort of INI/config file that I edit manually > via vi. These config files are "simple" delimited file that are used by > some of the scripts running on the server. > > I want to be able to the same thing via cgi-bin, can anyone advise where > to s

Re: CGI-BIN Help/Advise - editing a file - HOW ?

2010-03-15 Thread Shlomi Fish
Hi newbie01! On Monday 15 Mar 2010 09:39:41 newbie01 perl wrote: > Hi, > > At the moment, I have some sort of INI/config file that I edit manually via > vi. These config files are "simple" delimited file that are used by some of > the scripts running on the server. > > I want to be able to the s

CGI-BIN Help/Advise - editing a file - HOW ?

2010-03-15 Thread newbie01 perl
Hi, At the moment, I have some sort of INI/config file that I edit manually via vi. These config files are "simple" delimited file that are used by some of the scripts running on the server. I want to be able to the same thing via cgi-bin, can anyone advise where to start. Basically, I want to be

Re: editing a file

2001-06-13 Thread Me
> # form a script > local($^I, @ARGV) = ('.bak', glob("*.c")); > while (<>) { > if ($. == 1) { > print "This line should appear at the top of each file\n"; > } > s/\b(p)earl\b/${1}erl/i;# Correct typos, pres

Re: editing a file

2001-06-13 Thread Me
Oops, hadn't finished. 's/(^\s+test\s+)\d+/ $1 . ++$count /e' Breaking this down, s/foo/bar/ means, search $_ ($_ is the current line in many scripts) for something, and then replace what is matched with something else. s/foo(bar)baz/$1/ replaces foobarbaz with bar. Parens "captu

Re: editing a file

2001-06-13 Thread Me
Simplifying: > # Renumber a series of tests from the command line > perl -pi -e 's/(^\s+test\s+)\d+/ $1 . ++$count /e' t/op/taint.t This is what is called a "one-liner". One enters the above at a shell prompt (command line). The "perl -pi -e" combo is a common one for quick on

editing a file

2001-06-13 Thread Teresa Raymond
I'm having difficulty fully understanding what this code is saying/doing... Could someone please, break it down for me into step by step pseudocode? Thank you in advance. # Renumber a series of tests from the command line perl -pi -e 's/(^\s+test\s+)\d+/ $1 . ++$count /e' t/