Re: Question of memory management in Perl

2004-05-24 Thread Eric Walker
off the top of my head I would suggest you slice off the slice off the pieces that you have used already when pulling data from the original array. That way the array gets smaller as you finish modifiying its info and transferring it somewhere else. BassFool On Monday 24 May 2004 02:57 pm, Ha

Re: find out who was online at a given time

2004-07-20 Thread Eric Walker
On Tuesday 20 July 2004 10:34 am, [EMAIL PROTECTED] wrote: > Ok, this may or may not be a tricky one I will try and be succinct in my > statement. > > I have a database (mysql 4.0) with radius log entries for each day, we > receive emails about Acceptable Use Abuses and must figure out exactly > wh

Re: Having trouble using the Shell within Perl script.

2004-07-26 Thread Eric Walker
Does the output from the scripts go into a file or does the output print to the screen(standard out)? If it goes to a file then you need to open the file and read the info. If it goes to standard out you can do something like this to get the ouput. @info=`/home/my/directory/` (the backtick not t

Re: converting the elements of a hash to uppercase

2004-11-12 Thread Eric Walker
; use strict; > use warnings; > > my $ref = { 'a' => 'aaa', 'b' => 'bbb', 'c' => 'ccc' }; > > while ( my($k,$v) = each %$ref ) { > $ref->{uc($k)} = delete( $ref->{$k} ); > } > > use Data::Dumper; > print Dumper( $ref ); > > __END__ -- Eric Walker -- CAD Engineer X82573 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Trouble with compound regular expression matching

2004-12-06 Thread Eric Walker
> 928-203-0170 > > "There are only two ways to live your life. > One is as though nothing is a miracle. > The other is as if everything is." > --Albert Einstein I am no professional but try this one. if ($file_name !~ /(tif$|jpg$)/i

Re: remove duplicate lines

2005-05-27 Thread Eric Walker
Can't you run uniq from the command prompt to get rid of the duplicate lines? perlnewbie.. On Friday 27 May 2005 09:07 am, John Doe wrote: > Hello > > As an addition to my last post: > > Am Freitag, 27. Mai 2005 13.56 schrieb Jack Daniels (Butch): > > Wow, I'm really confused. I'm trying to remo

Re: remove duplicate lines

2005-05-27 Thread Eric Walker
On Friday 27 May 2005 01:22 pm, John Doe wrote: > Am Freitag, 27. Mai 2005 17.15 schrieb Eric Walker: > > Can't you run uniq from the command prompt to get rid of the duplicate > > lines? > > > > perlnewbie.. > > [...] > > Yes I can, > > $ cat

Re: blessing a class

2005-06-07 Thread Eric Walker
On Tuesday 07 June 2005 12:44 pm, radhika wrote: > I am learning about perl modules and am having a little trouble > understanding the "blessing" of an object. For instance: > bless($self, $type); > What does this do? > > Thanks, > rs. > > -- > It's all a matter of perspective. You can choose your

Re: Grep uniqueness issue

2005-07-29 Thread Eric Walker
rs (\b) in the grep so I am confused as > to why this is not working. > > Does anyone have any ideas as to why this is occuring and how I can prevent > it? -- Eric Walker EDA/CAD Engineer Work: 208-368-2573 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Escaping with tr

2005-08-30 Thread Eric Walker
On Tuesday 30 August 2005 04:16 pm, Bernard van de Koppel wrote: > "bla bla";"bla bla";"bla bla" cat test.file | sed 's/\"//g' > editedfile -- Eric Walker EDA/CAD Engineer Work: 208-368-2573 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: can any body tell me how to remove quotes from a name.

2005-08-31 Thread Eric Walker
ution, > printing or copying of the information contained in this e-mail message > and/or attachments to it are strictly prohibited. If you have received > this communication in error, please notify us by reply e-mail or telephone > and immediately and permanently delete the message and any a

Re: Please Help!!! Newbie question

2005-08-31 Thread Eric Walker
t; use strict; > use File::Basename; > my $path = $ARGV[0]; > my $base = basename($path); > my $dir = dirname($path); > print STDOUT $base; > > > any help will be greatly appreciated. > > Thanks in advance. print $path; I think that will get it... -- Eric

Re: Algorithm Help Needed

2005-09-13 Thread Eric Walker
On Tuesday 13 September 2005 09:55 am, Jeff 'japhy' Pinyan wrote: > On Sep 13, Bob Showalter said: > > I need help with an algorithm. I'm writing a program that sends a > > repeated pattern of requests to a service. Each request has a "weight" > > that controls the relative frequency with which I n

Re: Simple CGI question

2003-11-06 Thread Eric Walker
Newbie here but hope this helps. You have a page linked to the frame on the left right? All you need to do is have your CGI script write the new page. You use the info from the frame on the right and pass the values to your cgi script. Then let your CGI script write out a new html page using the

matching

2003-11-17 Thread Eric Walker
I have the following code to find a quote in a string and replace it with a slashquote. ie " goes to \" How do I get it to do more than one substitution in the string. $_ = $$Rules{$yes}{rule_desc}; s/"/\\"/; $$Rules{$yes}{rule_desc} = $_; newbie...

Re: matching

2003-11-17 Thread Eric Walker
Thanks that worked On Mon, 2003-11-17 at 15:27, James Edward Gray II wrote: On Nov 17, 2003, at 4:18 PM, Eric Walker wrote: > I have the following code to find a quote in a string and replace it > with a slashquote. > > ie " goes to \" &

Re: matching

2003-11-18 Thread Eric Walker
Mon, 17 Nov 2003 15:18:47 -0700, Eric Walker wrote: > How do I get it to do more than one substitution in the string. By using the /g modifier. > $_ = $$Rules{$yes}{rule_desc}; No. Don't _ever_ try to set $_ yourself, unless you _really_ have to (whic

Pointers

2003-11-20 Thread Eric Walker
Hello all, newbie here got a few questions: I am working with pointers and I sort of understand them and then I don't. I understand that instead of making a variable for a particular value you can use a pointer to access the same data. So the new variable stores the pointer to the old data. ie..

RE: Pointers

2003-11-20 Thread Eric Walker
ok why the $$ instead of the %$? sorry confused. On Thu, 2003-11-20 at 12:08, Paul Kraus wrote: $$overdate{key} Perldoc perlref -Original Message- From: Eric Walker [mailto:[EMAIL PROTECTED] Sent: Thursday, November 20, 2003 2:03 PM To: perlgroup

RE: Pointers

2003-11-20 Thread Eric Walker
uld address the entire hash as %$hashref Or a single element of that hash as $$hashref{key} HTH Paul -Original Message- From: Eric Walker [mailto:[EMAIL PROTECTED] Sent: Thursday, November 20, 2003 2:20 PM To: Paul Kraus Cc: 'perlgroup'

RE: Pointers

2003-11-20 Thread Eric Walker
wow ok then I will try and use the -> notation. No need to stay behind the times. On Thu, 2003-11-20 at 12:23, Bakken, Luke wrote: > ok why the $$ instead of the %$? > > sorry confused. > > \%overData. Now how do > I access this hash. %$overData? Because

RE: Pointers

2003-11-20 Thread Eric Walker
I am using a nested foreach but can't access the values within each foreach. hope this can clear it up a little. On Thu, 2003-11-20 at 12:34, Daniel Staal wrote: --As off Thursday, November 20, 2003 12:20 PM -0700, Eric Walker is alleged to have said: > ok why the $$ in

Ticked Off..

2003-11-21 Thread Eric Walker
Hey all I know I have been told but I can't seem to access this hash. Can anyone look and see why I can't print out any values. The print item statement works and prints out the first level of the hash. I send in a pointer to $data and $rule. sub COMMENTSYNC{ my($rule,$data) = @_; my($crule,$temp

RE: Ticked Off..

2003-11-21 Thread Eric Walker
OK hash should look like this. M ->anonhash a -> value; b-> value; c-> value; does that help? On Fri, 2003-11-21 at 14:04, Bob Showalter wrote: Eric Walker wrote: > Hey all I know I have been told but I can't seem

RE: Ticked Off..

2003-11-21 Thread Eric Walker
I got it thanks. I see my mistake.. wow this list is nice.. Thanks again newbie On Fri, 2003-11-21 at 14:10, Eric Walker wrote: OK hash should look like this. M ->anonhash a -> value; b-> value; c-> value;

search

2003-11-21 Thread Eric Walker
I am trying to search a string for a "[]". I want to count the amount of "[]" in the string. Any IDeas

empty strings vs nulls

2003-11-24 Thread Eric Walker
How can I test for empty strings and nulls on a particular value. When I get an empty string or a null value I need to do something. Thanks in Advance. BassFool

nested Paren's

2003-12-11 Thread Eric Walker
Hey all, I have a file with some data that has like nested parens.. example yes( "hello" "goodbye" ( (one 2) (two 3) (three 4) ) (( mon 1) (tues 2) (wed 3) ) ((jan 1) (feb 2) (march 3) ) ) I need help in trying to break this up and make key value pairs out of the d

Re: nested Paren's

2003-12-11 Thread Eric Walker
3-12-11 at 11:28, drieux wrote: On Dec 11, 2003, at 9:30 AM, Eric Walker wrote: [..] > yes( "hello" "goodbye" > > ( (one 2) (two 3) (three 4) > ) > (( mon 1) (tues 2) (wed 3) > ) > ((jan 1) (feb 2) (march

Re: nested Paren's

2003-12-11 Thread Eric Walker
floaters. hehehe... On Thu, 2003-12-11 at 12:39, drieux wrote: On Dec 11, 2003, at 10:52 AM, Eric Walker wrote: > Well, the problem is that this is just one section > of a file the other sections actualy have different format. [..] > every know and then you get

foreach

2003-12-18 Thread Eric Walker
Hello all While traversing a loop across and array, how can I access array positions further down the array, like say if I am on a loop looking at position 23, how can I check the value of say position 24 or 32 while my loop counter is on position 23. Thanks perl knucklehead -- To unsubscrib

Re: foreach

2003-12-18 Thread Eric Walker
I got it so I need a counter which sends me to a for loop instead of a foreach. Thanks.. perlknucklehead On Thu, 2003-12-18 at 17:07, Paul Johnson wrote: On Thu, Dec 18, 2003 at 04:57:26PM -0700, Eric Walker wrote: > Hello all > While traversing a loop across and arra

Re: foreach

2003-12-19 Thread Eric Walker
Thanks I was able to use a for loop and just do a $cnt + N to access any locations that I needed, that I have not iterated on. Thanks...all for your help perlknucklehead On Fri, 2003-12-19 at 07:24, James Edward Gray II wrote: On Dec 19, 2003, at 7:59 AM, Rob Dixon wrote: > That's f

debugger

2003-12-19 Thread Eric Walker
Hello all, When using the perl debugger, is there a way to load in the breakpoints and watch variables that I want from a file. I am using it now and as I am debugging I am finding problems but when I start the program over I have to re-enter all my breakpoints and watch variables again. Can these

NEVERMIND I FOUND THE ANSWER

2003-12-19 Thread Eric Walker
Never mind, I found that instead of hitting q twice , just hit it once and the r for restart and I still keep all my settings.. Thanks... perlknucklehead -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Align Text

2003-12-19 Thread Eric Walker
I have use the FORMAT function in perl. Its pretty nice. perldoc -f format. Hope that helps perlknucklehead On Fri, 2003-12-19 at 14:20, Rob Dixon wrote: Bill Jastram wrote: > We're getting closer. But lets say the first name of the first > field in the first row is 'Bill'. And t

$_

2003-12-30 Thread Eric Walker
I am going through a file and when I enter a certain routine, I am entering a while loop with the construct. Is there a way to back the counter up or back up one line before I go into the while loop? a b c d Instead of seeing b when I enter the while loop, adjust some option and see the a. per

Re: $_

2003-12-30 Thread Eric Walker
The lines will always be defined but I need to process that previous line. I am still kinda in the closet on what you mean. .. On Tue, 2003-12-30 at 09:42, James Edward Gray II wrote: On Dec 30, 2003, at 10:36 AM, Eric Walker wrote: > I am going through a file and when I ente

Re: $_

2003-12-30 Thread Eric Walker
Once I get into the while loop the previous line I had is lost. As this while is underneath another while that I am using in another routine. thanks On Tue, 2003-12-30 at 09:42, James Edward Gray II wrote: On Dec 30, 2003, at 10:36 AM, Eric Walker wrote: > I am going through a f

RE: $_

2003-12-30 Thread Eric Walker
item is $_\n"; $prev = $_; } HTH DMuey > .. > On Tue, 2003-12-30 at 09:42, James Edward Gray II wrote: > On Dec 30, 2003, at 10:36 AM, Eric Walker wrote: > > > I am going through a file and when I enter a certain > r

Re: $_

2003-12-30 Thread Eric Walker
wrote: On Dec 30, 2003, at 10:45 AM, Eric Walker wrote: > The lines will always be defined but I need to process that previous > line. I am still kinda in the closet on what you mean. my $current = $_; # process $current here... Other choices: If file size

RE: $_

2003-12-30 Thread Eric Walker
> > HTH > > DMuey > > > .. > > On Tue, 2003-12-30 at 09:42, James Edward Gray II wrote: > > On Dec 30, 2003, at 10:36 AM, Eric Walker wrote: > > > > > I am going throug

Re: $_

2003-12-30 Thread Eric Walker
On Tue, 2003-12-30 at 16:39, Rob Dixon wrote: Eric Walker wrote: > > I am going through a file and when I enter a certain routine, I am > entering a while loop with the construct. Is there a way to back > the counter up or back up one line before I go into th

beginners@perl.org

2003-12-31 Thread Eric Walker
OK, some how my $_ variable is out of sync with my <> operator. if I print out $_ I get line a of my file and if I do a my $test = , and print out $test I get a different line that is more than the next line away. example. I am the best you are the best we are the best they are the best. print $

RE:

2003-12-31 Thread Eric Walker
eem to skip one. -Original Message- From: Eric Walker [mailto:[EMAIL PROTECTED] Sent: Wed 12/31/2003 9:57 AM To: perlgroup Cc: Subject: OK, some how my $_ variable is out of sync with

Re:

2003-12-31 Thread Eric Walker
On Wed, 2003-12-31 at 13:27, James Edward Gray II wrote: On Dec 31, 2003, at 11:57 AM, Eric Walker wrote: > OK, some how my $_ variable is out of sync with my <> operator. > if I print out $_ I get line a of my file and if I do a my $test = > , and print ou

Re:

2003-12-31 Thread Eric Walker
On Wed, 2003-12-31 at 14:35, James Edward Gray II wrote: On Dec 31, 2003, at 3:05 PM, Eric Walker wrote: > Ok thanks for that info. Now is there a way to move back up the file > and get previous lines or do you have to store them in a variable and > use t

is this sound?

2004-01-14 Thread Eric Walker
Hey guys/girls, I want to make a list of structures from a file. Then once I get the structures check to see if a particular value matches any in the list of structurs that I have created. If there is a match then return the pointer to the matching structure. Check the code below and let me know

omg, spelling

2004-01-14 Thread Eric Walker
please disregard the spelling errors... perlknucklehead -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

error.

2004-01-14 Thread Eric Walker
Does anyone know what this means... code.. for ($i = 0;$i <= $size; $i+=$temp){ $type= split(::,shift (@hold)); } Warning: Use of implicit split to @_ is deprecated at .//test.pl line 21 help, thanks perlknucklehead

RE: error.

2004-01-14 Thread Eric Walker
else will probably correct me i so. In any case, I'm almost 100% sure that isn't what you want. -Original Message- From: Eric Walker [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 14, 2004 3:03 PM To: perlgroup Subject: error. Does a

RE: error.

2004-01-14 Thread Eric Walker
else will probably correct me i so. In any case, I'm almost 100% sure that isn't what you want. -Original Message- From: Eric Walker [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 14, 2004 3:03 PM To: perlgroup Subject: error. Does a

modules and _DATA_

2004-01-23 Thread Eric Walker
I have some code I want to add a package in the same file. I already have some _DATA_ in the file. Currently, the code is not seeing the _DATA_. How can I add a package in the same file then. Thanks perlknucklehead example: while { do something } _DATA_ this is my data section

Re: modules and _DATA_

2004-01-23 Thread Eric Walker
On Fri, 2004-01-23 at 14:34, James Edward Gray II wrote: On Jan 23, 2004, at 3:27 PM, Eric Walker wrote: > I have some code I want to add a package in the same file. I already > have some _DATA_ in the file. Currently, the code is not seeing the > _DATA_. How ca

Re: modules and _DATA_

2004-01-23 Thread Eric Walker
On Fri, 2004-01-23 at 14:43, Randy W. Sims wrote: On 1/23/2004 4:36 PM, Eric Walker wrote: > > when I tried to add a package to it, I did some test and its not reading > the DATA anymore. Is there a certain order? __DATA__ must be in package main;

Re: modules and _DATA_

2004-01-23 Thread Eric Walker
On Fri, 2004-01-23 at 14:46, drieux wrote: On Jan 23, 2004, at 1:36 PM, Eric Walker wrote: [..] > > when I tried to add a package to it, I did some test and its not > reading > the DATA anymore. Is there a certain order? [..] How did you put th

INFO PLEASE

2003-03-26 Thread Eric Walker
how can I see where modules are installed no matter if they are personal or come with perl also how can I tell what functions are available for them. Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: INFO PLEASE

2003-03-26 Thread Eric Walker
ules {     if (-d && /^[a-z]/) { $File::Find::prune = 1 ; return }     return unless /\.pm$/ ;     my $fullPath = "$File::Find::dir/$_";     $fullPath =~ s!\.pm$!!;     $fullPath =~ s#/(\w+)$#::$1# ;     print "$fullPath \n"; } -Original Message-

printing

2003-04-03 Thread Eric Walker
I can't remember how to setup a print statement to say print 60 "#"; I think its something like print ("\*",40); please help Eric -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

HASH PRINTING

2003-04-03 Thread Eric Walker
I have a HASH with a mixture of single, double and triple layers. exampl hash of hash of array's etc I try to dump and see values of the entire db but I get pointers and memory addresses. Below is my code Please help. foreach my $item (keys %hData){ print ("$item: $hData{$item}\n"); } Thank

Re: HASH PRINTING

2003-04-03 Thread Eric Walker
::Dumper` if you're on a UNIX machine. > > -- > David Olbersen > iGuard Engineer > 11415 West Bernardo Court > San Diego, CA 92127 > 1-858-676-2277 x2152 > > > -Original Message- > > From: Eric Walker [mailto:[EMAIL PROTECTED] > >

Re: HASH PRINTING

2003-04-03 Thread Eric Walker
Jenda Krynicky wrote: > From: Eric Walker <[EMAIL PROTECTED]> > > David Olbersen wrote: > > > > From: Eric Walker [mailto:[EMAIL PROTECTED] > > > > > > > > I have a HASH with a mixture of single, double and triple layers. > > > &g

Re: HASH PRINTING

2003-04-04 Thread Eric Walker
print $HASH{$KEY} > > HTH, > Yargo! > > Original Message: > - > From: R. Joseph Newton [EMAIL PROTECTED] > Date: Thu, 03 Apr 2003 18:04:43 -0800 > To: [EMAIL PROTECTED], [EMAIL PROTECTED] > Subject: Re: HASH PRINTING > > Eric Walker wrote: > &

HASH PROBLEM!!

2003-06-20 Thread Eric Walker
I have a check I am doing with a hash. if (exists $deref{$drcrule}) This check fails as if the keyvalue is a part of the hash, but when I print out the keys like this foreach my $item (%{$deref}){ print "$item\n"; } And it is not in the list. I ran this on a previous data that had this in

PROCESS ID

2003-08-27 Thread Eric Walker
Hello all I want to us the variable $< to get the REAL UID of the perl program that is running. How can I get the users name from that number it gives me? Thanks Eric Walker

RE: PROCESS ID

2003-08-27 Thread Eric Walker
hat does that? You can always qx() the same way you'd do it via command line. IE if you can do $ /usr/bin/sername 0 root $ Then you can do perhaps: my $userfromid = qx(/usr/bin/username $<); HTH DMuey

packages object oriented

2003-09-12 Thread Eric Walker
Does anyone have a good hold of how to do object oriented programming in perl? Maybe a few lines of code as examples? EDUB

Re: packages object oriented

2003-09-12 Thread Eric Walker
, James Edward Gray II wrote: On Friday, September 12, 2003, at 09:32 AM, Eric Walker wrote: > Does anyone have a good hold of how to do object oriented programming > in > perl? Maybe a few lines of code as examples? I feel my grasp of the concept is st

Re: packages object oriented

2003-09-12 Thread Eric Walker
, Steve Grazzini wrote: On Fri, Sep 12, 2003 at 08:32:38AM -0600, Eric Walker wrote: > Does anyone have a good hold of how to do object oriented programming > in perl? Maybe a few lines of code as examples? There are some tutorials in the standard docs. $ p

PERLTK

2003-09-16 Thread Eric Walker
Anyone know how I can set up a bind event to alow a menu button such as say "File" to show the sub menu? I have F in file underlined and want to be able to hit like alt-f and get the sub menu to show. Any Ideas or examples? EDOG