Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by Anonymous Monk
on Oct 14, 2013 at 02:18 UTC ( #1058117=note: print w/ replies, xml ) Need Help??


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

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 $_?


Comment on Re^5: How to extract certain range of text and display it?
Re^6: How to extract certain range of text and display it?
by annel (Novice) on Oct 14, 2013 at 04:51 UTC
    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=$_; print $test; } }
    I used $_ but nothing prints out.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2014-07-31 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (248 votes), past polls