Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: How to extract certain range of text and display it?

by annel (Novice)
on Oct 14, 2013 at 01:30 UTC ( #1058113=note: print w/ replies, xml ) Need Help??


in reply to Re: How to extract certain range of text and display it?
in thread How to extract certain range of text and write into another file?

Hi, the problems you have mentioned are totally correct. I have correct the occurrence of  corry and get rid of $word. I can't figure out what variable should I match the section text.


Comment on Re^2: How to extract certain range of text and display it?
Download Code
Re^3: How to extract certain range of text and display it?
by Anonymous Monk on Oct 14, 2013 at 01:52 UTC

    I can't figure out what variable should I match the section text.

    post the new code

      Here is the code I updated. Please check it. Thanks.
      use warnings; use strict; my $test; my @words; open(INFO,"<","testing.pl")||die"Can't open file:$!\n"; chomp (@words=<INFO>); close(INFO); foreach @words){ if(/^\$ NAME : corry/ .. /\.EON/){ $test=$1; print $test; } }

        well, you're using $1 without using capture groups which moritz told you about , and which perlintro talks about ($1)

        why are you using $1, maybe you want to use $_?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1058113]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2014-07-29 03:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls