CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [1arryb] Help Needed for Pattern Matchin for Variable Seperator. : Edit Log



vikas.deep
User

May 28, 2009, 9:04 AM


Views: 14393
Re: [1arryb] Help Needed for Pattern Matchin for Variable Seperator.

Larry

I simply can't understand what is happening over here. As I have said that if one desires to solve the problem using regular expression then it can't be a general one and every time one will have to design a new one. I solved the case for some malloc(x) something and not for

Code
  for(x=1; x<foo;x++) {   
for( x=1; x<foo;x++ ) {
for( x = 1 ; x < foo; x ++ ) {
if ( x == 3 ) {

where it (regex) will fail obviously.

Then alex stepped in and it seems he created a new problem (Even after he explained from his side I lack a proper understanding)

Code
 my $str = 'x=1.x.x=xxx+(x)x';

and devised a solution to that problem(which he devised) That solution again cannot be applied to the original

Code
  malloc(x) problem

and when I tried that (alex's solution) on the original malloc problem or your test data
my computer says

Code
 C:\ActivePerl>perl larr.pl  
Use of uninitialized value $str in substitution (s///) at larr.pl line 8, <$FH> line 1.
Use of uninitialized value $str in concatenation (.) or string at larr.pl line 9, <$FH> line 1.

and then you put that (alex's)solution to a long list of test data how come you never got this error

Code
 C:\ActivePerl>perl larr.pl  
Use of uninitialized value $str in substitution (s///) at larr.pl line 8, <$FH> line 1.
Use of uninitialized value $str in concatenation (.) or string at larr.pl line 9, <$FH> line 1.

Alex's solution applies only to the case which he imagined/ mentioned in his post something like
my $str = 'x=1.x.x=xxx+(x)x';

I am a beginner in perl and I am not able to understand what is happening over here.

Why do I get a feeling that two grown-ups and/or more experienced persons over here are talking/discussing some serious matter even though all of it was how to sustitute "tainted" in some malloc(x) thing
Kindly explain a bit

Quote
-For all my suggestions " I am sure someone else can do it in a better or elegant manner!"

(This post was edited by vikas.deep on May 28, 2009, 9:10 AM)


Edit Log:
Post edited by vikas.deep (User) on May 28, 2009, 9:10 AM: i forgot alex's problem/solution


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives