Re: How to thread in Perl?

2002-03-26 Thread Jim Conner
At 22:14 03.25.2002 -0800, Ahmed Moustafa wrote: >Content-Type: text/plain; charset=us-ascii; format=flowed >Content-Transfer-Encoding: 7bit >X-Posted-By: 209.178.174.150 > >Jim Conner wrote: > > At 20:28 03.25.2002 -0800, Ahmed Moustafa wrote: > > > >>> J

Re: Help need fast

2002-03-25 Thread Jim Conner
At 14:43 03.26.2002 +1000, senrong wrote: >I am a student who is new to Perl.and that my assignment is due this >following week... > >can anyone tell me where can I get a free server to run on my own PC. > >Pls reply ASAP... > >thanks... > > > > >-- >To unsubscribe, e-mail: [EMAIL PROTECTE

Re: How to thread in Perl?

2002-03-25 Thread Jim Conner
At 20:28 03.25.2002 -0800, Ahmed Moustafa wrote: >>Jim Conner wrote: >> >>>I suck at this kind of topic but the only way I can think of doing such >>>a thing is this: >>> >>>Use IPC. >>> >>>fork off something like 10 children eac

Re: How to thread in Perl?

2002-03-25 Thread Jim Conner
I suck at this kind of topic but the only way I can think of doing such a thing is this: Use IPC. fork off something like 10 children each child working on a separate file and use sysvmsg sysvshem (I do not believe these are functions and I can't look the right functions up for you right now

Re: joining 2 strings

2002-03-23 Thread Jim Conner
It does *not* matter :) $stringc = $stringa .",". $stringb; is the same as: $stringc = $stringa.","$stringb; Perl ignores the white space. - Jim At 19:01 03.22.2002 -0500, K Clark wrote: >would someone tell me whether or not the problem with what the original >post is

Re: joining 2 strings

2002-03-23 Thread Jim Conner
There is nothing wrong with the line that does the concatenation in sub 'add'. You have a problem somewhere else it seems. What was the exact error again? - Jim At 23:59 03.22.2002 +, Matthew Harrison wrote: >the script is part of a web-based role-playing-game. the line in question >is i

Re: splitting the string.

2002-03-22 Thread Jim Conner
I know many have probably answered this but Im just going down my email list. Here is the answer: @asplit = split(//,$a); That should be it. - Jim At 22:41 03.20.2002 -0800, Raja Gopal wrote: >Hello Perl Experts, > > I want to split the string $a ="abcdef"; >as @asplit = ("a","b","c","d",

Re: TAIL

2002-03-13 Thread Jim Conner
I suggest: File::Tail if you are wanting to something like tail -f, though. Works like a champ. - Jim At 06:09 03.14.2002 +, Jonathan E. Paton wrote: > > Is there a perl function equivalent to the *nix command > > 'tail'? > >Here is a basic Perl implementation of tail: > >#!/usr/bin/perl

Re: inline perl code

2002-01-28 Thread Jim Conner
At 11:09 01.29.2002 +0530, Deen Hameed wrote: >I was wondering if people would be kind enough to tag the end of their >script with __END__ It wouldn't be much trouble for them, and it would >make me feel oh-so-cool... :) > Ok. I'll bite :) >BEGIN PGP PUBLIC KEY BLOCK- Version: GnuPG v

Re: Perl, Black book

2002-01-28 Thread Jim Conner
I absolute love this black book. Its a must for the Perl library. Library meaning all the O'reilly books. But definitely a must have imo. - Jim At 14:56 01.28.2002 -0800, Matthew Lyon wrote: >not blasphemy. > >/me <-- biologist. > >:) > >mL > >On Mon, 28 Jan 2002, Brett W. McCoy wrote: > > >

Re: Trying to use strict

2002-01-24 Thread Jim Conner
At 16:27 01.24.2002 -0500, Jeff 'japhy' Pinyan wrote: >On Jan 24, Jim Conner said: > > >sub functionname { > > my $array1 = $_[0]; # note that we are using a scalar to store the > > my $array2 = $_[1]; > > my $array3 = $_[2]; > > > &g

Re: Trying to use strict

2002-01-24 Thread Jim Conner
-BEGIN PGP PUBLIC KEY BLOCK- Version: GnuPG v1.0.6 (MingW32) Comment: For info see http://www.gnupg.org At 14:53 01.24.2002 -0600, Lysander wrote: >- Original Message - >From: "Shawn" <[EMAIL PROTECTED]> >To: "Lysander" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> >Sent: Thursday,

RE: Calling a shell from a perl script.

2001-12-23 Thread Jim Conner
As personal preference I do try hard not to use system() calls in my Perl scripts because Perl can do everything itself with built-ins or modules. It's my opinion that while easier in terms of coding a lot of the time using system() calls or back-tics it is harder, albeit most likely not too

Re: extract uptime for linux box w/perl

2001-12-20 Thread Jim Conner
At 08:28 12.20.2001 -0500, Kevin Meltzer wrote: >Am I just the overly paranoid one? But IMO doing this can be dangerous. >Tainting isn't just for CGIs, and adding a -T to this shows it can be >dangerous ($ENV{PATH} issue, since you don't really know what uptime you will >end up calling). Again, I

Re: extract uptime for linux box w/perl

2001-12-20 Thread Jim Conner
At 11:06 12.20.2001 +0200, Stef wrote: >Damn if you're gonna do it this way , why not just do: >uptime > >Thus spake John W. Krahn on 20-Dec-2001 : >-> perl -le'print join",",(split/,/,`uptime`)[0..2]' I love Perl :") - Jim >~~~ >E-Mail: Stef <[EMAIL PROTECTE

RE: extract uptime for linux box w/perl

2001-12-19 Thread Jim Conner
At 02:01 12.20.2001 -0500, Jim Conner wrote: >-BEGIN PGP SIGNED MESSAGE- >Hash: SHA1 > >At 00:26 12.20.2001 -0500, Steven Hetland wrote: > > > -Original Message- > > > > > > right now i do > > > > > > w | head -1 > >

RE: extract uptime for linux box w/perl

2001-12-19 Thread Jim Conner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 At 00:26 12.20.2001 -0500, Steven Hetland wrote: > > -Original Message- > > > > right now i do > > > > w | head -1 > > > > and get what's below my signature. I want to clean that up, cutting it > > after the # of users, so that everything aft

Re: extract uptime for linux box w/perl

2001-12-19 Thread Jim Conner
At 23:02 12.19.2001 -0500, KeN ClarK wrote: >right now i do > >w | head -1 > >and get what's below my signature. I want to clean that up, cutting it >after the # of users, so that everything after AND including the third >comma is removed from that line. Then take that and add it to my signature >

Re: Simpler....

2001-12-04 Thread Jim Conner
At 15:22 12.05.2001 +1030, Daniel Falkenberg wrote: >Hey all, > >Please don't stree to much over this one but, is there an easier way of >writing this? Ok. I haven't read the thread yet because I want to take a fresh shot at this... so here goes... >while(1){ > if ($status == 1) { > #D

Re: Simple question

2001-11-25 Thread Jim Conner
At 01:00 11.26.2001 -0500, Jim Conner wrote: >At 15:25 11.26.2001 +1030, Daniel Falkenberg wrote: >>Hey all, >> >>Just a simple question could some one give me a clue as to what the >>folling regex will match... >> >>$user = "daniel"; >> &g

Re: Simple question

2001-11-25 Thread Jim Conner
At 15:25 11.26.2001 +1030, Daniel Falkenberg wrote: >Hey all, > >Just a simple question could some one give me a clue as to what the >folling regex will match... > >$user = "daniel"; > >if ( $test =~ /^$user/ ) { >print "Hello world!\n"; >} Hrm. The regex is comparing a variable called $

Re: Useless use of a variable in void context

2001-11-24 Thread Jim Conner
At 11:28 11.23.2001 -0800, Ahmed Moustafa Ibrahim Ahmed wrote: >Hi, >The following line of code "if (-d $filename) {" gives me the error message >"Useless use of a variable in void context". What does this error message, >please? >Thanks >--Ahmed Check to make sure that "$filename" actually has a

Re: ksh in perl, not as child

2001-11-24 Thread Jim Conner
At 16:15 11.23.2001 -0700, [EMAIL PROTECTED] wrote: >I am trying to run a ksh script from a Perl script, that sets up an >environment (it is way too big to translate). Anyway I am assuming that >it is run as a child, cause none of the variables are getting set. Any >help? Perl is running that l

Re: Counting White Spaces in perl

2001-11-22 Thread Jim Conner
I'll take a whack at this: At 08:19 11.22.2001 +0800, Harry Varvarigos wrote: > I am trying to count the no. of blanks that appear and then break out of the >loop when all arrays' last elements are blanks/spaces. I think sprintf >will do it but I can't figure it out: > >printf >DGSUM"+---

Re: pattern matching

2001-11-18 Thread Jim Conner
At 19:01 11.18.2001 -0800, John W. Krahn wrote: >Andrea Holstein wrote: > > > > Prasanthi Tenneti wrote: > > > > > > Iam a beginner in perl.I have one question, > > > Iam trying to write one prog,in which i have to search for one word in a > > > file, > > > If I found that word,print next 4 lines.

Re: Off-Topic (200%) - Where are you from?

2001-11-16 Thread Jim Conner
At 19:46 11.15.2001 +0800, louie miranda wrote: >philippines here :) > musta! Puti ako, pero maronung ako magtagalog! Kailangan ko magpractice (magsanay) iyong tagalog ko. (to not be rude...and so I translate) Hey! Im a white boy! (heh, not exactly translated that way but it will do) but I

Re: frustrating search on the NET::IRC module

2001-11-10 Thread Jim Conner
At 21:50 11.10.2001 +0100, samuel wrote: >hi there!, >i'm writing this email with a great frustration feeling. i've been all >evening looking for the NET::IRC perl module, but it was a waste. > >After searching CPAN modules list and find nothing, i tried it in a >more active way, i tried it in sea

Re: What was your first Perl script (was Off-Topic (200%) - Where are you from?)

2001-11-09 Thread Jim Conner
At 16:40 11.09.2001 -0500, Brett W. McCoy wrote: >On Fri, 9 Nov 2001, Carol Stone wrote: > > > I'm pretty happy about this, I must admit. > >Congratulations! > >My first Perl script, from 1998 or 1999, was rather ambitious considering >I knew very little about the language, was used to audit a dat

RE: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Jim Conner
At 15:29 11.09.2001 -0600, Frank Newland wrote: >Opelika, Alabama.. >North of Beauregard, >East of Lochapoka, >South of Buffalo, >West of Bleecker > >-Original Message- >From: Etienne Marcotte [mailto:[EMAIL PROTECTED]] >Sent: Friday, November 09, 2001 9:08 AM >To: [EMAIL PROTECTED] >Subj

Re: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Jim Conner
My parents live in SD. Heh, maybe when I move back I will move to OC and live between SD and LA ;) I love OC! At 12:25 11.09.2001 -0800, Michael Kelly wrote: > > San Diego, California, dude. > >Definitely a small world. Same here! Good ol' sunny San Diego where >it's...foggy. > >-Michael Kelly

Re: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Jim Conner
At 11:58 11.09.2001 -0700, Tyler Cruickshank wrote: >ah, what the hey ... > >Salt Lake City, UT - Greatest Snow on Earth. > > and no, Im not! Hahaha, and I know exactly what you're talking about! =P Cuz, I am...that's funny. > >>> "Joyce Harris" <[EMAIL PROTECTED]> 11/09/01 11:57AM >>> >Kn

RE: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Jim Conner
Transplant from Los Angeles Ca, in Charlotte NC...MAN do I wanna go home! At 10:27 11.09.2001 -0500, [EMAIL PROTECTED] wrote: >Atlanta, Georgia > >Rex :)- > >-Original Message- >From: Wagner-David [mailto:[EMAIL PROTECTED]] >Sent: Friday, November 09, 2001 10:26 AM >To: 'Etienne Marcotte'

