Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^4: Search and Copy

by mikebailey (Initiate)
on Nov 24, 2012 at 21:29 UTC ( #1005428=note: print w/ replies, xml ) Need Help??

in reply to Re^3: Search and Copy
in thread Search and Copy

open (OUTPUT, ">Results.txt") open( INFILE, "Textfile.TXT" ) while (<INFILE>) { if ($ARG =~ /(Something.{0,250})/ ) { print OUTPUT $ARG ; } } close (OUTPUT);

The "regexp" suggested is not working.


Comment on Re^4: Search and Copy
Download Code
Replies are listed 'Best First'.
Re^5: Search and Copy
by choroba (Canon) on Nov 24, 2012 at 21:55 UTC
    The regex would work if you match it against the right variable. Where is $ARG coming from? Use strict and warnings; and if someone gives you a code, taking just a small part of it if you do not understand the rest would probably not work.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2015-11-30 08:01 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (765 votes), past polls