accessing the systray

2005-06-27 Thread Andrew Gaffney
because of the systray integration :P -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: regex for l33t speak

2005-03-24 Thread Andrew Gaffney
be one possible solution. So would implementing an efficient dictionary lookup without loading the entire dictionary in memory. Randy. 1. <http://en.wikipedia.org/wiki/Leetspeak> Wow, this is more difficult than I first thought. I think I'm just going to drop the whole idea as the channel

Re: regex for l33t speak

2005-03-24 Thread Andrew Gaffney
Randy W. Sims wrote: Andrew Gaffney wrote: I'm trying to come up with a regex for my IRC bot that detects 1337 (in order to kick them from the channel). I can't seem to come up with one that will have few false positives but also work most of the time. Has anyone done something like t

Re: regex for l33t speak

2005-03-23 Thread Andrew Gaffney
Thomas Bätzler wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: Too literally. Basically, I'm trying to match a word that contains a mix of >=2 numbers (possibly next to each other) and letters. My current regex is: \b\d*[a-zA-Z]*(\d+[a-zA-Z]+)+\d*[a-zA-Z]*[^:,]\b but that seem

Re: regex for l33t speak

2005-03-23 Thread Andrew Gaffney
to each other) and letters. My current regex is: \b\d*[a-zA-Z]*(\d+[a-zA-Z]+)+\d*[a-zA-Z]*[^:,]\b but that seems to catch too much. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <

regex for l33t speak

2005-03-23 Thread Andrew Gaffney
uggestions? -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: remove me from the list

2005-01-28 Thread Andrew Gaffney
ok at the bottom of *every* email that you get from this list: To unsubscribe, e-mail: [EMAIL PROTECTED] -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org

Re: Can someone translate a small .PY to Perl?

2004-12-27 Thread Andrew Gaffney
Randal L. Schwartz wrote: "Andrew" == Andrew Gaffney <[EMAIL PROTECTED]> writes: Andrew> while `/bin/true`; Uh, what? Execute /bin/true, take its output if its output is non-null, continue. Last I checked, /bin/true outputs nothing. :) Maybe you wanted: while true;

Re: Can someone translate a small .PY to Perl?

2004-12-27 Thread Andrew Gaffney
that part. Also, reply to the list instead of the sender. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Can someone translate a small .PY to Perl?

2004-12-27 Thread Andrew Gaffney
RT)) if __debug__: print 'Time: %s' % time.ctime() time.sleep(BEAT_PERIOD) Both Perl or Python are overkill for this. This can be done with a very simple bash script. It only requires netcat. #!/bin/bash SERVER_IP="127.0.0.1" SERVER_PORT=43278 B

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