Re: CPAN module...and forceful installs

2001-11-08 Thread Jim Conner
At 02:02 11.09.2001 -0500, Jim Conner wrote: >I am getting: > >Failed Test Status Wstat Total Fail Failed List of Failed > >t/19_filterchange.t2 51255 55 100.00% 1-55 &

CPAN module...and forceful installs

2001-11-08 Thread Jim Conner
I am getting: Failed Test Status Wstat Total Fail Failed List of Failed t/19_filterchange.t2 51255 55 100.00% 1-55 5 tests skipped. Failed 1/26 test scripts, 96.15% okay. 55/463 subtests fa

Re: REQ concise steps for setting up a socket

2001-08-26 Thread Jim Conner
At 07:10 PM 08.26.2001 -0700, Peter Scott wrote: >At 08:56 PM 8/26/01 -0400, Jim Conner wrote: >>I have looked all over the place for something about the basic steps to >>setting up a tcp socket in Perl using Socket.pm and I simply cannot find >>it. I am using Socket.pm

Re: Perl is amazing!!

2001-08-22 Thread Jim Conner
At 07:17 AM 08.21.2001 -0500, Randy5235 wrote: >I just started learning Perl about 2 days ago. I am totally blown away at >the power and ease. I am however trying to find as much reference as >possible. I have checked most of the popular sites thus far and managed to >find some docs there. Any lin

