SPAM:spawning multiple processes

2004-10-20 Thread brian . barto
HI. First time poster... :) I am trying to write a script that spawns a number of children processes. The number of children processes is determined at run time based on a configuration file. I am having trouble finding a way to create these children processes. They have to be independant of the

spam testing

2004-10-27 Thread brian . barto
Hi all. Just checking if my emails are labeled as spam. If they are I'll have to check with my local admins and see what's going on. I'd prefer not to be labeled a spammer while I contribute to this list. :)

RE: Recursively counting a matching pattern on a single line.

2004-10-27 Thread brian . barto
Assign each line to the $_ variable and try this to get the number of instances of < and > The match operator works on $_ by default. If you match on < or > globally and assign it to an array like so: @rights = m/\/g; You are left with arrays that contain all the matches. Now all you need to do

RE: Recursively counting a matching pattern on a single line.

2004-10-27 Thread brian . barto
Great! That works. But I was looking to get a little trickier with it. If you want to make sure they are alternating like <><><> etc... I would do this: $_ = $line; @syms = m/[<>]/g; $string = join("", @syms); if ($strings !~ m/^<(><)*>$/) { ## Scream here! } The re

RE: Recursively counting a matching pattern on a single line.

2004-10-27 Thread brian . barto
Correction: "$strings" in the if statement should be "$string" -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 27, 2004 4:04 PM To: [EMAIL PROTECTED] Subject: RE: Recursively counting a matching pattern on a single line. Great! That works.

RE: Recursively counting a matching pattern on a single line.

2004-10-27 Thread brian . barto
Wouldnt m/[<>]/g literally match <> and not ? Why wouldnt it be m/[<.+>]/g ? Thanks Birl --- Someone correct me if I'm wrong but putting characters inside brackets [] defines a character class. Or a group of characters you want to match on, not necessarily in that order. For instan

RE: Assigning regexpression to a variable

2004-10-28 Thread brian . barto
Hi, if i'm understanding you correctly, I think what you want to do should be coded like this: $value = 2422;   $reg = '\d'; if ($value =~ m/$reg/) { print "Correct Value; } else { print "Check the Value"; } -Original Message- From: Prabahar Mosas [mailto:[EM

RE: Append on top

2004-10-29 Thread brian . barto
This is the way I would do it, however my code has been subject to criticism more that once in the past :) open (FILE, "; close (FILE); $new_data = "This is my new line that I am going to put at the top\n"; unshift (@file, $new_data); open (FILE, ">myfile.dat") or die; print FILE @file; close (FIL

easy way to add element to array

2004-10-29 Thread brian . barto
Hi. I'm working with an array that i'm pushing values on to, but I don't want there to be any duplicates. Is there a perl function of an easy way to check if an array already contains a value before I push that value on to it? Thanks, Brian

RE: easy way to add element to array

2004-10-29 Thread brian . barto
Though about using a hash but I don't have a need for a Key/Value combination. I just need a list without duplicates. I suppose I can define the hash keys if they don't already exists and export the keys into an array with the keys function. Is that what you are hinting towards? Thanks, Brian ---

Perl module to compare images?

2004-11-24 Thread brian . barto
Hi all, Is there a module available to compare two images to detect differences between the two, i.e. motion? Searched CPAN to no avail. Thanks in advance! -Brian

RE: Monitor Squid access.log

2004-12-07 Thread brian . barto
Sounds like a job for File::Tail http://search.cpan.org/~mgrabnar/File-Tail-0.99.1/Tail.pm I'm using it to monitor my auth.log file on my freebsd machine. Works like a charm! -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 07, 2004 9:24 AM To: [EMAI

RE: Resetting of the dataset

2004-12-16 Thread brian . barto
I don't think there is a way to make fetchrow_array() reverse the sequence in which it delivers data. You can always store the data in a variable if you need to use it later. Otherwise, if you are receiving rows of data from the database in an order that makes it hard to work with you may want to t

RE: Resetting of the dataset

2004-12-16 Thread brian . barto
I just realized I was way off base from your original question. :) You want to start over again from the beginning with fetchrow_array(). I think it's just a matter of running the execute statement again to reset it... -Original Message- From: Nicolay Vasiliev [mailto:[EMAIL PROTECTED] Sen

Is there a time module to help with this...