2004-12-17 Thread Andrew Gaffney
ing like this in the past? You could setup cron to run the script once every 5 minutes. Some like the following in your crontab should work: */5 * * * * root/my/script/to/ping/hosts.pl -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. -- To unsubscribe, e-mail: [EMAIL

Re: How to reinvent grep with perl?

2004-10-09 Thread Andrew Gaffney
;t used 'info' in a while, but I believe you can search those with 's'. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: How to reinvent grep with perl?

2004-10-09 Thread Andrew Gaffney
n hit '/', type a search term, and hit enter. To search that same term again, '/' then enter will do. This works on my Gentoo Linux box. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: subclassing HTML::Parser

2004-08-01 Thread Andrew Gaffney
Charles K. Clarkson wrote: From: Andrew Gaffney <mailto:[EMAIL PROTECTED]> wrote: : I've created a module that uses HTML::Parser to parse some : HTML and create a tree structure. Someone had suggested to : use HTML::TreeBuilder, but my HTML contains HTML::Mason : code embedde

Re: getting list of all .html files in a directory and its directories

2004-07-30 Thread Andrew Gaffney
Chris Devers wrote: On Fri, 30 Jul 2004, Andrew Gaffney wrote: I think it is a problem with the regex. If I change it to: grep -RLi '<%init>' * | grep '.html' I get all files that don't have '<%init>', but it doesn't work with the '<%(in

Re: getting list of all .html files in a directory and its directories

2004-07-30 Thread Andrew Gaffney
Chris Devers wrote: On Fri, 30 Jul 2004, Andrew Gaffney wrote: Chris Devers wrote: On Fri, 30 Jul 2004, Andrew Gaffney wrote: Then yes, I misunderstood. This version should do what you want: $ find /path/to/htdocs -type f | xargs egrep -liv '<%(perl|init)>' That still does

Re: getting list of all .html files in a directory and its directories

2004-07-30 Thread Andrew Gaffney
Chris Devers wrote: On Fri, 30 Jul 2004, Andrew Gaffney wrote: I think you misunderstand. I don't want to delete the files that contain '<%perl>' or '<%init>'. I just want to make a list of all .html files in a directory tree and remove the ones that contains

Re: getting list of all .html files in a directory and its directories

2004-07-30 Thread Andrew Gaffney
Chris Devers wrote: On Fri, 30 Jul 2004, Andrew Gaffney wrote: I need to get a list of all the files that end with '.html' in a directory and all of its subdirectories. I then want to search through each file and remove the ones from the list that contain '<%perl>' o

getting list of all .html files in a directory and its directories

2004-07-30 Thread Andrew Gaffney
I need to get a list of all the files that end with '.html' in a directory and all of its subdirectories. I then want to search through each file and remove the ones from the list that contain '<%perl>' or '<%init>'. How can I do this? Thank

subclassing HTML::Parser

2004-07-29 Thread Andrew Gaffney
; my $p = HTML::Parser->new( api_version => 3, start_h => [\&start, "tagname, attr"], end_h => [\&end, "tagname"], text_h => [\&text, "dtext"] );

tracking where I am in a tree structure (was: Re: parsing HTML)

2004-07-22 Thread Andrew Gaffney
Andrew Gaffney wrote: Andrew Gaffney wrote: Randy W. Sims wrote: On 7/21/2004 11:24 PM, Andrew Gaffney wrote: Randy W. Sims wrote: On 7/21/2004 10:42 PM, Andrew Gaffney wrote: I am trying to build a HTML editor for use with my HTML::Mason site. I intend for it to support nested tables, SPANs, and

Re: parsing HTML

2004-07-21 Thread Andrew Gaffney
Andrew Gaffney wrote: Randy W. Sims wrote: On 7/21/2004 11:24 PM, Andrew Gaffney wrote: Randy W. Sims wrote: On 7/21/2004 10:42 PM, Andrew Gaffney wrote: I am trying to build a HTML editor for use with my HTML::Mason site. I intend for it to support nested tables, SPANs, and anchors. I am

Re: parsing HTML

2004-07-21 Thread Andrew Gaffney
Randy W. Sims wrote: On 7/21/2004 11:24 PM, Andrew Gaffney wrote: Randy W. Sims wrote: On 7/21/2004 10:42 PM, Andrew Gaffney wrote: I am trying to build a HTML editor for use with my HTML::Mason site. I intend for it to support nested tables, SPANs, and anchors. I am looking for a module that

Re: parsing HTML

2004-07-21 Thread Andrew Gaffney
Randy W. Sims wrote: On 7/21/2004 10:42 PM, Andrew Gaffney wrote: I am trying to build a HTML editor for use with my HTML::Mason site. I intend for it to support nested tables, SPANs, and anchors. I am looking for a module that can help me parse existing HTML (custom or generated by my scripts

parsing HTML

2004-07-21 Thread Andrew Gaffney
t back into HTML. Is there a module that can help make this easier or should I go about this differently? -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Expect prog. doesn't work in background !

2004-07-15 Thread Andrew Gaffney
;/usr/bin/ftp' (or whatever) instead of 'ftp'. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Expect prog. doesn't work in background !

2004-07-15 Thread Andrew Gaffney
runs scripts. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Help a newbie to pick best version of Linux for Perl and perl/TK.

2004-07-14 Thread Andrew Gaffney
ually, the version of the Linux kernel won't affect anything in Perl or Perl/Tk, either. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> &

Re: Regex for numbers and text

2004-07-10 Thread Andrew Gaffney
appears to be fine, although I could just be missing something. What is your code and what happens instead of what you expect? -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Re: PERL Error when running MIME::Lite

2004-06-30 Thread Andrew Gaffney
l you how to do that). -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: PERL Error when running MIME::Lite

2004-06-30 Thread Andrew Gaffney
jason corbett wrote: Cannot locate MIME/Lite.pm in @INC. @INC contains: /usr/local/perl156/lib/5.6.1/PA-RISC2... Any one know about this? You need to install the MIME::Lite module. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL

Re: parsing large amounts of text

2004-06-29 Thread Andrew Gaffney
John W. Krahn wrote: Andrew Gaffney wrote: I'm working on a custom Perl script to parse my Apache logs and report custom information. When I run the following program, it ends up eating all available RAM (the system has 1GB) and dying. My access_log is ~410MB. Am I doing something wrong? The

parsing large amounts of text

2004-06-28 Thread Andrew Gaffney
@requests, [$ip, $date, $request, $requestcode, $bytesreturned, $browser]; } my $end = time; my $elapsed = $end - $start; close LOG; print "$#requests total records. $elapsed seconds elapsed\n"; -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To u