RE: How to reference env variables.

2001-08-22 Thread Jim Conner
At 11:26 AM 08.22.2001 -0400, Bob Showalter wrote: > > -Original Message- > > From: Kingsbury, Michael [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, August 22, 2001 11:07 AM > > To: '[EMAIL PROTECTED]' > > Subject: How to reference env variables. > > > > > > When running a command such a

Re: html to SQL script

2001-08-17 Thread Jim Conner
At 11:14 PM 08.17.2001 -0500, Teresa Raymond wrote: >I have never worked with SQL before but I need to dump about 900 html >files into a SQL database. Someone else has written a PHP script to put >the content of the html pages in the database but you can only do it one >page at a time by submi

RE: PERL IS NOT A HIGH LEVEL LANGUAGE and What is a Script

2001-08-17 Thread Jim Conner
At 04:41 PM 08.17.2001 -0700, Dean Theophilou wrote: >Hello: > > I understand what you're saying but the fact remains: STRICTLY > speaking, >Perl is NOT an interpreted language (such as the BASIC language I learned in >high school, many, many years ago). Just a minor correction (semantic

Re: Calculation the total of my column

2001-08-15 Thread Jim Conner
I would do it like this (taking a stab at this...critique is welcomed): At 03:17 PM 08.16.2001 +0930, Daniel Falkenberg wrote: >List, > >I have a problem here that I am having a little bit of trouble trying to >resolve. Firstly I have a Perl script that connects to a PostgreSQL >database using t

Re: A little off topic.

2001-08-08 Thread Jim Conner
At 11:07 PM 08.08.2001 -0400, Rex Arul wrote: >Please visit http://www.activestate.com . They have PerlApp and PerlCOM >tools as part of the Perl Development Kit. > >With PerlApp you can generate free running EXEs and with PerlCOM you can >create DLLs which can be invoked by any VB/VBScript/JScrip

Re: very funny...

2001-08-08 Thread Jim Conner
At 06:30 PM 08.07.2001 +, Mel Matsuoka wrote: >At 09:08 AM 08/08/2001 +0530, Karthik Krishnamurthy wrote: > >All of the experts you are talking about started > >out some time as clueless newbies too. They didn't > >become experts by asking questions, the answers to > >which they could find the

adding an element to an array in a hash of arrays...

2001-08-01 Thread Jim Conner
How can I do this? :) - Jim -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861 -BEGIN PERL GEEK CODE BLOCK- --BEGIN GEEK CODE BLOCK-- Version: 0.01 Version: 3.12

