Re: array of elements

2003-10-27 Thread Steve Grazzini
On Mon, Oct 27, 2003 at 09:52:20PM -0600, Andrew Gaffney wrote: > I have an array of keywords that I need to generate. I have 2 separate > input files. The first one contains the defaults. The second input file > contains additions and overrides. For example, first input: > > key1 key2 key3 key4

Re: array of elements

2003-10-27 Thread Andrew Gaffney
How would I go about this? simran wrote: a way i can think of is: * read first file and put keys in hash (%h) * read second file and add/delete from hash (%h) as needed * print keys of %h On Tue, 2003-10-28 at 14:52, Andrew Gaffney wrote: I have an array of keywords that I need to generate. I

array of elements

2003-10-27 Thread Andrew Gaffney
I have an array of keywords that I need to generate. I have 2 separate input files. The first one contains the defaults. The second input file contains additions and overrides. For example, first input: key1 key2 key3 key4 key5 key6 key7 second input: -key3 -key5 key8 key9 end result: key1 k

Re: creating a hash list from arrays

2003-10-27 Thread Jeff 'japhy' Pinyan
On Oct 27, radhika sambamurti said: >As per the code below, I am trying to read from the database and put the >values into a hash list, so that I can retrieve the values later. I have >managed to put the values into arrays, but am not able to put them into a >hash. Any ideas how this can be done/i

Re: creating a hash list from arrays

