Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^7: How to extract certain range of text and display it? (snafu)

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


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

I used $_ but nothing prints out.

Sure it does

$ perl -l snafu $ NAME : corry $$.Inc s d $$.Oc s $$.TO G1 ty n1 EE EE M T1 T2 $$SRU G2 n1 y OO OO M T3 T4 $$SRU .EON

and here is snafu

#!/usr/bin/perl -- use warnings; use strict; my $test; my @words; #~ open(INFO,"<","testing.pl")||die"Can't open file:$!\n"; open(INFO,"<", __FILE__ )||die"Can't open file:$!\n"; chomp (@words=<INFO>); close(INFO); foreach (@words){ if(/^\$ NAME : corry/ .. /\.EON/){ $test=$_; print $test; } } __END__ $ NAME : corry $$.Inc s d $$.Oc s $$.TO G1 ty n1 EE EE M T1 T2 $$SRU G2 n1 y OO OO M T3 T4 $$SRU .EON $ NAME : patrick $$.Inc c d $$.Oc c $$.TO G1 td n3 EE EE M T5 T6 $$SRU G2 n3 y OO OO M T7 T8 $$SRU .EON

Basic debugging checklist , brian's Guide to Solving Any Perl Problem......

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1058132]
help
Chatterbox?
[Corion]: Sane Dots Supplies - your brand manufacturer for satisfying experiences!
[choroba]: preparing the trip to Vietnam + buying a new car = enough fun
[Corion]: choroba: Yeah, that's a lot of "fun" for one week...
[Corion]: I guess I should stage some product photos for Sane Dots Supplies ;)
[marto]: I had some ideas about that Corion
[marto]: I'll send a message over the weekend maybe :P
[Corion]: choroba: I avoided the "fun" of emergency shopping for a new flat iron by trying the flat iron without the timer that sat between it and the mains power. Seems as if just the timer is broken.
[Corion]: marto: Heh, would be cool!

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2017-01-20 10:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.