Re: Creating images

2004-06-26 Thread Andrew Gaffney
/somedir/arialnb.ttf",9,0,((57-$bounds[2])/2),13,$text); open IMAGE, "> $saveto" or die "Can't open $saveto\n"; binmode IMAGE; print IMAGE $im->png; close IMAGE; -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: can't coerce array into hash

2004-06-08 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : My boss wants me to write a script that will allow him to browse : through the customers in our DB alphabetically. He wants all the : customer's information to display on the page. I wrote the following : as part of

can't coerce array into hash

2004-06-08 Thread Andrew Gaffney
lv]->{id} eq $id) { if(!$lv) { $lastperson = $people->[$lv-1]->{id}; } else { $lastperson = -1; } if($lv != $#{$people}) { $nextperson = $people->[$lv+1]->{id}; } else { $nextperson = -1; } } } -- Andrew Gaffney Network Administrator Skyli

Re: different versions of same Perl module in different Apache vh osts

2004-06-07 Thread Andrew Gaffney
Bob Showalter wrote: Andrew Gaffney wrote: I will end up having more than 2 vhosts, most of which will need a custom version of this particular module. In that case, I think you'll need to give the modules different names. You could write your handler in such a way that it would recompil

Re: different versions of same Perl module in different Apache vh osts

2004-06-07 Thread Andrew Gaffney
Bob Showalter wrote: Andrew Gaffney wrote: I didn't really know where to post this since it isn't specifically Apache or Perl, so I'm posting herejust because :) I run 2 vhosts under Apache 1.3.29 (needed for mod_perl-1.x which is needed by HTML::Mason) on my Gentoo server. O

Re: Website Login and data parsing

2004-06-06 Thread Andrew Gaffney
ng for my current bank or my credit card company (Capital One), because their login pages use Javascript to generate random values and set cookies that are needed to login. I could figure it out if I really wanted to, but it isn't that big of a deal for me. -- Andrew Gaffney Network Adm

Re: different versions of same Perl module in different Apache vhosts

2004-06-05 Thread Andrew Gaffney
Philipp Traeder wrote: On Saturday 05 June 2004 HH:18:16, Andrew Gaffney wrote: I didn't really know where to post this since it isn't specifically Apache or Perl, so I'm posting herejust because :) I run 2 vhosts under Apache 1.3.29 (needed for mod_perl-1.x which is needed by

different versions of same Perl module in different Apache vhosts

2004-06-05 Thread Andrew Gaffney
2 copies of my custom module, one for each vhost. Is there an easy way to do this? -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <htt

Re: [Socket Programming]: Need info for Client / Server scenario

2004-05-30 Thread Andrew Gaffney
who has some idea what they are talking about :) -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: regex help

2004-05-28 Thread Andrew Gaffney
Roberto Etcheverry wrote: On Fri, 28 May 2004, Andrew Gaffney wrote: I'm trying to write a regex to parse the following data. Each group is a string to parse. 05/28/04 Purchase With Pin Pin $10.00(pending) $1,224.45 05/27/04 Purchase With Pin Shell Service Stlake St. Loumo $1.78 $1,234.

Re: weird math

2004-05-28 Thread Andrew Gaffney
Kevin Old wrote: On Thu, 2004-05-27 at 23:31, Andrew Gaffney wrote: I am writing a program to parse a CSV file downloaded from my bank. I have it keep a running balance, but I'm getting a weird total. Apparently, -457.16 + 460.93 = 3.769998. But when 20 is subtracted from that,

regex help

2004-05-28 Thread Andrew Gaffney
er one will be empty (nothing between ). The format is '$123.45' with the possibility of trailing HTML before the . I only want the number without the $. The sixth field will contain a dollar amount like the fourth and fifth fields. It could be surrounded by HTML. Again, I only need the n

weird math

2004-05-27 Thread Andrew Gaffney
alance\n"; } print ""; money.pl is an include file that contains the parse_csv() function which pulls apart each line of the downloaded CSV and pushes it into an array as an anonymous hash. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To uns

Re: displaying to_char formatting in Perl

2004-05-27 Thread Andrew Gaffney
Wiggins d Anconia wrote: Please bottom post I only top-post when other people in the thread do because it keeps things a little less confusing. It annoys the crap out of me, though. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail

Re: displaying to_char formatting in Perl

2004-05-27 Thread Andrew Gaffney
MCMULLIN, NANCY wrote: Thank you kindly. That fixed it. No problem. I do that all the time ;) -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.