2003-10-27 Thread radhika sambamurti
Hmmm, This did not work. my $count = keys %results_hash; gives me 0 And perl also complained that $results_hash had to be explicitly defined, so I had my $results_hash AND my %results_hash. This is not working. my hash is empty. Radhika On Mon, 27 Oct 2003 21:24:28 -0600 Daniel Staal <[EMAIL PR

Re: creating a hash list from arrays

2003-10-27 Thread Daniel Staal
--On Monday, October 27, 2003 21:22 -0600 Daniel Staal <[EMAIL PROTECTED]> wrote: my $results_hash; Sorry, correction. That should be: my %results_hash; while (my $res = $sth->fetchrow_hashref()) { push(@menu_id, $res->{"menu_item_number"}); push(@menu_desc, $res->{"description"}); $r

Re: creating a hash list from arrays

2003-10-27 Thread Daniel Staal
--On Monday, October 27, 2003 21:51 -0500 radhika sambamurti <[EMAIL PROTECTED]> wrote: Hi, As per the code below, I am trying to read from the database and put the values into a hash list, so that I can retrieve the values later. I have managed to put the values into arrays, but am not able to p

creating a hash list from arrays

2003-10-27 Thread radhika sambamurti
Hi, As per the code below, I am trying to read from the database and put the values into a hash list, so that I can retrieve the values later. I have managed to put the values into arrays, but am not able to put them into a hash. Any ideas how this can be done/improved? ###code below## while

Re: Opening a new shell

2003-10-27 Thread simran
% perldoc -f fork On Tue, 2003-10-28 at 12:50, Anthony J Segelhorst wrote: > I am strapped for time on the run time on a perl script I have been > working on. > > I was wondering if it is possible to open another shell within a perl > script that will call another script that uses another pr

RE: Opening a new shell

2003-10-27 Thread LoBue, Mark
> -Original Message- > From: Anthony J Segelhorst [mailto:[EMAIL PROTECTED] > Sent: Monday, October 27, 2003 5:50 PM > To: [EMAIL PROTECTED] > Subject: Opening a new shell > > > I am strapped for time on the run time on a perl script I have been > working on. > > I was wondering if it

Opening a new shell

2003-10-27 Thread Anthony J Segelhorst
I am strapped for time on the run time on a perl script I have been working on. I was wondering if it is possible to open another shell within a perl script that will call another script that uses another processes. If I call script B from script A, script A will not complete until script B i

RE: Issue

2003-10-27 Thread Bruce_Phillip
Bob, Thanks for the feedback, The only thing is that $O^ will only work if the scripts are going to be invoke on that system. My plans are to run the perl script from one location and go and discover the systems and their configuration. I'll be using Net::Telnet module to do this with to con

Re: using modules only when available

2003-10-27 Thread Steve Grazzini
On Mon, Oct 27, 2003 at 03:21:50PM -0700, Wiggins d Anconia wrote: > > This is what I tried: > > > > eval "use Tk"; > > I would have thought in this case you would want the BLOCK form of > 'eval' rather than the EXPR form? Or does it matter? Gurus can you > expound on the differences in this ca

RE: using modules only when available

2003-10-27 Thread Bakken, Luke
> I would have thought in this case you would want the BLOCK form of > 'eval' rather than the EXPR form? Or does it matter? Gurus can you > expound on the differences in this case? > > Give: > > eval { use Tk }; > if ($@) { > # module not ok, etc. > } > > A try. perldoc -f eval > > http://d

Re: using modules only when available

2003-10-27 Thread Wiggins d Anconia
> This is what I tried: > > eval "use Tk"; >if ($@) { > $notk = 1; >} > > Now, on machines where Tk doesn't exist, it works fine. On machines where Tk > does exist, the program exits silently when I begin to use Tk. > > Perhaps there is a caveat with using this with Tkany ide

Re: using modules only when available

2003-10-27 Thread Phil Schaechter
This is what I tried: eval "use Tk"; if ($@) { $notk = 1; } Now, on machines where Tk doesn't exist, it works fine. On machines where Tk does exist, the program exits silently when I begin to use Tk. Perhaps there is a caveat with using this with Tkany ideas, anyone? -Phil >

RE: using modules only when available

2003-10-27 Thread Bob Showalter
Phil Schaechter wrote: > I have a program that has an optional GUI which makes use of > Tk. On machines > without Tk, the program errors out looking for the Tk > modules. Currently, I > am just saying > > use Tk; > > Is there some method I can use that will prevent it from > dying in the event

using modules only when available

2003-10-27 Thread Phil Schaechter
I have a program that has an optional GUI which makes use of Tk. On machines without Tk, the program errors out looking for the Tk modules. Currently, I am just saying use Tk; Is there some method I can use that will prevent it from dying in the event Tk is not on the current machine? Or, i

RE: Issue

2003-10-27 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Hi, > > > > I'm trying to accomplish some task using perl. So let > > me describe what I have. > > > > I have several systems of the following: > > > > Unix: > > Sun - Solaris > > HP - HPUX > > > > Windows: > >

Re: Can't Compile BerkeleyDB on OS X with Perl 5.8.1

2003-10-27 Thread Aaron Davies
On Monday, October 27, 2003, at 09:43 AM, Bakken, Luke wrote: -Original Message- From: Aaron Davies [mailto:[EMAIL PROTECTED] I'm trying to install BerkeleyDB via CPAN on my OS X 10.2.6 box, but the make phase bombs almost immediately. I've put the error log at

Issue

2003-10-27 Thread Bruce_Phillip
Hi, I'm trying to accomplish some task using perl. So let me describe what I have. I have several systems of the following: Unix: Sun - Solaris HP - HPUX Windows: Dell - Windows 2k Each of these OS's have specific commands t

downloading a mp3 file using LWP::simple

2003-10-27 Thread [EMAIL PROTECTED]
using the following code I get a distorted file , I used the sockets and the result is the same here is the LWP code i used use strict; use LWP::Simple; my $url ="http://xxx.xxx.com/Amazing_Grace.mp3"; ; my $html = get($url) ; print $html; exit(0); I think that the tranfer was made in ascii . any

Re: RE : SQL Syntax quickie

2003-10-27 Thread Chuck Fox
Yet another solution SET ROWCOUNT 1 SELECT id FROM table ORDER BY id DESC Only works if there is an index on id and the RDBMS support backward scans Chuck [EMAIL PROTECTED] wrote: Another solution : For your query, try "SELECT MAX(id) FROM table" That works with mysql. -Message d'origine

help with perl

2003-10-27 Thread Rufus Fleary
I need to convert times in a piece of text to dfifferent formats The formats are 24 hour clock as hh:mm 09:35 17:05 24 hour clock as hhmmhrs 0935hrs 1705hrs 12 hour clock hh.mm am or pm 9.35am 5.05pm The application is to have a web form with a large text area for the text to be processed an oth

RE: Finding the current path

2003-10-27 Thread Bob Showalter
Octavian Rasnita wrote: > Does anyone know if it is possible to find out the path in > which a perl > program is launched? > > For example, I am in /var/www and I run the following command: > > perl /home/script.pl > > And I want it to give me the result: > > /var/www Use the standard Cwd module.

Re: Parse and Compare Text Files

2003-10-27 Thread Mike M
I've found this script on another message board that is close, but still doesn't work with my data. Any ideas on modifications? I think my biggest problem is the regex in the split function, because what this does is match ONLY against the first column in the line, when I need it to match anythin

RE: cat zipped files

2003-10-27 Thread Steve Lobach
Thank you, for some reason I had it in my mind that command would only decompress the file, I tried it in my perl script and it worked fine.. >>> "Bakken, Luke" <[EMAIL PROTECTED]> 10/27/03 09:41AM >>> > -Original Message- > I was hoping someone would have an idea of how to cat zipped >

Re: cat zipped files

2003-10-27 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > I was hoping someone would have an idea of how to cat zipped files.. gzcat > is NOT available to me, however, cat and zcat are.. But is there a module or > sample perl script to cat zipped files? Hi Steve. Archive::Zip is what you need. use strict; use warnings;

RE: Can't Compile BerkeleyDB on OS X with Perl 5.8.1

2003-10-27 Thread Bakken, Luke
> -Original Message- > From: Aaron Davies [mailto:[EMAIL PROTECTED] > > I'm trying to install BerkeleyDB via CPAN on my OS X 10.2.6 box, but > the make phase bombs almost immediately. I've put the error log at > , since > it's a little

RE: cat zipped files

2003-10-27 Thread Bakken, Luke
> -Original Message- > I was hoping someone would have an idea of how to cat zipped > files.. gzcat > is NOT available to me, however, cat and zcat are.. But is > there a module or > sample perl script to cat zipped files? Thanks, Steve. If you have gzip, look at gzip -d -c -- To unsub

cat zipped files

2003-10-27 Thread lobach
I was hoping someone would have an idea of how to cat zipped files.. gzcat is NOT available to me, however, cat and zcat are.. But is there a module or sample perl script to cat zipped files? Thanks, Steve. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR

Re: how to optimize a string search

2003-10-27 Thread Rob Dixon
Ramprasad A Padmanabhan wrote: > > I know this is more of an algorithm question but please bear with me. > > > In my program I am checking wether a emailid exists in a list > I have in the complete_list a string like > $complete_string="<[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> ..

how to optimize a string search

2003-10-27 Thread Ramprasad A Padmanabhan
I know this is more of an algorithm question but please bear with me. In my program I am checking wether a emailid exists in a list I have in the complete_list a string like $complete_string="<[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> ... <[EMAIL PROTECTED]>"; # that is a string

RE: Custom rmodule with use strict;

2003-10-27 Thread Bob Showalter
Dan Muey wrote: > Howdy all!. > > I'm using a simpewlmmodule to get vars an dfunctions into one place. Dan, I think you need a new keyboard :~) > > It works dandy except I can't have use strict in the module. > > I think it has todo with not doing my or our with teh @EXPORT and > friends: U

Re: how to pass multi array as args

2003-10-27 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > > If you prototype your subroutine as > > > > sub mysub ([EMAIL PROTECTED]@\@) > > I saw that prototying in the docs. Does perl programmer use prototyping? I'm not sure what you mean here? Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: initializing a closure variable

2003-10-27 Thread Rob Dixon
Kevin Pfeiffer wrote: > > I would have thought that this would initialize my $indent variable to 2 > (like setting an initial state for an object), but if I call "indent()" I > get nothing back. :-( > > > { # static local variable >my $indent = 2; > >sub indent { > my $increment = sh

RE: RE : SQL Syntax quickie

2003-10-27 Thread EUROSPACE SZARINDAR
Hi Dan, To be sure to collect something, you could use the "nvl(VALUE_ORI, replacement_value_if_VALUE_ORI_is_null)" function which will return something if the entry value is null otherwise return the entry value. select nvl( max(id), 0 ) from table_id ; The "nvl" is an Oracle function but sur

Can't Compile BerkeleyDB on OS X with Perl 5.8.1

2003-10-27 Thread Aaron Davies
I'm trying to install BerkeleyDB via CPAN on my OS X 10.2.6 box, but the make phase bombs almost immediately. I've put the error log at , since it's a little larger than I like to mail people. Can anyone give me a hand here? -- __

Re: RE : SQL Syntax quickie

2003-10-27 Thread dan
Thanks I'll try your suggestion about the LIMIT portion, that's what I want, to minimize the amount of data the program gets from the SQL server, making processing faster. The program isn't a script as such that's executed from the web, it's a program that opens a socket, connects to IRC chat and

Re: pattern matching

2003-10-27 Thread Ramprasad A Padmanabhan
Christiane Nerz wrote: Hi everybody! Two questions: I've got a test-file and want to add something to some lines, while reading it out. I tried the following code: while () { if (/pattern/) { #$line = $_ . $something; #push (@new_array, $line); } else { #$

RE: pattern matching

2003-10-27 Thread Stephen Hardisty
> SORRY! copy-and-paste-error...I tried it without the ### ;-) > and tried too the print-statement-thing. > Seems the regex is wrong, but why? > Jane Try: /^SA.+\n/ This email has been scanned for all viruses by the Message

Re: pattern matching

2003-10-27 Thread Christiane Nerz
SORRY! copy-and-paste-error...I tried it without the ### ;-) and tried too the print-statement-thing. Seems the regex is wrong, but why? Jane Stephen Hardisty wrote: Two questions: I've got a test-file and want to add something to some lines, while reading it out. I tried the following code:

Re: working on time

2003-10-27 Thread [EMAIL PROTECTED]
Hi, thanks, it working very well. Damien -- Initial Header --- From : news <[EMAIL PROTECTED]> To : [EMAIL PROTECTED] Cc : Date : Fri, 10 Oct 2003 19:17:39 +0200 Subject : Re: working on time On Fri, 10 Oct 2003 12:13:45 -0400, Bill Akins wrote: > T

RE: pattern matching

2003-10-27 Thread Stephen Hardisty
> Two questions: > I've got a test-file and want to add something to some lines, while > reading it out. > I tried the following code: > > while () { > if (/pattern/) { > #$line = $_ . $something; > #push (@new_array, $line); > } > else { > #$line

pattern matching

2003-10-27 Thread Christiane Nerz
Hi everybody! Two questions: I've got a test-file and want to add something to some lines, while reading it out. I tried the following code: while () { if (/pattern/) { #$line = $_ . $something; #push (@new_array, $line); } else { #$line = $_; #push

Re: trouble backup with perl.

2003-10-27 Thread Goffredo Saffioti
Wiggins d'Anconia ha scritto: Goffredo Saffioti wrote: Ok your script work fine, but my problem still persist, because the work directory is too big so i need to do backup on more little portion of dir , i attempt to process i wish to process $backup_dir/2 or /4 how can do it? Which part o

Re: how to pass multi array as args

2003-10-27 Thread perl
> If you prototype your subroutine as > > sub mysub ([EMAIL PROTECTED]@\@) I saw that prototying in the docs. Does perl programmer use prototyping? thanks - eMail solutions by http://www.swanmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: how to pass multi array as args

2003-10-27 Thread perl
It took a while, but I got the reference syntax down with the referencing calls like $$x[int] and @$x. thanks > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > : > : > sub mysub { > : > my( $x, $y, $z ) = @_; > : > : Can I have three arrays instead? > : > : I know I can use $x->[0], $

Re: finding syntax errors

2003-10-27 Thread Motherofperls
I use editpadpro, (there is a lite free version of it). You can download syntax color schemes for perl code. It will give you the matching brace or parenthesis. http://www.editpadpro.com/cscs.html