kitsonrp has asked for the wisdom of the Perl Monks concerning the following question:
output is "user has accessed the system and is"#the next 2 line have been assigned earler in the program from reading + in the config file $filter = "user (.*) has (logged on)"; $output_string = "user $1 has accessed the system and is $2"; #this line has been read in from a log file $log_string = "user bob has logged on"; # need to search the log string and format output string replacing $1 +& $2 $output_string =~s/filter//g; $output_string =~s/(\$\w+)/$1/eeg; print "$output_string\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I use $1 in an assigned string
by chromatic (Archbishop) on May 28, 2003 at 16:21 UTC | |
|
Re: How can I use $1 in an assigned string
by Wonko the sane (Curate) on May 28, 2003 at 15:28 UTC | |
|
Re: How can I use $1 in an assigned string
by Wonko the sane (Curate) on May 28, 2003 at 16:01 UTC | |
|
Re: How can I use $1 in an assigned string
by blokhead (Monsignor) on May 28, 2003 at 16:27 UTC | |
by kitsonrp (Novice) on May 29, 2003 at 07:33 UTC |