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
Hi All,
I am very new to Perl, but I sense a great adventure ahead after just
programming with Cobol, Pascal, and C over the last umpteen years. I have
written a perl script where I am trying to detect a non-printing
character(Ctrl@ - Ctrl_) and then substitute a printing ASCII sequence such
a
Hi All,
I have a file which has several occurances of word1 and word2
interspersed with other text. I need to extract only the text which is
contained between consecutive occurances of word1 and word2 in that order.
Is it possible to write a pattern match for this ?
Thanks,
Ramesh
--
To
Hi Here i have two pattern match statements can some
one tell me whether the two are same or not.
match_pattern =
{",\s*",fld,"(\s+\d+)(\s+\d+)(\s+\d+)\s*,"};
changed to the following
match_pattern = {",\s*",fld,"(\s+\d+){3}\s*,"};
is it same or differ
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
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
hi,
I'm trying to write a script to match a pattern like
this: 1.10
I wrote [\d.]+, but this also match with pattern ...
, which has no number in it. Could somebody help me
with it? I'm new to perl and scripts. thanks a lot.
- tao
__
Do
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
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
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
- 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
-
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 = ;
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
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
Hi All,
I have a text file as shown below. How do I match
patterns like the following:
Pattern to be matched:
=
#ifndef def
.. (anything except #if)
#else def
... (anything except #if)
#endif def
My Input Data:
==
Eric Sand wrote:
>
> I am very new to Perl, but I sense a great adventure ahead after just
> programming with Cobol, Pascal, and C over the last umpteen years. I have
> written a perl script where I am trying to detect a non-printing
> character(Ctrl@ - Ctrl_) and then substitute a printing AS
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 09, 2003 11:58 AM
To: [EMAIL PROTECTED]
Subject: Re: Pattern Match
Eric Sand wrote:
>
> I am very new to Perl, but I sense a great adventure ahead after just
> programming with Cobol, Pascal, and C over the last umpteen years. I have
>
On Dec 9, 2003, at 2:37 PM, Tom Kinzer wrote:
Rob, can you explain the details of that replace? That's pretty
slick. I
see you're adding the hex value to get to the appropriate ASCII value,
but
didn't know you could do some of that gyration inside a regex.
The big secret there is the /e modifi
Tom Kinzer wrote:
>
> Rob Dixon wrote:
> >
> > Eric Sand wrote:
> > >
> > > I am very new to Perl, but I sense a great adventure ahead after just
> > > programming with Cobol, Pascal, and C over the last umpteen years. I have
> > > written a perl script where I am trying to detect a non-printin
xample to show what you can do in
a perl regex, it might not be a very good way to do what is ultimately
accomplished.
First, a regular expression pattern match is conducted to find all
chars in the string that are in the desired "special processing"
range. Note that these are ea
but also semantically.
> While it might make a good teaching example to show what you can do in
> a perl regex, it might not be a very good way to do what is ultimately
> accomplished.
>
> First, a regular expression pattern match is conducted to find all
> chars in the string
Rob Dixon writes:
> Robert Brown wrote:
> >
> > Rob Dixon writes:
> >
> > > Tom Kinzer wrote:
> >
> > > I didn't think it was slick at all. In fact I was disappointed that
> > > it looked such a mess, but I don't see a better way.
> >
> > Yes, it is indeed a mess, not only syntacticly,
Robert Brown wrote:
>
> Rob Dixon writes:
> > Robert Brown wrote:
> > >
> > > Rob Dixon writes:
> > >
> > > > Tom Kinzer wrote:
> > >
> > > > I didn't think it was slick at all. In fact I was disappointed that
> > > > it looked such a mess, but I don't see a better way.
> > >
> > > Yes
Eric Sand wrote:
>
> Hi All,
Hello,
> I am very new to Perl,
Welcome. :-)
> but I sense a great adventure ahead after just
> programming with Cobol, Pascal, and C over the last umpteen years.
"Thinking in Perl" may take a while but it is not your grandfather's
programming language (sorry
Rob Dixon wrote:
>
> I didn't think it was slick at all. In fact I was disappointed that it looked
> such a mess, but I don't see a better way. Anyway, the statement is
>
> s/([\x00-\1F])/'^'.chr(ord($1) + 0x40)/eg
>
> where the regex is
>
> ([\x00-\1F])
Oops. That matches the characters
Rob Dixon writes:
> I'm sure you have something useful to say. This seems such a waste of
> your effort.
>
> Rob
I think we are failing to communicate. What I am asking is:
"Does the regular expression mechanism in perl optimize regular
expressions such as the one you used earlier in this t
It was Tuesday, December 09, 2003 when Robert Brown took the soap box, saying:
: Rob Dixon writes:
: > I'm sure you have something useful to say. This seems such a waste of
: > your effort.
: >
: > Rob
:
: I think we are failing to communicate. What I am asking is:
Thanks for the clarificat
Casey West writes:
> : "Does the regular expression mechanism in perl optimize regular
> : expressions such as the one you used earlier in this thread so that
> : the execution overhead is nearly as good as the C approach I outlined
> : earlier in this thread? In other words, for the problem s
Since we're now talking about performance issues, somebody should say something about
precompiling the regular expression, when you can, with either /o or qr(). I had a
process's running time go from 2min 45sec to just under 24sec simply by using qr on
the relevant regular expressions.
Robert
ed.
The stark realisation is that an infinite majority of problems
have no solution at all. This is a Perl newsgroup.
> First, a regular expression pattern match is conducted to find
> all chars in the string that are in the desired "special
> processing" range. Note that these
From: Robert Brown <[EMAIL PROTECTED]>
> Casey West writes:
> > : "Does the regular expression mechanism in perl optimize regular >
> : expressions such as the one you used earlier in this thread so that
> > : the execution overhead is nearly as good as the C approach I
> outlined > : earlier i
On Wed, 10 Dec 2003 20:11:26 +0100,
"Jenda Krynicky" <[EMAIL PROTECTED]> wrote:
>
> 1. Perl builtins and especialy the regular expression engine is
> heavily optimized. So it might very well be quicker to use a regexp
> from Perl than to implement the same stuff in C. Unless you spend a
>
Robert Brown wrote:
> Casey West writes:
> Sorry again for my confusing way of expressing myself. Although I
> wrote my example in C, that was because I am a novice perl programmer,
> but an experienced C programmer, so I expressed my algorithm in C.
>
> The idea was to compare the execution effe
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 string: that it is more efficient to
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
ot;\n";
}
}
Someone else might have a better one, though.
-Original Message-
From: Raghupathy, Ramesh . [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 12, 2002 11:29 AM
To: [EMAIL PROTECTED]
Subject: pattern match
Hi All,
I have a file which has several occurances of word1 and w
On Friday, April 12, 2002, at 12:38 , Raghupathy, Ramesh . wrote:
> I am sorry I was not clear in my question.
>
>The word1 and word2 may occur on different lines of the file and may
> occur in different combinations.
>
> for e.g :
>
> (not showing the new lines..)
>
>
> word1.word1.
> for e.g :
>
> (not showing the new lines..)
>
>
> word1.word1.word1word2word1...word2wor
> d2word2
> .
You're gonna want to check out (in the perldoc perlre manpage) (??{ code
}), which is an example of a recursive regular expression. They have an
exampl
On Friday, April 12, 2002, at 12:58 PM, David Gray wrote:
>> for e.g :
>>
>> (not showing the new lines..)
>>
>>
>> word1.word1.word1word2word1...word2wor
>> d2word2
>> .
>
> You're gonna want to check out (in the perldoc perlre manpage) (??{ code
> }), which
> On Monday, April 15, 2002, at 10:32 AM, Raghupathy, Ramesh . wrote:
>
>> Bob,
>>
>>You are right about what I wanted to achieve. I was wondering, if I
>> could
>> do it using just pattern match, without using any control structures like
>>
Hi there,
This is both frustrating and embarrassing. I can't capture the
following data into a variable. The line I want is:
GIAZUC00
I have tried a multitude of Regex, none seems to be working. Here's
my last attempt:
open(F,"$i");
while (defined( $p = )) {
chomp($p);
($co
28, 2001 11:38 AM
To: Hanson, Robert; '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: pattern match
Hi Here i have two pattern match statements can some
one tell me whether the two are same or not.
match_pattern =
{",\s*",fld,"(\s+\d+)(\s+\d+)(\s+\d+)\s*,&quo
Hi, All:
I want to parse data from a HTML page, data like:
YEMEN
YE
-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
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
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,
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
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
--
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 ( <
> -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
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
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
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 =
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;
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
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.
tao wang wrote:
> hi,
>
> I'm trying to write a script to match a pattern like
> this: 1.10
>
> I wrote [\d.]+, but this also match with pattern ...
> , which has no number in it. Could somebody help me
> with it? I'm new to perl and scripts. thanks a lot.
/^\d+\.\d+/ which says ancho
: [EMAIL PROTECTED]
Subject: pattern match problem
hi,
I'm trying to write a script to match a pattern like
this: 1.10
I wrote [\d.]+, but this also match with pattern ...
, which has no number in it. Could somebody help me
with it? I'm new to perl and scripts. thanks a l
tao wang wrote:
hi,
I'm trying to write a script to match a pattern like
this: 1.10
I wrote [\d.]+, but this also match with pattern ...
, which has no number in it. Could somebody help me
with it? I'm new to perl and scripts. thanks a lot.
\d.\d+
\d+.\d+
\d*.\d*
\d+\.+\d+
\d+\.*\d+
\
On Thu, Feb 13, 2003 at 04:39:17PM -0800, tao wang wrote:
> hi,
>
> I'm trying to write a script to match a pattern like
> this: 1.10
>
> I wrote [\d.]+, but this also match with pattern ...
> , which has no number in it. Could somebody help me
> with it? I'm new to perl and scripts. thank
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
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
/(?<=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
Raghupathy wrote:
> Hi All,
>
> I have a text file as shown below. How do I match
> patterns like the following:
>
> Pattern to be matched:
> =
> #ifndef def
> .. (anything except #if)
> #else def
> ... (anything except #if)
> #endif def
>
>
> My Input Data:
> =
Rob,
The input file you described is not correct, since
it has
#ifdef def2
statement3;
#else
statement4;
#endif
nested within another #ifdef ... #else ... #endif.
My input file is the output of
"diff -D def file1 file2" (on unix). This will
generate a file which has the following pattern
Raghupathy wrote:
> Rob,
>
>The input file you described is not correct, since
> it has
> #ifdef def2
> statement3;
> #else
> statement4;
> #endif
> nested within another #ifdef ... #else ... #endif.
>
> My input file is the output of
> "diff -D def file1 file2" (on unix). This will
> gen
Rob and David,
Thanks very much! That's exactly what I am looking
for and sorry for the misleading subject on the email.
Rob: Could you please explain why you need 2 questions
marks on line#7 instead of just one minimal quantifier
needed (I hope I am using the right words this time
!!!).
Tha
"Raghupathy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Rob and David,
>
> Thanks very much! That's exactly what I am looking
> for and sorry for the misleading subject on the email.
>
>
> Rob: Could you please explain why you need 2 questions
> marks on line#7 instead of just
Hi ,
I need some help me to extract a pattern. The delimiters is a pair of "abcd" and
"efgh". Can some one help me with an efficient use of Greedy and non greedy matches,
look ahead and lookbehind features.
I want the smallest match involving the two delimiters. I want all the matches. i.e.
f
It was Wednesday, December 10, 2003 when Rob Dixon took the soap box, saying:
: Before I finally burst my cyanide capsule, may I.. ?
No, you may not.
I find walking around the block a good way to cool off. Counting to ten
has never done it for me, but you may try. *Both* of you.
Thanks for killi
Dermot Paikkos [mailto:[EMAIL PROTECTED]]
Sent: 05 December 2001 12:32
To: [EMAIL PROTECTED]
Subject: Pattern match woos
Hi there,
This is both frustrating and embarrassing. I can't capture the
following data into a variable. The line I want is:
GIAZUC00
I have tried a multitude of Regex, none
Hello Dermot,
Wednesday, December 05, 2001, Dermot Paikkos <[EMAIL PROTECTED]> wrote:
DP> Hi there,
DP> This is both frustrating and embarrassing. I can't capture the
DP> following data into a variable. The line I want is:
DP> GIAZUC00
DP> I have tried a multitude of Regex, none seems to be w
- Original Message -
From: "Dermot Paikkos" <[EMAIL PROTECTED]>
> Hi there,
> This is both frustrating and embarrassing. I can't capture the
> following data into a variable. The line I want is:
> GIAZUC00
>
> I have tried a multitude of Regex, none seems to be working. Here's
> my last at
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
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,
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
{'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
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
\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
"Pandey Rajeev-A19514" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi ,
Hello
>
> I need some help me to extract a pattern. The delimiters is a pair of
"abcd" and "efgh". Can some one help me with an efficient use of Greedy and
non greedy matches, look ahead and lookbehind feat
Casey West wrote:
>
> : Before I finally burst my cyanide capsule, may I.. ?
>
> No, you may not.
>
> I find walking around the block a good way to cool off. Counting to ten
> has never done it for me, but you may try. *Both* of you.
>
> Thanks for killing the personal tension between you two, on t
It was Wednesday, December 10, 2003 when Rob Dixon took the soap box, saying:
: Casey West wrote:
: >
: > : Before I finally burst my cyanide capsule, may I.. ?
: >
: > No, you may not.
: >
: > I find walking around the block a good way to cool off. Counting to ten
: > has never done it for me, but
I know this must be a stupid question but:
let's suppose I am matching for one of multiple matches.
Is it better/faster to split it into several pattern matches or just keep it
one match?
ie: which would be better/faster?
/:\s*$|^\n$|\*|etc/;
/:\s*$/ || /^\n$/ || /\*/ || /etc/
and just for k
$_=~s/\n//msg;
What does the above match?
LK
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
x27;t figure out how to find the beginning and the end of
the tag. I have been trying to pattern match for the right combo
for an hour and I am just not getting it.
Thanks for any help.
Sample string:
If you compare plant and animal cells, you will discover differences. Plant
cells are stiff and
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:
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
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
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
> I know this must be a stupid question but:
It is not! :)
> Let's suppose I am matching for one of
> multiple matches. Is it better/faster to
> split it into several pattern matches or
> just keep it one match?
>
> ie: which would be better/faster?
If matches can usually be found near
the be
Hello again,
This will remove all new lines from $_.
Shawn
- Original Message -
From: "Postman Pat" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 1:49 AM
Subject: what does this pattern match?
> $_=~s/\n//msg;
>
> Wha
Postman Pat wrote:
>
> $_=~s/\n//msg;
>
> What does the above match?
That matches the newline character (\n) globally (/g) and replaces it
with nothing. The /m option is not needed because the ^ and $ anchors
are not used and the /s option is not needed because there is no . in
the regular exp
Hi, Brian, :)
I'm by no means a Perl expert, but I was intrigued that you asked a
question I *might* actually be able to answer, so here goes:
On Tue, 11 Sep 2001, Bradshaw, Brian wrote:
> I have a string that I want to substitute words for each
> tag. I am pretty sure I want to split the stri
Jason Tiller wrote:
> ...
> #!/usr/bin/perl
>
> # Store the text you provided in your e-mail as a big string.
> $text = <
> # Remove new lines, splitting into an array.
> @text = split( "\n", $text );
>
> # Now weld the string back together, with spaces instead of newlines!
> $text = join(
Hi, Andrea, :)
On Wed, 12 Sep 2001, Andrea Holstein wrote:
> Jason Tiller wrote:
> > # Find the string bounded by "". The '.+?'
> > # finds all characters but isn't greedy; ".+" would match all of the
> > # characters between the first "".
> > # Store this match as $1.
> > while( $text =~ /()/
Thanks for the info I got.
I wound up with: @stringT = split(//i, $qText); to do
what I needed.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
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
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...
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
1 - 100 of 179 matches
Mail list logo