in reply to Using elements to search a file
where $1 is actually everything after $string. But then you try in your while( <$contin> ) { loop if ( $contractors =~ m/^$string(.*)/ ) Depsite the fact that @contractors has already been regexed away from $string. Its hard to visualize without seeing some example input and output you are after, but you might not want to be matching $string multiple times like that, especially if $contractors is just an element of the array of stuff *after* $string.my @contractors = split(m#\s+#, $1);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using elements to search a file
by GC (Initiate) on May 06, 2009 at 17:55 UTC | |
by jpearl (Scribe) on May 06, 2009 at 18:23 UTC | |
by GC (Initiate) on May 06, 2009 at 18:33 UTC |