Re: Filehandle and redirection of STDOUT

2007-11-01 Thread Phillip Gonzalez
lly worked! LoL. Thanks, -phil On Nov 1, 2007, at 10:17 PM, Rob Dixon wrote: Phillip Gonzalez wrote: Hi, I'm trying to print stdout to a file, then switch back to the default standard out so that it prints to the screen. This script takes a list of ip's and does a reverse lookup on

Filehandle and redirection of STDOUT

2007-11-01 Thread Phillip Gonzalez
Hi, I'm trying to print stdout to a file, then switch back to the default standard out so that it prints to the screen. This script takes a list of ip's and does a reverse lookup on them, it then saves the output to "reverse.txt". Here's my code: #!/usr/bin/perl use strict; use warning

Re: Search for IP address and delete from file

2007-10-17 Thread Phillip Gonzalez
FreeBSD, and that's actually what I ended up doing basically using cat and grep -v. Thanks, On Oct 17, 2007, at 9:14 PM, yitzle wrote: If you are on a Linux machine, it might just be easier to use the grep command with a shell script. FILE_NAME="./log" TMP_FILE="./tmp" IP_TO_REMOVE="192.16

Re: Search for IP address and delete from file

2007-10-17 Thread Phillip Gonzalez
They have all been helpful. Thanks, On Oct 17, 2007, at 4:40 PM, Matthew Whipple wrote: Matthew Whipple wrote: yitzle wrote: Take a look at the grep function http://perldoc.perl.org/functions/grep.html Also of potential use is the qr// quote operator: http://perldoc.perl.org/perlop.html#

Search for IP address and delete from file

2007-10-17 Thread Phillip Gonzalez
Hi, I'm trying to search a .txt file for matching ip addresses. I then want to delete those ip addresses. So far I have opened the file where the ip list is and stored it in an array. But How do I search the array for ip's? Here's what I have so far: #!/usr/bin/perl $data_file="/home/uid/