Hi Darryl
After all that I must confess that when I'm making config changes to
multiple servers, I use Rex:
http://rexify.org/
https://metacpan.org/pod/Rex
which is something like Puppet-lite:)
Andrew
On Thu, Jul 14, 2016 at 11:04 PM, Darryl Philip Baker <
darryl.ba...@northwestern.edu> wrote
I settled for an set of stacked if statements, saving the previous line if
needed etc...
Thanks for the help.
Darryl Baker
PMOET -DAPS
X76674
One easier approach:
use Tie::File;
tie( my @array, 'Tie::File', "/path/to/file" )
or die $!;
my $n = 0;
while ( $n <= $#array ) {
if ( $array[$n] =~ /.*[Oo]rder deny,allow(.*)/ and
$n < $#array and $array[$n+1] =~ /[\Dd]eny from all(.*)/ )
{
$n
On Thu, Jul 14, 2016 at 2:56 PM, Rob McAninch
wrote:
>
>
> On Thu, Jul 14, 2016 at 1:24 PM, Darryl Philip Baker <
> darryl.ba...@northwestern.edu> wrote:
>
>> On Thu, Jul 14, 2016 at 10:50 AM, Darryl Philip Baker <
>> darryl.ba...@northwestern.edu> wrote:
>>
>> While not truly a beginner it feels
On Thu, Jul 14, 2016 at 1:24 PM, Darryl Philip Baker <
darryl.ba...@northwestern.edu> wrote:
> On Thu, Jul 14, 2016 at 10:50 AM, Darryl Philip Baker <
> darryl.ba...@northwestern.edu> wrote:
>
> While not truly a beginner it feels that way after not doing anything
> substantial in Perl in many yea
On Thu, Jul 14, 2016 at 1:24 PM, Darryl Philip Baker <
darryl.ba...@northwestern.edu> wrote:
> On Thu, Jul 14, 2016 at 10:50 AM, Darryl Philip Baker <
> darryl.ba...@northwestern.edu> wrote:
>
> While not truly a beginner it feels that way after not doing anything
> substantial in Perl in many yea
On Thu, Jul 14, 2016 at 10:50 AM, Darryl Philip Baker
wrote:
While not truly a beginner it feels that way after not doing anything
substantial in Perl in many years.
I currently need a program to take Apache HTTPD configuration files in HTTPD
2.2 syntax used in current production and convert t
On Thu, Jul 14, 2016 at 10:50 AM, Darryl Philip Baker <
darryl.ba...@northwestern.edu> wrote:
> While not truly a beginner it feels that way after not doing anything
> substantial in Perl in many years.
>
> I currently need a program to take Apache HTTPD configuration files in
> HTTPD 2.2 syntax u
While not truly a beginner it feels that way after not doing anything
substantial in Perl in many years.
I currently need a program to take Apache HTTPD configuration files in HTTPD
2.2 syntax used in current production and convert them to HTTPD 2.4 syntax in
future production. I will need to
I'm guessing the problem is the newline in the regex. If you want it to
match across multiple lines, I think the /ms modifiers should do the trick.
if ( m/{.*}[Oo]rder deny,allow(.*)\n(.*)[Dd]eny from all(.*)/ms) {
NOTE: I haven't tried this myself!:)
failing that,
$ perldoc perlre
may be o
\d)?(PATTERN3)/;
> and one of the patterns is not there, still everything will be shifted to the
> right, won't it? I figured that by naming the captures, I will always know if
> there was a match at the very position intended.
If the regular expression does not match all three p
built-in variables that relate to regular expressions are modified
by every successful pattern match. It is safer to save values that you
may want to use later in a sperate variable. In particular, your regex
m/(?AVG\s\d)/ matches and, because there is no capture named `GFP`
it sets the correspondi
{'GFP'} is $+{'GFP'}.\n";
print "\$+{'AVG'} is $+{'AVG'}.\n";
prints this:
$+{'GFP'} is FILTERS GFP,GFP,100% ACTSHUT 17 AVG 4,1.00 WRT.
$+{'AVG'} is .
So now the match suddenly fails?!?
Hello Florian
First a couple of
Hi all,
I'm parsing a logfile and don't quite understand the behaviour of m//.
From a previous regex match I have already captured $+{'GFP'}:
use strict;
use warnings;
(...)
$text =~ m/ (?FILTERS .*? WRT)/x;# I simply have my whole
logfile in $text - I know there are better solutions.
up
> >if ( eof ) {
> > close ARGV;
> > $accumulator = '';
> > $capture_counter = '';
> > }
> > }
> >
> > The bit about the $capture_counter is because some of the files have
> > multiple blocks
x27;;
>>$capture_counter = '';
>>}
>> }
>>
>> The bit about the $capture_counter is because some of the files have
>> multiple blocks of text that could be accumulated, and I only want the
>> first
>> block in the file.
>>
&g
t; $capture_counter = '';
> }
> }
>
> The bit about the $capture_counter is because some of the files have
> multiple blocks of text that could be accumulated, and I only want the first
> block in the file.
>
> This usually works fine, until I encoun
#x27;;
>}
> }
>
> The bit about the $capture_counter is because some of the files have
> multiple blocks of text that could be accumulated, and I only want the
> first
> block in the file.
>
> This usually works fine, until I encountered an input file that did not
> c
did not
contain the string 'labelsub' after the first '' regex pattern match.
Then the conditional if test continued to search in the incoming lines in
the next file (because I am processing a whole batch using the while (<>)
operator), which it eventually found, and then p
d value in pattern match (m//)
How can I suppress the first "Use of uninitialized value in pattern
match (m//)" warning message. code and output are below.
code
# cat ./fix_archive.pl
#!/usr/bin/perl
use warnings;
use strict;
my @files = <*> unless /.mbox^/;
fore
admin2 wrote:
How can I suppress the first "Use of uninitialized value in pattern
match (m//)" warning message. code and output are below.
Don't suppress a message, but fix the problem.
my @files = <*> unless /.mbox^/;
This is the only pattern match in your script
How can I suppress the first "Use of uninitialized value in pattern
match (m//)" warning message. code and output are below.
code
# cat ./fix_archive.pl
#!/usr/bin/perl
use warnings;
use strict;
my @files = <*> unless /.mbox^/;
foreach my $file (@files) {
admin2 wrote:
How can I suppress the first "Use of uninitialized value in pattern
match (m//)" warning message. code and output are below.
code
# cat ./fix_archive.pl
#!/usr/bin/perl
use warnings;
use strict;
my @files = <*> unless /.mbox^/;
That line read
How can I suppress the first "Use of uninitialized value in pattern
match (m//)" warning message. code and output are below.
code
# cat ./fix_archive.pl
#!/usr/bin/perl
use warnings;
use strict;
my @files = <*> unless /.mbox^/;
foreach my $file (@files) {
p
Date sent: Wed, 27 May 2009 16:50:41 +0800
Subject:Pattern match question
From: Á÷Ë(R)`Oô
To: beginners@perl.org
> Hi, All:
>
> I want to parse data from a HTML page,
You wrote on 05/27/2009 10:50 AM:
> I want to match one ... pair.
>
> my code :
>
> my $pattern = "()";
...
> but I got the whole matches instead of one ... pair each loop.
Do need to de-greedify it.
my $pattern = "()";
This should do the trick.
hth
Alex
--
To unsubscribe, e-mail: beginner
Hi, All:
I want to parse data from a HTML page, data like:
YEMEN
YE
> -Original Message-
> From: jeffqt...@gmail.com [mailto:jeffqt...@gmail.com]
> Sent: Friday, January 23, 2009 12:58
> To: beginners@perl.org
> Subject: Loading results of pattern match into an array - help please
>
> I am trying to split a very long fixed l
> I am trying to split a very long fixed lenght record into its
> constituents, and then load them into an array. I have patterns like
> '^
> (.{3})(.{24})(.{6})...' which gets teh fields into $1, $2, $3 etc. I
> am stumped however as to how to get them into an array in a general
> way. With 'use s
jeffqt...@gmail.com wrote:
I am trying to split a very long fixed lenght record into its
constituents, and then load them into an array. I have patterns like '^
(.{3})(.{24})(.{6})...' which gets teh fields into $1, $2, $3 etc.
my @array = $record =~ /^(.{3})(.{24})(.{6}).../;
I havebasic
On Fri, 2009-01-23 at 11:57 -0800, jeffqt...@gmail.com wrote:
> I am trying to split a very long fixed lenght record into its
> constituents, and then load them into an array. I have patterns like '^
> (.{3})(.{24})(.{6})...' which gets teh fields into $1, $2, $3 etc. I
> am stumped however as to h
I am trying to split a very long fixed lenght record into its
constituents, and then load them into an array. I have patterns like '^
(.{3})(.{24})(.{6})...' which gets teh fields into $1, $2, $3 etc. I
am stumped however as to how to get them into an array in a general
way. With 'use strict' turne
explor wrote:
Hi Gurus,
Hello,
I am new to perl and need some help to learn regex in perl. From the
below line i need to extract following:
Part I
1) $ENVFROM = dapi...@testhost.com
2) $ENVTO1 = te...@etc.com
3) $ENVTO2 = te...@etc.com
4) $ENVTO3 = samt...@abc.com
line=EnvFrom: dapi...@tes
On Sat, Dec 13, 2008 at 19:35, explor wrote:
> Hi Gurus,
> I am new to perl and need some help to learn regex in perl. From the
> below line i need to extract following:
>
> Part I
> 1) $ENVFROM = dapi...@testhost.com
> 2) $ENVTO1 = te...@etc.com
> 3) $ENVTO2 = te...@etc.com
> 4) $ENVTO3 = samt...
Hi Gurus,
I am new to perl and need some help to learn regex in perl. From the
below line i need to extract following:
Part I
1) $ENVFROM = dapi...@testhost.com
2) $ENVTO1 = te...@etc.com
3) $ENVTO2 = te...@etc.com
4) $ENVTO3 = samt...@abc.com
line=EnvFrom: dapi...@testhost.com, HdrTo: ,
EnvTo:
Hello all,
I am trying to automate a simple telnet to port 7010 and give me the
output to the command "gstatus". However, I get the following error:
./telnet_mod.test.pl
pattern match timed-out at ./telnet_mod.test.pl line 6
Here are the contents of
Johan wrote:
>
> The last line of this code
> foreach $PkgFile( @$PkgList )
> {
> if( $PkgFile =~m/^\s*$/)
>
> gives this warning message
> Use of uninitialized value in pattern match (m//) at packagefile.pm
> line 838.
>
> How can I solve this? (
>
> gives this warning message
> Use of uninitialized value in pattern match (m//) at packagefile.pm
> line 838.
>
> How can I solve this? (I have no idea what the code does...)
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
>
The last line of this code
foreach $PkgFile( @$PkgList )
{
if( $PkgFile =~m/^\s*$/)
gives this warning message
Use of uninitialized value in pattern match (m//) at packagefile.pm
line 838.
How can I solve this? (I have no idea what the code does...)
--
To unsubscribe, e-mail: [EMAIL
he following code and receiving the warning :
> >
> > Use of uninitialized value in pattern match (m//) at a.pl line 15.
> >
> >
> > a.pl :
> > /
> >
> **/
> &g
On Dec 4, 2:47 pm, [EMAIL PROTECTED] (Rob Dixon) wrote:
> [EMAIL PROTECTED] wrote:
>
>my ($n,$d) = split /\./, shift, 2;
>
> which specifies the field count in two ways: the third parameter says
> that the string should be split into (a maximum of) two parts. and even
> if that wasn't there the
On Dec 4, 2:47 pm, [EMAIL PROTECTED] (Rob Dixon) wrote:
> [EMAIL PROTECTED] wrote:
> > As it happens, even if there was a '.' as the last character in your
> > input string then you'd still get the same message. This is counter-
> > intuitive but is documented in the documentation of the split()
>
Ankur wrote:
I am running the following code and receiving the warning :
Use of uninitialized value in pattern match (m//) at a.pl line 15.
a.pl :
/
**/
sub CommaFormatted{
my $delimiter
[EMAIL PROTECTED] wrote:
>
On Dec 4, 7:25 am, [EMAIL PROTECTED] (Ankur) wrote:
I am running the following code and receiving the warning :
Use of uninitialized value in pattern match (m//) at a.pl line 15.
That is to be expected.
a
On Dec 4, 7:25 am, [EMAIL PROTECTED] (Ankur) wrote:
> Hi
>
> I am running the following code and receiving the warning :
>
> Use of uninitialized value in pattern match (m//) at a.pl line 15.
That is to be ex
Hi
I am running the following code and receiving the warning :
Use of uninitialized value in pattern match (m//) at a.pl line 15.
a.pl :
/
**/
sub CommaFormatted{
my $delimiter = ','; # replac
On 02/12/2007 04:17 PM, D. Bolliger wrote:
D. Bolliger am Montag, 12. Februar 2007 23:03:
Mumia W. am Montag, 12. Februar 2007 21:53:
On 02/12/2007 02:33 PM, Vladimir Lemberg wrote:
[snipped]
Mumia,
please excuse me for my inappropriate correction!
[...]
No problem. I'm glad I tested it be
D. Bolliger am Montag, 12. Februar 2007 23:03:
> Mumia W. am Montag, 12. Februar 2007 21:53:
> > On 02/12/2007 02:33 PM, Vladimir Lemberg wrote:
[snipped]
Mumia,
please excuse me for my inappropriate correction!
> > You probably want to push the filename onto the array if you get a
> > successfu
Mumia W. am Montag, 12. Februar 2007 21:53:
> On 02/12/2007 02:33 PM, Vladimir Lemberg wrote:
> > Hi,
> >
> > I have a script, which suppose to find all *.xml files under the
> > specified directory then process them. I'm facing the pattern match
> > problem
On 02/12/2007 02:33 PM, Vladimir Lemberg wrote:
Hi,
I have a script, which suppose to find all *.xml files under the specified
directory then process them.
I'm facing the pattern match problem:
use strict;
use warnings;
use Win32;
use File::Find;
@ARGV = Win32::GetCwd() unless @ARGV;
Vladimir Lemberg wrote:
> Hi,
Hello,
> I have a script, which suppose to find all *.xml files under the specified
> directory then process them. I'm facing the pattern match problem:
>
> use strict;
> use warnings;
> use Win32;
> use File::Find;
>
> @ARGV =
Vladimir Lemberg am Montag, 12. Februar 2007 21:33:
> Hi,
Hi Vladimir
(in addition to Davids post)
> I have a script, which suppose to find all *.xml files under the specified
> directory then process them. I'm facing the pattern match problem:
>
> use strict;
> use warni
David,
Thanks you very much! It works -)
- Original Message -
From: "Wagner, David --- Senior Programmer Analyst --- WGO"
<[EMAIL PROTECTED]>
To: "Vladimir Lemberg" <[EMAIL PROTECTED]>;
Sent: Monday, February 12, 2007 12:46 PM
Subject: RE: pattern
> -Original Message-
> From: Vladimir Lemberg [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 12, 2007 12:33
> To: beginners@perl.org
> Subject: pattern match
>
> Hi,
>
> I have a script, which suppose to find all *.xml files under
> the specified dire
Hi,
I have a script, which suppose to find all *.xml files under the specified
directory then process them.
I'm facing the pattern match problem:
use strict;
use warnings;
use Win32;
use File::Find;
@ARGV = Win32::GetCwd() unless @ARGV;
my @dirs;
find (\&FindXml, $ARGV[0]);
su
Ken Foskey schreef:
> open(LYNX,"|-","lynx -source http://www.perl.com/";) or die("Can't open
> lynx: $!");
#!/usr/bin/perl
use warnings ;
use strict ;
my $cmd = 'lynx -source http://www.perl.com/' ;
open my $ph, '-|', $cmd
or die "\nError opening '$cmd', stopped $!" ;
while ( <
On Tue, 2006-07-11 at 18:48 -0700, Timothy Johnson wrote:
> open(LYNX,"<","lynx -source http://www.perl.com/ |") or die("Can't open
> lynx: $!");
I am not sure that this is right.
open(LYNX,"|-","lynx -source http://www.perl.com/";) or die("Can't open
lynx: $!");
I think this is.
Ta
Ken
--
Ryan Dillinger wrote:
>
> Hello,
Hi Ryan
> I had two scripts that were identical, well almost. I ran the two together,
> but straghtened them out. Anyway I have one here, that when ran say's: Use of
> uninitialized value in pattern match (m//) at headline.pl line 7 and 1
Ryan Dillinger wrote:
> [...]
> #!/usr/bin/perl
> use warnings;
> use strict;
>
> open LYNX, "lynx -source http://www.perl.com/ |" or die "Can't open lynx:
> $!";
> $_ = "";
> $_ = until /standard\.def/;
>
If 'standard.def' is not found, this line loops forever.
> my $head = ;
> $head =~ m|^]
Ryan Dillinger wrote:
> Hello,
> I had two scripts that were identical, well almost. I ran the two
> together, but
> straghtened them out. Anyway I have one here, that when ran say's: Use
> of uninitialized
> value in pattern match (m//) at headline.pl line 7 and 10. I ha
Ryan Dillinger wrote:
> Hello,
> I had two scripts that were identical, well almost. I ran the two
> together, but
> straghtened them out. Anyway I have one here, that when ran say's: Use
> of uninitialized
> value in pattern match (m//) at headline.pl line 7 and 10. I ha
-Original Message-
From: Ryan Dillinger [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 11, 2006 6:28 PM
To: beginners@perl.org
Subject: pattern match
Use of uninitialized value in pattern match (m//) at headline.pl line 7
and 10.
#!/usr/bin/perl
use warnings;
use strict;
open
Hello,
I had two scripts that were identical, well almost. I ran the two together,
but
straghtened them out. Anyway I have one here, that when ran say's: Use of
uninitialized
value in pattern match (m//) at headline.pl line 7 and 10. I have changed
differernt things
within, nothing worke
On 1/30/06, Keith Worthington <[EMAIL PROTECTED]> wrote:
snip
> > This may motivate me to hack on that module to add -unsigned and
> > -negative options.
>
> Obviously that would benefit someone in my situation that really doesn't want
> to
> allow negative numbers. I think that hacking a module
On Mon, 30 Jan 2006 13:26:42 -0500, Chas Owens wrote
> On 1/30/06, Keith Worthington <[EMAIL PROTECTED]> wrote:
> snip
> > Well, the answer was right in fromt of me. The delimiter pattern is
> > matching the first hyphen and the integer pattern is matching the
> > second hyphen as a negative sig
On 1/30/06, Keith Worthington <[EMAIL PROTECTED]> wrote:
snip
> Well, the answer was right in fromt of me. The delimiter pattern is mattching
> the first hyphen and the integer pattern is matching the second hyphen as a
> negative sign. Arrrgh!
>
> The Regex::Dommon::Number documentation doesn't
snip
>
> The only challenge is that the $p_number pattern seems to match all of
> the following. 10 1/2 10-1/2 10--1/2
>
> I started out with (\s+|-?) as my delimiter pattern and then when that
> didn't work I changed it to (\s+|-{1,1}). It still matches the case
> with two hyphens. Can you t
On Mon, 30 Jan 2006 10:26:51 -0500, Chas Owens wrote
> On 1/30/06, Keith Worthington <[EMAIL PROTECTED]> wrote:
> snip
> > Wow, it is going to take me some time to wrap my head around this
> > code. I really like the commenting idea. That certainly will
> > help the next time around. I don't g
On Mon, 30 Jan 2006 10:26:51 -0500, Chas Owens wrote
> On 1/30/06, Keith Worthington <[EMAIL PROTECTED]> wrote:
> snip
> > Wow, it is going to take me some time to wrap my head around
> > this code. I really like the commenting idea. That certainly
> > will help the next time around. I don't g
On 1/30/06, Keith Worthington <[EMAIL PROTECTED]> wrote:
snip
> Wow, it is going to take me some time to wrap my head around this code. I
> really like the commenting idea. That certainly will help the next time
> around.
> I don't get the lines where you defined the pattern.
> i.e. my $border
On Fri, 27 Jan 2006 18:31:18 -0500, Chas Owens wrote
> Another thing you can do is break your larger regexes into parts to
> make them more readable/maintainable. It also helps to use the x flag
> so that you can separate the individual tokens and comment them.
>
> #!/usr/bin/perl
>
> use strict
> my $match=qr{#match the whole record for a widget
> ^#start of the record
> $border #a border value
> \s* #optional spaces
> $size#a size value
> \s* #optional spaces
> $tag #a tag value
> $#optional sp
Another thing you can do is break your larger regexes into parts to
make them more readable/maintainable. It also helps to use the x flag
so that you can separate the individual tokens and comment them.
#!/usr/bin/perl
use strict;
use warnings;
use Regexp::Common;
#FIXME: the border value shou
On 1/27/06, Keith Worthington <[EMAIL PROTECTED]> wrote:
snip
> I have tried a couple of things but I am struggling with how to optionally
> match the decimal point.
>
> I think what I need is the code equivilant of:
>zero or more numbers followed by
>zero or one decimal point followed by
Hi All,
I am still a newbie in Perl and it is only with the help of this list that I was
able to construct the following pattern match.
($v_size_str =~ /\d+\s*['"]\s*x\s*\d+\s*['"]/i)
The problem that I have just realized that this string will match the first line
of thi
mark McWilliams wrote:
What is the following telling me , especially the
chunk 2?
Use of uninitialized value in pattern match (m//) at
./lo line 27, <> chunk 2
That means that the variable that is bound to the pattern match contains the
value undef. "chunk 2" means that you are c
What is the following telling me , especially the
chunk 2?
Use of uninitialized value in pattern match (m//) at
./lo line 27, <> chunk 2
I used if (defined ... to get rid of a few other
errors.
this is in reference to the following code edited to
reduce size
while (defined($in = <>
mark McWilliams <mailto:[EMAIL PROTECTED]> wrote:
mark McWilliams <[EMAIL PROTECTED]> wrote:
: I do not know how to get rid of this error
: Use of uninitialized value in pattern match (m//)
:
: Use of uninitialized value in pattern match (m//) at
: ./2new.pl line 97, <> line
I do not know how to get rid of this error
Use of uninitialized value in pattern match (m//)
This is were the error is
if ( defined $modem{$Ascend_Xmit_Rate} =~ /\d/)
{
print " __\t
modem{Ascend_X_Rate}_\t __\n";
Naser Ali wrote:
>
> Naser Ali wrote:
> >
> >I have an array which was created by slurrping a whole text file. There
> >are certain element in the array after reading the files which contain
> >only one word. I want to only match those array elements which contain
> >a single word and print it. Tr
Naser Ali wrote:
It works,
What is it that works?
The data pattern looks like this;
Aword
Yep, that's one word.
Aword Anotherword
That's two words. None of the posted suggestions matches that line.
You said in your original post:
"I want to only match those array elements which contain a single wo
-
From: Roberto Etcheverry [mailto:[EMAIL PROTECTED]
Sent: Monday, June 21, 2004 5:44 PM
To: Naser Ali
Cc: [EMAIL PROTECTED]
Subject: Re: Pattern match
It's difficult to answer if you do not post the code with some input to
test it, but lets suppose you have this:
my @array;
@array = ;
- Original Message -
From: "Naser Ali" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To: <[EMAIL PROTECTED]>
Sent: Monday, June 21, 2004 3:52 PM
Subject: Pattern match
> Hello,
>
> I have an array which was created by slurrping a whole text file. The
It's difficult to answer if you do not post the code with some input to
test it, but lets suppose you have this:
my @array;
@array = ; # slurp whole file
Then is easy to get what you want:
my @lines_with_single_word = grep /^\s*\S+\s*$/,array; # ^\s*\S+\s*$
means beginning of line, 0 or more wh
Naser Ali wrote:
I have an array which was created by slurrping a whole text file.
There are certain element in the array after reading the files
which contain only one word. I want to only match those array
elements which contain a single word and print it.
You need to anchor the word to both the
Hello,
I have an array which was created by slurrping a whole text file. There are
certain element in the array after reading the files which contain only one
word. I want to only match those array elements which contain a single word
and print it. Tried every thing but in vain. I must be doing s
/(?<=Retrieval command for )http:.*?:/){
>
> It prints off the "Retrieval command for" part as it did before :(
>
>
> any ideas?
>
>
> Cheers,
>
> Graeme :)
>
>
>
> >From: Jose Alves de Castro <[EMAIL PROTECTED]>
> >To: Gr
ROTECTED]>
To: Graeme McLaren <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: pattern match question
Date: 05 May 2004 11:09:19 +0100
MIME-Version: 1.0
Received: from onion.perl.org ([63.251.223.166]) by mc5-f36.hotmail.com
with Microsoft SMTPSVC(5.0.2195.6824); Wed, 5 May 2004 03:13:0
I would do
/(?<=Retrieval command for )http:.*?:/
The "Retrieval" part now is contained in a "Look behind section", which
is to mean it's not going to be stored as part of the match.
I'm not sure what other cases you can get in that log file, but this
solves the problem for that particular line
Hi, I'm trying to build a regular expression. to match a URL from a logfile.
In the logfile an example of the pattern I'm trying to match is:
12:12:1:http://10.2.203.1/missing1.html: Retrieval command for
http://10.2.203.1/missing1.html: GET /missing1.html HTTP/1.0
so far I've got:
=~ /^.*?Ret
On Sat, 13 Dec 2003 18:12:17 +0100
Jerry Rocteur <[EMAIL PROTECTED]> wrote:
> I'm trying to be a good boy and use strict and warnings ..
>
> The more I do, the more I feel I'm wasting so much time and should
> become productive, my code looks full of 'my'
Because so many people in c.l.p.m said
> uninitialized value in
> pattern match (m//) at ./getopt.pl line 14.'
Use the standard Getopt::Std module to process options. Don't do it
yourself.
> Line 14 is the while line..
>
> I've tried all sorts of stuff with defined but keep getting syntax
> errors
ttle routing gives me 'Use of uninitialized
value in pattern match (m//) at ./getopt.pl line 14.'
Line 14 is the while line..
I've tried all sorts of stuff with defined but keep getting syntax
errors. I've tried perldoc warnings and perldoc perllexwarn .. In any
case, unl
lies. My DBI Perl is even more of a headache ;-((
Anyway, enough whining, now I've going through code that is working and
thought I'd see the big difference if I change it to use warnings and
strict and this little routing gives me 'Use of uninitialized value in
pattern match (
On Dec 13, 2003, at 10:01 AM, Wiggins d'Anconia wrote:
[..
A decent template, any gurus have improvements?
[..]
my stock gag, looks like:
my $opt = parse_cmd_line_options();
...
#---
# These are the Subs for the parse_cmd_line_options.
#
Wiggins d'Anconia wrote:
> More code showing specifically why I have been rambling about $_ in the
> last couple of days. If you are going to shift off the argument list
> why not just do it in the while loop when you are setting $_?
Thanks, Wiggins, and keep on rambling. The point needs reiter
ing and
> thought I'd see the big difference if I change it to use warnings and
> strict and this little routing gives me 'Use of uninitialized value in
> pattern match (m//) at ./getopt.pl line 14.'
>
> Line 14 is the while line..
'use warnings' will moan at
er coding in Perl for 3+ years...
Anyway, enough whining, now I've going through code that is working and
thought I'd see the big difference if I change it to use warnings and
strict and this little routing gives me 'Use of uninitialized value in
pattern match (m//) at ./getopt
lies. My DBI Perl is even more of a headache ;-((
Anyway, enough whining, now I've going through code that is working and
thought I'd see the big difference if I change it to use warnings and
strict and this little routing gives me 'Use of uninitialized value in
pattern match (
Robert Brown wrote:
>
> R. Joseph Newton writes:
> > When used consciously, with at least a general awareness of the processing
> > load being invoked, regexes can do some really incredible things.
>
> Thanks! I especially appreciate the example you gave showing how to
> trim both ends of a stri
1 - 100 of 179 matches
Mail list logo