Re: displaying to_char formatting in Perl

2004-05-27 Thread Andrew Gaffney
is "Internal Server Error". As soon as I comment out the (2)lines below: -- TO_CHAR(ie_dollar_amt, '$999,999.99'), it works just fine. As suggested before: use CGI::Carp qw(fatalsToBrowser); You'll get a more informative error message then. - Jan -- Andrew Gaffney Network Admin

Re: displaying to_char formatting in Perl

2004-05-27 Thread Andrew Gaffney
WS++; } print end_table; my ($name, $value); print end_html; warn "error: $DBI::errstr\n" if $DBI::err; print ("","Query returned $NUM_OF_ROWS records" , ""); exit(0); == You need to escape the $ as \$. In the first snippet you showed us, it was only enclosed by '' which wouldn't interpolate. In this code snippet, the whole thing is enclosed in "" which does interpolate. Perl was trying to access the variable $999, which doesn't exist. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Regular Expresssion - Matching over multiple lines

2004-05-18 Thread Andrew Gaffney
James Edward Gray II wrote: On May 17, 2004, at 11:16 PM, Andrew Gaffney wrote: Roman Hanousek wrote: Hi All I have bunch of files that contain code like this: What I am trying to do is match then check that this piece of code contains a alt= tag. And if it doen't print the lines where

Re: Regular Expresssion - Matching over multiple lines

2004-05-17 Thread Andrew Gaffney
ssing ALT\n" if(! defined $1); } That doesn't give you line numbers, but it does give you an idea of where to start. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

Re: perl ssh vnc tunnel

2004-05-16 Thread Andrew Gaffney
5900:machinebehindserver:5900 remotelinuxserver vncviewer localhost -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: removing element of array

2004-05-14 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I've modified your code to be more like it is in my program: : : #!/usr/bin/perl : : use strict; : use warnings; : use Data::Dumper 'Dumper'; : : my $array1 = ['test1', 'test2

