![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community. |
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Storing commands in $variables. | Paulw0t | Shell Programming and Scripting | 7 | 08-08-2008 05:42 PM |
| storing variables in array.Please help | nua7 | Shell Programming and Scripting | 7 | 07-17-2008 09:47 AM |
| Splitting the data and storing it into 2 variables | jisha | Shell Programming and Scripting | 10 | 02-17-2008 10:40 PM |
| Storing pointer array in C | arunkumar_mca | UNIX for Dummies Questions & Answers | 1 | 08-23-2007 08:49 AM |
| awk - storing data in variables | 2nilotpal | Shell Programming and Scripting | 7 | 04-16-2004 05:32 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
perl: storing regex in array variables trouble
hi
this is an example of code: Code:
use strict;
use warnings;
open FILE, "/tmp/result_2";
my $regex="\\[INFO\\] Starting program ver. (.*)";
my $res="Program started, version <$1> - OK.\n";
while (<FILE>) {
if ($_ =~ /($regex)/) {
print "$res";
}
}
close FILE;
![]() |
| Bookmarks |
| Tags |
| perl regex |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|