Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Seeking wisdom of the Perlwiser monks ...
Created this in pieces, combined and whittled the pieces down to the following two lines and cannot figure out how to combine them to the desired one liner.
my ($str) = $input =~ m#^-L(((?!\s*-).)*)#; $input =~ s#-lmylib#$str/mylib.a#;
Any suggestions ??
The details:
# # Input : -L/usr/local/lib -lmylib -lz # Desired output: -L/usr/local/lib /usr/local/lib/mylib.a -lz # use strict; use warnings; # The input string my $input = '-L/usr/local/lib -lmylib -lz'; # The meat my ($str) = $input =~ m#^-L(((?!\s*-).)*)#; $input =~ s#-lmylib#$str/mylib.a#;
Thank y'all for doing what ya do!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help combining two regex's into one
by Kenosis (Priest) on Jan 15, 2013 at 03:19 UTC | |
by Anonymous Monk on Jan 15, 2013 at 06:49 UTC | |
by roboticus (Chancellor) on Jan 15, 2013 at 11:50 UTC | |
by AnomalousMonk (Archbishop) on Jan 16, 2013 at 01:07 UTC | |
by Kenosis (Priest) on Jan 16, 2013 at 02:45 UTC | |
by AnomalousMonk (Archbishop) on Jan 16, 2013 at 04:19 UTC | |
by Kenosis (Priest) on Jan 16, 2013 at 04:38 UTC | |
by LanX (Saint) on Jan 16, 2013 at 03:11 UTC | |
|
Re: Help combining two regex's into one
by Anonymous Monk on Jan 15, 2013 at 08:45 UTC | |
by Anonymous Monk on Jan 15, 2013 at 16:19 UTC |