Re: removing element of array

2004-05-14 Thread Andrew Gaffney
Andrew Gaffney wrote: Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : Charles K. Clarkson wrote: : > : > I don't understand what result you want to assign to : > the original array ref. Give us an example of what you want : > to end up with a

Re: removing element of array

2004-05-14 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : Charles K. Clarkson wrote: : > : > I don't understand what result you want to assign to : > the original array ref. Give us an example of what you want : > to end up with and we can get you there

Re: removing element of array

2004-05-14 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I tried to write a small test script to figure this out, : but I can't get anywhere. I used array references in my : test program, because I need to pull out an element from : an array through a ref and assign

Re: removing element of array

2004-05-14 Thread Andrew Gaffney
Andrew Gaffney wrote: Wiggins d'Anconia wrote: Andrew Gaffney wrote: I have an array that I need to remove an element from the middle of. Is there a one-liner way to do this? perldoc -f delete perldoc -f splice Helps? A little, but I don't know how to put it all together. I tried

Re: removing element of array

2004-05-14 Thread Andrew Gaffney
Wiggins d'Anconia wrote: Andrew Gaffney wrote: I have an array that I need to remove an element from the middle of. Is there a one-liner way to do this? perldoc -f delete perldoc -f splice Helps? A little, but I don't know how to put it all together. -- Andrew Gaffney Network Adm

removing element of array

2004-05-14 Thread Andrew Gaffney
I have an array that I need to remove an element from the middle of. Is there a one-liner way to do this? -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <h

Re: Problem with use strict;

2004-05-14 Thread Andrew Gaffney
MCMULLIN, NANCY wrote: But when I run the same code with use strict commented out - it works just fine... 'use strict' enforces the use of 'my' or 'our' for variable declarations. If a variable declaration doesn't have that while 'use strict' is in e

Re: find outside ipadress of router with perl

2004-05-14 Thread Andrew Gaffney
ainst the results: /Your IP address is (\d+\.\d+\.\d+\.\d+)/ The router's outside IP should be in $1. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <htt

simulating bash

2004-05-12 Thread Andrew Gaffney
#x27;'; $depend =~ s/(\s+|\n+)/ /gs; return $depend; } This works to do one-pass interpolation, but it doesn't get all the variables (for example: VAR1="something $VAR2" VAR2="test $VAR3" VAR3="anything $VAR4" would give me VAR1="something test $VA

Re: dependency tree