2004-12-17 Thread brian . barto
Hi all. I would like to write a simple monitoring tool that basically performs an action on a list of servers (ping, port check, etc) at a specified time interval. So let's say I want to ping each server every 5 minutes. I don't want to code a loop where I ping all the servers and then sleep for 5

RE: Is there a time module to help with this...

2004-12-17 Thread brian . barto
That's a good idea. However I want it to run constantly, like a service. So in some respects it would have to be a loop. Maybe embedded loops. I don't really know :) -Original Message- From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Friday, December 17, 2004 3:29 PM To: [EMAIL PROTECT

RE: :Pcap Install test fail

2004-12-29 Thread brian . barto
I recently installed Net::Pcap from the cpan shell and the test failed as well. I did a force install and the install completed and it appears to be working fine. Not sure if will be any repercussions in the future though. -Original Message- From: Welsh, Ed [mailto:[EMAIL PROTECTED] Sent:

RE: CGI and variables? What´s the problem?

2004-12-29 Thread brian . barto
Should be as simple as: use CGI; $co = new CGI; ## Here I grab the info from the form field named "date" ## and assign it to the variable $data my $data = $co->param('date'); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 29, 2004 2:14 PM

Forcing script to run as root?

2005-01-17 Thread brian . barto
Hi all. How can I check, within a script, to see if it is being run as root or not? I would like it to exit with an error message if it is not running as root. I'm looking for something that works across *nix platforms so that my script is portable. Is there a perl function that does this or perhap

RE: :PostalCode

2005-01-20 Thread brian . barto
If you figure it out, let me know. I had problems getting it to read the database. I eventually quit. -Original Message- From: Jay [mailto:[EMAIL PROTECTED] Sent: Thursday, January 20, 2005 12:17 PM To: Perl Beginners List Subject: Geo::PostalCode I have the following code, which dies "n

RE: Extracting and email address

2005-01-21 Thread brian . barto
Oh come now. Maybe he's writing an auto-responder. ;) Besides, these days, if he is spamming he can look forward to lots of fines and possible prison time. -Original Message- From: Edward Wijaya [mailto:[EMAIL PROTECTED] Sent: Thursday, January 20, 2005 6:10 PM To: Andrew Black; beginners@

RE: snmp requests CORRECTED!

2005-02-16 Thread brian . barto
HI. There's really two parts you need to have for a snmp get request. The first part is the object identifier (OID). This is the long string of numbers. The second part is the instance number. That is the zero at the end you're asking about. .iso.org.dod.internet.mgmt.mib-2.interfaces.ifNumber.0

RE: www.perldoc.com

2005-02-28 Thread brian . barto
Someone tell the admin that the command is 'apachectl start' -Original Message- From: Adamiec, Larry [mailto:[EMAIL PROTECTED] Sent: Monday, February 28, 2005 10:01 AM To: beginners@perl.org Subject: RE: www.perldoc.com I can ping www.perdoc.com successfully but I can't bring up a web pa

Upgraded perl to 5.8.0, can I reuse old modules?

2005-03-21 Thread brian . barto
Hi! I just upgraded perl on one of my UNIX machines to 5.8.0 (was 5.6.1). Of course there is no great surprise that the new perl is telling me it can't find any of my modules I install under the old version. So my question is, can I add an extra path to perl @INC array to point to the location of

Make error for Tk::JPEG

2005-03-21 Thread brian . barto
Hi. I am having a heck of a time installing Tk::JPEG on hpux 11.0. I know this isn't directly perl related but I'm hoping someone has seen this before and could lead me in the right direction. I have downloaded the Tk-JPEG-2.014 source from cpan. I have it unpacked. I ran "perl Makefile.PL". When

Perl vs. Ruby?

2005-04-04 Thread brian . barto
Is anyone familiar with Ruby? If so, how do you think it stacks up against perl? I'm looking to learn another unix scripting lang and it looks like Ruby may be a good fit. Some excerpts from their web site: "Ruby's syntax and design philosophy are heavily influenced by Perl. It has a lot of syn

RE: General Enquiry regarding the Perl

2005-04-18 Thread brian . barto
Hi! "1 Could some suggest me what all I can do in Perl?" The list would be smaller if you'd asked "what CAN'T you do with perl?". Perl is a very powerful programming language. Speaking from personal experience, it's helped me elevate myself above my peers and is directly responsible for the high

RE: square symbol at end of each line

2005-05-18 Thread brian . barto
The square symbol likely represents a carriage return. Windows and Unix do not like each other's carriage returns and sometimes when you cross information from one platform to another you get this funny square. You can get rid if it by: s/\015//; or substitute it with a newline character s/\015/

Problems accessing oracle via cgi and apache

2005-05-19 Thread brian . barto
Hi all. I think I have some sort of permissions problem here i'm hoping to get help for. I'm running apache on HP-UX. I have a perl script that accesses a database (local) and displays the results in a HTML table format. Pretty simple. I've done lots of database scripting before so i figured this

RE: Problems accessing oracle via cgi and apache

2005-05-19 Thread brian . barto
Bob you are brilliant. Apache didn't have the environment but my user did. I set the environmental variables in the script like you suggested and it works great! Thanks, Brian -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Thursday, May 19, 2005 1:45 PM To: '[EMAIL

RE: To Thread or not?

2005-05-24 Thread brian . barto
If you are using a unix system, the fork function may help you. -Original Message- From: Tielman Koekemoer (TNE) [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 24, 2005 6:14 AM To: Perl Beginners Subject: To Thread or not? Hi all, I need to execute a shell command in a loop but the shell

RE: Two Dimensional Array Problem

2005-06-03 Thread brian . barto
Looks like you're pushing a list on to another list. In effect, appending one to the other. @data would be the first list. The second list would be '$x, $y'. Variables in a comma delimited fashion is the same as a list or an array. I usually deal with multidimensional arrays this way: $i = 0; whi

RE: Two Dimensional Array Problem

2005-06-03 Thread brian . barto
That's much better than my method. Didn't know you could push blocks of data like that. Cool :) -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Friday, June 03, 2005 3:01 PM To: [EMAIL PROTECTED]; beginners@perl.org Subject: RE:

RE: host id

2005-06-09 Thread brian . barto
I, being too lazy to look up a perl function, would use hostname command in backticks like so: $HostID = `hostname`; Not sure if that will catch a newline character so I would also follow it with this: $HostID =~ s/\n//; -Original Message- From: Bret Goodfellow [mailto:[EMAIL PROTECTED]

RE: host id

2005-06-09 Thread brian . barto
> > "When in Rome, do as the Romans do." It's true all over. The polite > thing to do when participating in *any* group -- not just > this one, not > just internet stuff, but any human interaction -- is to adapt your > manner of presenting yourself to be in harmony with the group. > > If you not

RE: host id

2005-06-09 Thread brian . barto
> > I, being too lazy to look up a perl function, would use > hostname command in > > backticks like so: > > > > $HostID = `hostname`; > > > > Right which is why the above is "too lazy". Anyone reading this please > don't settle for the above, it is error prone, insecure, and > insufficient. T

RE: host id

2005-06-10 Thread brian . barto
> Ryan Frantz wrote: > > For the purposes of this list, I shall always post intelligently as > > has been stated ... For continuity, I > > would suggest everyone does the same. > > Excellent suggestion. > > For those who would like to post replies in the preferred > "conversational" > style or "

RE: Top Posting (was RE: host id)

2005-06-10 Thread brian . barto
Larsen, Errin M HMMA/IT wrote: > << VERY fascinating discussions about the pros and cons of top-posting > SNIPPED>> > > While I'm sure the arguments for and against the top-posting practices > of Internet email lists are wonderful, perhaps we can change the > subject of these emails. I keep hopin

DBD::Oracle installation script assumes oracle is installed local ly?

2005-08-31 Thread brian . barto
Hi all. I am attempting to install DBD::Oracle from the perl CPAN shell. The installation script seems to assume that oracle is installed locally. It asks me to set ORACLE_HOME to the path the oracle is installed and to try again. Well I don't have oracle installed locally. I want to install DBD::O

RE: :Oracle installation script assumes oracle is installed local ly?

2005-08-31 Thread brian . barto
> [EMAIL PROTECTED] wrote: > > Hi all. I am attempting to install DBD::Oracle from the perl CPAN > > shell. The installation script seems to assume that oracle is > > installed locally. It asks me to set ORACLE_HOME to the path the > > oracle is installed and to try again. Well I don't have oracle