Hi everybody!
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); } }
But @new_array didn't get the lines!
The textfile look like
>SA texttexttext...\n texttexttext\n texttexttext\n texttexttext\n >SA texttexttext...\n texttexttext\n texttexttext\n texttexttext\n >SA texttexttext...\n texttexttext\n texttexttext\n texttexttext\n
I tried to get the >SA..-lines by
if (/^SA[.]*\n/) { do...
but the pattern was not be found. Whats wrong with it?
Or does anyone knows a simple method to read the lines in a hash - every-SA-line should be the key, the following lines until the next >SA the value. That'll be much more simple to handle..
Jane
Read about push perldoc -f push
Maybe this will help
..... while(<TXTFILE>) { if(/pattern/){ $line = $_ . $something; } else { $line = $_; }
push @newarray , $line .....
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]