2004-05-12 Thread Andrew Gaffney
Jeff 'japhy' Pinyan wrote: On May 12, Andrew Gaffney said: my %tree = { package1 => [ package2, package3, package4 ], package2 => [ package7 ], package3 => [ package5 ], package4 => [ package7, package6], package5 =>

dependency tree

2004-05-12 Thread Andrew Gaffney
is a dependency of what (which key a certain value is under) with my tree structure. What is the easiest way to do this? Is there a better way to do this? -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

Re: return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
Andrew Gaffney wrote: Wiggins d Anconia wrote: Wiggins d Anconia wrote: my %masks; my %use; my @pkglist; my %pkgdeps; Why are these declared with a global scope? If they must be then something is wrong with your subs. Move these to after your sub listing, if your program still works then

Re: return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
. Try moving all of your subs into a library and keeping your main separate, use 'strict' in both files, make every variable 'my'd, when that works I suspect your problems will be solved. This still holds. I'll have to figure out how to redesign the configuration vari

Re: return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
Wiggins d Anconia wrote: Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I think that 'my' is bad because I have something similar to: : : my %tree; : : sub return_an_arrayref() { :my @array = ('thing1', 'thing2', &#x

Re: return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
n. It was more pseudocode than anything. I can't seem to duplicate the problem with test code. One thing I forgot to mention is that these functions are called recursively as far as 15 levels deep. Would that cause issues when returning a ref to a 'my'ed array from a function? --

Re: return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I think that 'my' is bad because I have something similar to: : : my %tree; : : sub return_an_arrayref() { :my @array = ('thing1', 'thing2', 'thing3'); :ret

Re: return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
key in %tree. I know return_an_arrayref() is returning data because I can print all the elements out in build_tree(). -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

return array/hash ref from function

2004-05-12 Thread Andrew Gaffney
need to make sure I don't have conflicting variable names from other functions? What pitfalls do I need to know about when doing this? -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

building a dependency tree

2004-05-11 Thread Andrew Gaffney
e, but it isn't so simple to take into account packages that have dependencies on different version ranges than another package (one package having '>somepackage-3.4' and another ' -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubs

Re: simple include

2004-05-06 Thread Andrew Gaffney
custom modules before. I was just being lazy and didn't want to create a module and place it in one of the @INC directories ;) -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Removing characters from a string

2004-05-04 Thread Andrew Gaffney
[EMAIL PROTECTED] wrote: How would I remove any and "only" single characters from a string? $_ = "This is a character d g string test"; I want this to read "This is character string test." Off the top of my head...untested: $string =~ s/ \w\b//g; -- Andrew Gaffney

simple include

2004-05-04 Thread Andrew Gaffney
cgi->Vars; my $uid = $cgi->cookie('uid'); if($uid eq '') { print $cgi->header; print "location.replace('/cgi-bin/login.pl');"; } 1; In my scripts, I do 'require "./common.pl";' but I get errors when I try to use the variable de

Kismet::Client

2004-04-30 Thread Andrew Gaffney
with a Kismet C library? If so, where is the documentation for this library? If not, is there more detailed documentation for this module? -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: Not Exactly Perl prob but!

2004-04-28 Thread Andrew Gaffney
was so she could download Perl or something ;) I've never dealt with them, but they got a good review by my local LUG: https://www.access-4-free.com/rates.htm -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

Re: using Hash::Case and Storable

2004-04-26 Thread Andrew Gaffney
:Hash, aka Tie::Hash::LowerDeep or similar, essentially you would end up with a nested call to tieing any internal hash refs. I'd realized that. I don't need the nested hashes to be lower case, so it is not an issue. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-35

Re: using Hash::Case and Storable

2004-04-26 Thread Andrew Gaffney
as the 'VALUES'. For instance, my $thawed = retrieve('somefile'); tie my(%realhash), 'Hash::Case::Lower', $thawed; Ah, I guess I'd missed that part in the docs for the Hash::Case::Lower module. Is it safe to 'delete $thawed' after I tie the hash so I d

parsing written language

2004-04-26 Thread Andrew Gaffney
Is there a module out there that could aid me in parsing written English? I've searched CPAN, but I didn't find anything that seemed to be relevant. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

using Hash::Case and Storable

2004-04-25 Thread Andrew Gaffney
er case insensitive. How can I make this work? -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: using string as hashref

2004-04-25 Thread Andrew Gaffney
James Edward Gray II wrote: On Apr 25, 2004, at 1:40 PM, Andrew Gaffney wrote: James Edward Gray II wrote: On Apr 25, 2004, at 12:56 PM, Andrew Gaffney wrote: I'm writing a program that uses a hashref tree to store data. I'm just playing around with this, so it's nothing criti

Re: using string as hashref

2004-04-25 Thread Andrew Gaffney
James Edward Gray II wrote: On Apr 25, 2004, at 12:56 PM, Andrew Gaffney wrote: I'm writing a program that uses a hashref tree to store data. I'm just playing around with this, so it's nothing critical. I remember reading that you could use a string to specify a variable na

using string as hashref

2004-04-25 Thread Andrew Gaffney
a->{computer}->{test}->{item1}->{text}"; which corresponds to the the hash tree: my $data = {computer => {test => {item1 => {text => "computer.test.item1"; How can I get it to print "computer.test.item1" (from hash tree above) instead o

Re: getting array index inside for loop

2004-04-14 Thread Andrew Gaffney
JupiterHost.Net wrote: Andrew Gaffney wrote: Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I have code that uses a 'foreach(@array) {}' to loop : through an array. I now need to be able to get the : array index inside of that. I know I could sw

Re: getting array index inside for loop

2004-04-14 Thread Andrew Gaffney
Charles K. Clarkson wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : I have code that uses a 'foreach(@array) {}' to loop : through an array. I now need to be able to get the : array index inside of that. I know I could switch to : a 'for($loopvar=0;$loopvar<@array

getting array index inside for loop

2004-04-13 Thread Andrew Gaffney
not that way, is there a way to get the array index inside of a loop like 'for(0..$#array) {}'? -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://lear

Re: parsing Apache2 access log

2004-04-10 Thread Andrew Gaffney
Andrew Gaffney wrote: I maintain the Perl CGI/mod_perl side of a website, and someone else maintains the static HTML side. Well, the htdocs dir has gotten very messy. Because of things I've done with CGI/mod_perl/Mason, there are many static pages that are no longer used. I want to wr

parsing Apache2 access log

2004-04-09 Thread Andrew Gaffney
arse the Apache access log? -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: determining size of array through reference

2004-04-06 Thread Andrew Gaffney
david wrote: Andrew Gaffney wrote: I've got an array reference and I'm trying to figure out how many elements are in it. I've tried '$#arrayref', '[EMAIL PROTECTED]', '$(@($arrayref))', and probably a few others that I've forgotten. What is t

determining size of array through reference

2004-04-06 Thread Andrew Gaffney
I've got an array reference and I'm trying to figure out how many elements are in it. I've tried '$#arrayref', '[EMAIL PROTECTED]', '$(@($arrayref))', and probably a few others that I've forgotten. What is the correct way to do this? -- Andrew

Re: determining reference type

2004-04-06 Thread Andrew Gaffney
WC -Sx- Jones wrote: Andrew Gaffney wrote: How do you determine what type of data a reference points to? I have a function (one in previous post) that can take either an array of scalars or an array of hash references. I want to execute different code based on which one it was. How can I do

determining reference type

2004-04-06 Thread Andrew Gaffney
How do you determine what type of data a reference points to? I have a function (one in previous post) that can take either an array of scalars or an array of hash references. I want to execute different code based on which one it was. How can I do that? -- Andrew Gaffney Network Administrator

need help modifying code

2004-04-06 Thread Andrew Gaffney
{width => 200, text => 'Col3', total => 1}, {width => 100, text => 'Col4', total => 0}]; my @data; while(...) { # Get data somehow push @data, ["$data1", "$data2", "$data3", "$data4"]; } genera

Re: determing number of records returned with DBI

2004-03-30 Thread Andrew Gaffney
ATE and DELETE), or after fetching all the rows of a SELECT statement. With the mysql driver, it does return the number of fetched rows before you start iterating through them. It does what I need it to do. Thanks. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548

determing number of records returned with DBI

2004-03-30 Thread Andrew Gaffney
Is there a way to find out how many records were returned with a DBI query? There's the obvious counting each record as you fetch it, but I need the count before I start going through them. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e

Re: What is happening here

2004-03-29 Thread Andrew Gaffney
ure what results I was expecting when I ran it, but it sure wasn't this: 3 15 63 255 1023 4095 16383 65535 -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <htt

Re: date math

2004-03-29 Thread Andrew Gaffney
Chris Charley wrote: "Andrew Gaffney" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] R. Joseph Newton wrote: Andrew Gaffney wrote: [snip] I didn't do it this way because there is a "first" pay period. If there are only 2 pay periods from the starti

Re: Find User Apache is running as

2004-03-28 Thread Andrew Gaffney
e running Linux (might work on other UNIXs too), you can run 'ps aux | grep apache' (Apache 2.x) or 'ps aux | grep httpd' (Apache 1.x). The first column is the user it's running as. -- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548 -- To unsubsc

  1   2   3   >