Splitting OR Regex

2003-10-30 Thread Scott, Joshua
Hello, How can I split the data in a line by a single whitespace but also keep portions between quotes together? Here is an example of a line of data I'm trying to parse: id=firewall time=2003-10-30 04:15:01 fw=66.74.67.229 pri=5 c=256 m=38 msg=ICMP packet dropped n=63211 src=1.1.1.1

RE: Newlines, control characters, etc

2003-07-03 Thread Scott, Joshua
I'm not familiar with the DBI::quote method. I'll have to look that one up. However, I already solved my problem. The issue was with the ',\,\n,$ and @ characters. All I did was add a backslash to the front of each of these characters and voila...my script ran perfectly. Thanks anyways for the

Newlines, control characters, etc

2003-07-02 Thread Scott, Joshua
I'm trying to copy data from one database field to another. The problem is that the field contains various newline and other types of control characters. Whenever the script runs, it processes those as perl code instead of data like I'd like it to. How can I prevent it from doing this? Here

RE: Modify process name

2003-07-01 Thread Scott, Joshua
It works with 5.8.0 under Red Hat 9.0, but not 5.8.0 running under Red Hat 8.0. Are there any workarounds or fixes for this? Joshua Scott Security Architect, CISSP 626-568-7024 -Original Message- From: Steve Grazzini [mailto:[EMAIL PROTECTED] Sent: Monday, June 30, 2003 7:28 PM To:

Exiting a subroutine on error

2003-06-30 Thread Scott, Joshua
What is the best way to stop the processing of a subroutine if an error is found without exiting the entire program? For example, I've got a subroutine that reads from a file and processes each line. I know to use the following code if I want to stop processing the program:

Modify process name

2003-06-30 Thread Scott, Joshua
Whenever I view the processes (ps -ef) running on my Linux box, my perl scripts always show as: /usr/bin/perl ./scriptname.pl Is there any way to modify this so that it appears differently? I'd like to be able to hide as much as possible. Thank you, Joshua Scott

File Handles in subroutines

2003-06-25 Thread Scott, Joshua
What do I need to do in order to use a filehandle that was opened earlier in a program within a subroutine? I've included an example of the code I have that is not doing what I would like. Basically, I never get any output to the file. If I change it so that it doesn't use the subroutine when

Using defined array with split command

2003-06-05 Thread Scott, Joshua
Good evening, I'm having a hard time figuring out how to make a portion of my script work. Basically I'd like to split a specific field and use the names from an array as the scalar variable names for each field. Here is a snip of my code: # Begin Code $data = A Tab Separated

RE: including subroutines from other files ...

2003-02-04 Thread Scott, Joshua
This is how I've done this for my scripts: do /filename; Then I just call the sub in the normal method. -Original Message- From: Jamie Risk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:11 PM To: [EMAIL PROTECTED] Subject: including subroutines from other files ...

Graphing Data

2003-01-31 Thread Scott, Joshua
Hi everyone, I'm starting to write a script which gathers the output of the SAR command from Linux and does something with it. Can anyone recommend an simple way to gather specific data and output it to some kind of graph? The SAR command in Linux can output in a delimited format. Once I

MS Active Directory

2003-01-30 Thread Scott, Joshua
Good evening, I'm looking for advice or ideas on querying MS Active Directory. There is a module on CPAN but it appears to only run on Windows. I was wondering if there is any module or method to query from a Linux system. All of my other scripts are housed on a single Linux box and I'd really

Splitting a variable

2003-01-16 Thread Scott, Joshua
I've got a CSV file which I need to process. The format is as follows. Smith, John J,1/1/2002,1/15/2002,Orlando, FL,Florida Doe, John L,1/1/2002,1/15/2002,Los Angeles, California I've tried splitting it using: @row = split(,,$data); The problem is with the fields that contain the commas

RE: Splitting a variable

2003-01-16 Thread Scott, Joshua
Message- From: Konrad Foerstner [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 3:29 PM To: Scott, Joshua Cc: [EMAIL PROTECTED] Subject: Re: Splitting a variable On Thu, 16 Jan 2003 15:12:05 -0800 Scott, Joshua [EMAIL PROTECTED] wrote: I've got a CSV file which I need to process

RE: Perl Subroutines

2003-01-14 Thread Scott, Joshua
. Thanks to everyone who posted comments. Joshua Scott Security Systems Analyst, CISSP -Original Message- From: Jenda Krynicky [mailto:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 7:04 AM To: [EMAIL PROTECTED] Subject: RE: Perl Subroutines From: Scott, Joshua [EMAIL PROTECTED] Let me

Perl Subroutines

2003-01-09 Thread Scott, Joshua
I've created a group of Perl subroutines to handle the creation and layout of my web pages. These subs are used when browsing to my website. Basically all they do when invoked is print a bunch of HTML. I've now run into the scenario where I'd like to use these same subs to print static web pages

RE: Perl Subroutines

2003-01-09 Thread Scott, Joshua
Wow, that was really easy! Thank you very much for your help!! Joshua Scott Security Systems Analyst, CISSP 626-568-7024 -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 5:11 PM To: [EMAIL PROTECTED] Subject: Re: Perl Subroutines Hi

RE: Mail::Sendmail Module

2002-11-05 Thread Scott, Joshua
, Joshua Cc: [EMAIL PROTECTED] Subject: Re: Mail::Sendmail Module combine all the lines using \n characters and store it in the hash variable - Original Message - From: Scott, Joshua [EMAIL PROTECTED] To: Beginners Perl [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 11:01 PM Subject

Sorting a hash with keys generated on the fly

2002-11-05 Thread Scott, Joshua
I'd like to know the best/easiest way to sort a hash based on the values of it's keys. Here is a snippet of my code. %somehash=(); foreach (somearray) { $somehash{$_}++; }; Basically I'm getting a count of unique items in an array and I want to sort by the number of each item. I've

Help with Hash values and variable interpolation

2002-11-04 Thread Scott, Joshua
Hello all, I've got a file which contains ports and hostnames. I'd like to count the number of instances that each item occurs in my file. I'm having a difficult time with this. This is my script: Basically I'm splitting the first line a few times to get the data I need. What am I doing

RE: Help with Hash values and variable interpolation

2002-11-04 Thread Scott, Joshua
I figured it out already! I ran a replace on the dst_port and replaced it with a whitespace which threw off the count. I've modified it to delete the whitespace and all works perfect. Joshua Scott Security Systems Analyst, CISSP 626-568-7024 -Original Message- From: Scott, Joshua

Regular Expressions and a poorly organized logfile

2002-07-11 Thread Scott, Joshua
Title: Message Hello everyone, first I'd like to say thank you to everyone who responded to my issue with Avoiding Duplicate Entries. I took the advice given and found a solution. Thank you very much! My latest problem has to do with regular expressions and the logfile that Norton

Daemonize a process in Windows

2002-07-09 Thread Scott, Joshua
I've used the daemonize subroutine described in the PERL manpages on Unix to completely disassociate a child process from a parent. Will this process work under a Windows environment? If not, what is the best way to do this? Thank you, Joshua Scott Security Systems Analyst, CISSP 626-568-7024

Avoiding Duplicate Entries

2002-07-09 Thread Scott, Joshua
I'm very new to Perl programming so please bear with me. I'm working on a program that will open up a certain logfile, read the contents, upload certain content to a database and update the status to the same database. The goal is to run this program once a week. Currently the program just