in reply to and a simple reg exp poser

The suggestions so far don't really do what you said you wanted done.

1) All lines starting with a particular IP.

2) Assuming "bung"="add" that it's an additive thing, not an overwrite thing.

my @ip while (<LOG>) { #assuming you are looping through a log file my $log = $_; #making this blatent push(@ip, $log) if $log =~ /^192\.168\.1\.10/;
From your code, the 'g' modifier means match as many times as possibe.

From mine, '^' is an anchor to the begining of the string.

From your code, '@ip = $log' overwrites the values of $ip[0] each time.

From my code, 'push(@ip, $log)' adds the entire line to the end of the array.

Update: diotalevi's concept of using index instead of a regexp was an excellent suggestion that avoids regex engine overhead, so . . .

push(@ip, $log) if 0 == index($log,'192.168.1.10');
Which gives you those that start with the ip in question.