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
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
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
> # 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
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
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
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/