SORRY! copy-and-paste-error...I tried it without the ###  ;-)
and tried too the print-statement-thing.
Seems the regex is wrong, but why?
Jane





Stephen Hardisty wrote:

Two questions:
I've got a test-file and want to add something to some lines, while reading it out.
I tried the following code:


while (<TXTFILE>) {
     if (/pattern/) {
        #$line = $_ . $something;
        #push (@new_array, $line);
     }
     else {
        #$line = $_;
        #push (@new_array, $line);
     }
}


The code that appends the array is commented out...... if I assume that you have tried it without the comments, try putting a print statement inside the 'if' block, this will atleast let you know if your regexp is correct.


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________






--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to