Re: Date problem

2001-07-25 Thread Jim Conner
Use the POSIX function strftime: #!/usr/local/bin/perl -w use POSIX; print "The date is : ",POSIX::strftime("%m%d%Y",localtime()),"\n"; -- snip -- [notjames@concon notjames]$ perl -MPOSIX -e ' > print "The date is : ",POSIX::strftime("%m%d%Y",localtime()),"\n"; > ' The date is : 07252001 -

Re: Linux commands in perl

2001-07-25 Thread Jim Conner
There are other ways as well. You can use the system() function which forks into a child process, waits for the process to complete, and returns.. system("/bin/ls"); @FILES = system("/bin/ls"); And you can use the exec() function. This function does not fork a child process. According to th

Re: hash comparisons...

2001-07-20 Thread Jim Conner
sword. > >On 20 Jul 2001, Randal L. Schwartz wrote: > > > Date: 20 Jul 2001 08:36:44 -0700 > > From: Randal L. Schwartz <[EMAIL PROTECTED]> > > To: [EMAIL PROTECTED] > > Subject: Re: hash comparisons... > > > > >>>>> "Jim"

Re: hash comparisons...

2001-07-20 Thread Jim Conner
; >>12^$d>>4^$d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*8^$q<<6))<<9 >,$_=(map{$_%16or$t^=$c^=($m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;$t >^=(72,@z=(64,72,$a^=12*($_%16-2?0:$m&17)),$b^=$_%64?12:0,@z)[$_%8]}(16..271)) >[$_]^(($h>

hash comparisons...

2001-07-19 Thread Jim Conner
What is the best way to compare hash of arrays against each other? Actually, a better way to ask my question would be... I have a hash called %player_info that contains 4 elements per hash reference. I want to compare just the key of the hash against against another hash that I will build fr

Re: How to make a resource intensive script less intensive.

2001-07-08 Thread Jim Conner
I decided to go ahead and use File::Tail. it works like a champ. However, writing my own was quite helpful (or atleast tweaking my own ;)) Thanks all. - Jim At 04:31 PM 7/8/2001 -0400, Walt Mankowski wrote: >On Sun, Jul 08, 2001 at 02:20:40PM -0400, Jim Conner wrote: > > I am

Re: How to make a resource intensive script less intensive.

2001-07-08 Thread Jim Conner
Excellent! I will check that out! - Jim At 04:31 PM 7/8/2001 -0400, Walt Mankowski wrote: >On Sun, Jul 08, 2001 at 02:20:40PM -0400, Jim Conner wrote: > > I am writing a script that is quite cool imo once I get it done. But > > already I am seeing that it takes a ton of s

Re: How to make a resource intensive script less intensive.

2001-07-08 Thread Jim Conner
File::Tail module which might work for you as well, or, at >least show you another way to do it. > >-s- > > >At 2:20 PM -0400 7/8/01, Jim Conner wrote: >>I am writing a script that is quite cool imo once I get it done. But >>already I am seeing that it takes a ton o

How to make a resource intensive script less intensive.

2001-07-08 Thread Jim Conner
I am writing a script that is quite cool imo once I get it done. But already I am seeing that it takes a ton of system resources. Simply put, the script watches a log file (like tail -f) and then reacts to certain things that occur. I am thinking that the loop that it is in might be taking

Re: Editor

2001-07-07 Thread Jim Conner
If you got a precompiled version then it was compiled with highlighting turned off. Just recompile it. If you compiled it yourself then you somehow did so with highlighting turned off. ./configure --help when compiling should be helpful. At 08:19 PM 7/7/2001 +0200, Matija Papec wrote: >"Wi

Re: problems with chmod

2001-07-07 Thread Jim Conner
You should do some error checking... #!/usr/bin/perl -w use strict; use Getcwd; my $dir = "cody"; mkdir("$dir",0770) or warn("Could not mkdir $dir in ".getcwd.": $!\n"); This will tell you why or how something might be going wrong and what your pwd is. Also, you should check the parent direc