in reply to Re: problem in search pattern
in thread problem in search pattern

Update 2: I re-ran your programme with the "real" life data and it works fine again. The error you are looking for is not in the code you posted.

Maybe you don't see the print output because it is redirected somewhere you didn't expect?

Update: I searched for the string in your data, and my browser told me it wasn't there... now I see it. Whatever went wrong.

In your Dumper output of the test data, there is no string that matches "PRCIII".

That in turn makes your test for the string "PRCIII" fail.
In order to make it succeed, put that string in your test data.

Cheers, Sören

Replies are listed 'Best First'.
Re^3: problem in search pattern
by rsennat (Beadle) on Dec 16, 2005 at 15:15 UTC
    Yeah right. Atleast you got it.
    "PRCIII" is there in the data.
    Please help me out of this. This really screws me.

    thanks
Re^3: problem in search pattern
by rsennat (Beadle) on Dec 16, 2005 at 15:22 UTC
    Can you please share your code.

    Really something goes wrong here. unable to figure it out. i tried chopping, removing curly braces etc... nothing worked.

      Can you please share your code.

      use Data::Dumper; $VAR1 = { 'cli_config' => 'logging size', 'jobid' => '982505', 'status +' => 'pass', 'component1' => 'archive-config-log', 'test_name' => '{P +RCIII.etest: logging size 200}', 'testcase_name' => 'TC11327641669.xm +l', 'color_bool' => 1 }; %row = %$VAR1; print Dumper \%row; ##### THIS DATA SHOWN ABOVE if( $row{test_name} =~ "BEFORE-AFTER" ) { push(@loop6,\%row); } elsif( $row{test_name} =~ "DEFAULT" ) { push(@loop7,\%row); } elsif( $row{test_name} =~ "ORDER-ROLLBACK" ) { push(@loop8,\%row); } elsif( $row{test_name} =~ "PRCIII" ) { print "PRCIII------"; push(@loop9,\%row); } elsif( $row{test_name} =~ "ROLLBACK" ) { push(@loop10,\%row); } elsif( $row{test_name} =~ "SIDE-EFFECTS" ) { push(@loop11,\%row); } elsif( $row{test_name} =~ "SYNTAX" ) { push(@loop12,\%row); } __END__

      ...prints...

      $VAR1 = { 'cli_config' => 'logging size', 'jobid' => '982505', 'status' => 'pass', 'component1' => 'archive-config-log', 'test_name' => '{PRCIII.etest: logging size 200}', 'testcase_name' => 'TC11327641669.xml', 'color_bool' => 1 }; PRCIII------

      Cheers, Sören

        The hash data i showed you in the code is formed from this array @test_status with referece to my previous code. PLEASE TRY WITH THIS.
        $VAR1 = [ 'archive-config-log,logging size,TC113276428820.xml,__taskid +1.1,BEFORE-AFTER.etest,skip', 'archive-config-log,logging size,TC1132 +7641669.xml,__taskid1.2,BEFORE-AFTER.etest,skip', 'archive-config-log +,logging size,TC113276428820.xml,__taskid2.1,DEFAULT.etest,skip', 'ar +chive-config-log,logging size,TC11327641669.xml,__taskid2.2,DEFAULT.e +test,skip', 'archive-config-log,logging size,TC113276428820.xml,__tas +kid6.1,ORDER-ROLLBACK.etest,skip', 'archive-config-log,logging size,T +C11327641669.xml,__taskid6.2,ORDER-ROLLBACK.etest,skip', 'archive-con +fig-log,logging size,TC113276428820.xml,{logging size 100::PRC::1},{P +RCIII.etest: logging size 100},fail', 'archive-config-log,logging siz +e,TC11327641669.xml,{logging size 200::PRC::1},{PRCIII.etest: logging + size 200},pass', 'archive-config-log,logging size,TC113276428820.xml +,__taskid3.1,ROLLBACK.etest,skip', 'archive-config-log,logging size,T +C11327641669.xml,__taskid3.2,ROLLBACK.etest,skip', 'archive-config-lo +g,logging size,TC113276428820.xml,__taskid4.1,SIDE-EFFECTS.etest,skip +', 'archive-config-log,logging size,TC11327641669.xml,__taskid4.2,SID +E-EFFECTS.etest,skip', 'archive-config-log,logging size,TC11327642882 +0.xml,__taskid5.1,SYNTAX.etest,skip', 'archive-config-log,logging siz +e,TC11327641669.xml,__taskid5.2,SYNTAX.etest,skip' ];