Re: Simple encoding function

2005-03-30 Thread Ing. Branislav Gerzo
John W. Krahn [JWK], on Wednesday, March 30, 2005 at 12:56 (-0800) thoughtfully wrote the following: JWK> You could use the Math::BaseCalc module: JWK> http://search.cpan.org/~kwilliams/Math-BaseCalc-1.011/ thanks, it is nice module, really easy to use. And also thanks to your program, but I have

Re: General questions

2005-03-30 Thread Offer Kaye
On Thu, 31 Mar 2005 11:28:04 +0530, [EMAIL PROTECTED] wrote: > > Use strict is used to enforce declaration of variables before we use > them. > Here IN_FILE1 is file pointer variable which u are using and which is > not declared before , > That is the reason it is working fine when u have removed

RE: General questions

2005-03-30 Thread arjun.mallik
Hi Kumaran, Use strict is used to enforce declaration of variables before we use them. Here IN_FILE1 is file pointer variable which u are using and which is not declared before , That is the reason it is working fine when u have removed the use strict construct. Thanks Arjun Deserve before you

Re: Uniq from array ?

2005-03-30 Thread Chris Devers
On Wed, 30 Mar 2005, Peter Rabbitson wrote: > Anyway my 2c - I myself use the [$elided] archives quite a bit, which > does not prevent me from owning hard prints of the Cookbook, the > Pocket Ref and recently Object Oriented Perl. It however prevents from > owning 2 pcs of each of those not-so-

Re: Uniq from array ?

2005-03-30 Thread Peter Rabbitson
> > Not that I see why this came up in the first place... > How funny... By very same talking you can bring a gun to a social meeting and 10 minutes later yell "Huh?! WTF did this come from?!". Anyway my 2c - I myself use the unix.org.ua archives quite a bit, which does not prevent me from

Re: Uniq from array ?

2005-03-30 Thread JupiterHost.Net
As in free beer :) Thats mighty nice of you :) I like Guinness, I can send you my address off list :) Oh and I'd like you to do help on a project next week, 40 hours sound ok? I'll send the info you need so you can buy a plane ticket and get a hotel to come "share knowledge" for free... I appre

Re: Uniq from array ?

2005-03-30 Thread Chris Devers
On Wed, 30 Mar 2005, Michael Gale wrote: > Besides I am not sure where you are going with this ? Are you saying > that the content on the web page if pirated so I should not view it ? That's debatable, but you *definitely* shouldn't publicize it. > Information should be free, I believe all book

Re: Uniq from array ?

2005-03-30 Thread Michael Gale
Google returned the page from a search result, where it gets the pages from is not my fault. Besides I am not sure where you are going with this ? Are you saying that the content on the web page if pirated so I should not view it ? Information should be free, I believe all books and information

Re: Uniq from array ?

2005-03-30 Thread Alfred Vahau
Michael, I noted from your original posting that you quoted from a URL which is controversial in that the Perl-related books from O'Reilly are actually pirated copies. This was pointed out by one of the subscribers to this list in a recent thread. Alfred, Michael Gale wrote: Hello, I fi

Re: Uniq from array ?

2005-03-30 Thread Michael Gale
Hello, I fixed it, the string would initially contain special characters such as % signs. I strip out all the characters before the check, instead of after. Michael. On Wed, 2005-03-30 at 16:19 -0700, Michael Gale wrote: > Hello, > > I tried your example, it worked as expected,

Re: Uniq from array ?

2005-03-30 Thread Michael Gale
Hello, I tried your example, it worked as expected, here is the entire code: --snip-- my @servers; my $each_server; my $each_host; my %seen = ( ); print "List of systems being performance monitored\n"; print "Please select a host\n"; open

Re: Uniq from array ?

2005-03-30 Thread Offer Kaye
On Wed, 30 Mar 2005 15:53:25 -0700, Michael Gale wrote: > > But it is not working as expected, even if the array has the first three > entries the same, the function "show_host" gets called three time ? > > foreach $each_server(@servers) > { > unless ($see

Re: db handles with fork()

2005-03-30 Thread Felix Geerinckx
On 30/03/2005, Ramprasad A Padmanabhan wrote: >I am writing a perl application that connect to a database and then > does a fork() > The child completes the process and does a exit(), but the problem is > it closes the database connection which the parent would like to use. > > Can I exit the

Re: My own die message

2005-03-30 Thread Felix Geerinckx
On 30/03/2005, Ankur Gupta wrote: > I have the following code : > > eval{ > require "file" or die "unable to find file"; > }; > print "$@"; > > But it always prints "Can't locate file in @INC. blah blah " > > I want $@ to contain "unable to find file". What am I doing wrong or > it is not

Uniq from array ?

2005-03-30 Thread Michael Gale
Hello, I have using the following lines to run through an array (@servers) and run a function on each one. But I want to avoid running the function twice if an entry exist twice. I got the following from http://www.unix.org.ua/orelly/perl/cookbook/ch04_07.htm But it is not working as exp

Re: Simple encoding function

2005-03-30 Thread John W. Krahn
John W. Krahn wrote: Or if you really want to do it yourself: $ perl -le' my $num = 123456789; { my @digits = ( "a" .. "z", "A" .. "Z", 0 .. 9, "-", "_" ); sub fn { my $in = shift; my $res = ""; while ( $in ) { substr $res, 0, 0, $digits[ $in % @digits ];

RE: Need first line of Excel Spreadsheet

2005-03-30 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Alfred Vahau wrote: > The Spreadsheet::ParseExcel will dump all the worksheets one after the > other into one big file. Is this your observation. > The first line of the file will be the first row of worksheet 1. From > this the last column can be extracted which contains the > file name. > > If t

Re: Need first line of Excel Spreadsheet

2005-03-30 Thread Alfred Vahau
The Spreadsheet::ParseExcel will dump all the worksheets one after the other into one big file. Is this your observation. The first line of the file will be the first row of worksheet 1. From this the last column can be extracted which contains the file name. If the user still insists on the fil

RE: My own die message

2005-03-30 Thread Ankur Gupta
> -Original Message- > From: Offer Kaye [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 31, 2005 2:21 AM > To: Ankur Gupta; Perl Beginners > Subject: Re: My own die message > > On Thu, 31 Mar 2005 00:18:14 +0530, Ankur Gupta wrote: > > Hi, > > > > I have the following code : > > > > eval

Re: Simple encoding function

2005-03-30 Thread John W. Krahn
Ing. Branislav Gerzo wrote: Hi pals, Hello, I'd like to code my own encode function, I have @list of allowed characters, my input is number, and I'd like to 'convert' number to characters. Here is script I coded, but I'm sure it could be really better. This script should work, but there are too muc

Re: My own die message

2005-03-30 Thread Offer Kaye
On Thu, 31 Mar 2005 00:18:14 +0530, Ankur Gupta wrote: > Hi, > > I have the following code : > > eval{ > > require "file" or die "unable to find file"; > > }; > > print "$@"; > > But it always prints "Can't locate file in @INC. blah blah " > > I want $@ to contain "u

RE: Need first line of Excel Spreadsheet

2005-03-30 Thread Wagner, David --- Senior Programmer Analyst --- WGO
David Van Ginneken wrote: > This node may help you. > > http://www.perlmonks.org/index.pl?node_id=379743 > > Basically you create a custom cell handler. The one I use looks > something like this. David responded but only to me, but if you need to work with Excel and only need to search

RE: My own die message

2005-03-30 Thread Chris Devers
On Thu, 31 Mar 2005, Ankur Gupta wrote: > No I do not [want to] die so fast.. I want to do some processing based > on the died message. Fine then. eval { risky_action(); } if $@ { my $status = $@; my $result = do_some_processing(); die "Got $status,

RE: My own die message

2005-03-30 Thread Ankur Gupta
No I do not wanna die so fast.. I want to do some processing based on the died message. -- Ankur -Original Message- From: Todd de Gruyl [mailto:[EMAIL PROTECTED] Sent: Thursday, March 31, 2005 12:24 AM To: Ankur Gupta Cc: beginners@perl.org Subject: Re: My own die message On 03/30/2005

Re: My own die message

2005-03-30 Thread Todd de Gruyl
On 03/30/2005 01:48 PM, Ankur Gupta wrote: > eval{ > > require "file" or die "unable to find file"; > > }; > > print "$@"; > > > > But it always prints "Can't locate file in @INC. blah blah " If you actually want to die, try moving the die outside of the eval: eval { requir

My own die message

2005-03-30 Thread Ankur Gupta
Hi, I have the following code : eval{ require "file" or die "unable to find file"; }; print "$@"; But it always prints "Can't locate file in @INC. blah blah " I want $@ to contain "unable to find file". What am I doing wrong or it is not possible to overr

A strange solution to warnings about uninitialized variables

2005-03-30 Thread Walter A Poor Jr
This is my third note on this subject, and I hope no-one objects. My questions (and those of other members) were why perl sometimes claims some variables have not been initialized, even when direct investigation proves that the variables in fact have valid real values. Several people suggested

Re: Perl Vulnerablity

2005-03-30 Thread Kaysee Long
Do I have to install the AIX apar for this vulnerablity too(AIX 5.2 and 5.3) - or is it just the version that comes with precompiled with the OS? I have a version I compiled myself... thank you inadvance.Kaysee

Re: Need first line of Excel Spreadsheet

2005-03-30 Thread Offer Kaye
On Wed, 30 Mar 2005 09:04:23 -0800, Wagner, David --- Senior Programmer Analyst --- WGO wrote: > > Sorry for not being clear. I can find the files I want, but to open > them takes way too long. > On my test node, to open the four files and get the first line of worksheet 1 > took almo

Re: Perl Vulnerablity

2005-03-30 Thread Jay Savage
On Thu, 24 Mar 2005 14:21:32 -0500, Kaysee Long <[EMAIL PROTECTED]> wrote: > I have a question about something that was sent to me, I couldn't find > anything on the website (but it could be me): > > http://www.securityfocus.com/bid/12426 > > bugtraq id > 12426 > object >

RE: Need first line of Excel Spreadsheet

2005-03-30 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Kevin Old wrote: > On Tue, 29 Mar 2005 13:30:57 -0800, Wagner, David --- Senior > Programmer Analyst --- WGO <[EMAIL PROTECTED]> wrote: >> I have a directory which has output reports in them. The >> big problem is that they are just a bunch of letters and numbers >> like 2781424330fdac47c9

Re: Need first line of Excel Spreadsheet

2005-03-30 Thread Kevin Old
On Tue, 29 Mar 2005 13:30:57 -0800, Wagner, David --- Senior Programmer Analyst --- WGO <[EMAIL PROTECTED]> wrote: > I have a directory which has output reports in them. The big problem > is that they are just a bunch of letters and numbers like > 2781424330fdac47c916.xls. So the user w

Win32::Setupsup menu item enumeration

2005-03-30 Thread Peter Rabbitson
Hi everyone, I got stuck with the inability of Setupsup::EnumChildWindows or Setupsup::GetWindowProperties to generate a list of available choices in a regular menu (the one you get when you do 'open file' for example). I do not know a thing about MFC, and perl/windows integration is not as well do

Re: .pm and .pl files.

2005-03-30 Thread Chris Devers
On Wed, 30 Mar 2005, Randal L. Schwartz wrote: > > "Chris" == Chris Devers <[EMAIL PROTECTED]> writes: > > Chris> By convention, the .pm extension denotes Perl modules -- libraries > Chris> used by other scripts but not run directly -- and .pl denotes Perl > Chris> scripts -- programs that *

Re: [PBML] Finding index of given value in an array

2005-03-30 Thread Randal L. Schwartz
> "Offer" == Offer Kaye <[EMAIL PROTECTED]> writes: Offer> In this specific case I had no way to know what the OP has as data, Offer> numbers or strings, so I assumed the general case. No, the point here is that THERE IS NO GENERAL CASE. You either want numeric comparisons, or string compari

Re: .pm and .pl files.

2005-03-30 Thread Randal L. Schwartz
> "Chris" == Chris Devers <[EMAIL PROTECTED]> writes: Chris> By convention, the .pm extension denotes Perl modules -- libraries used Chris> by other scripts but not run directly -- and .pl denotes Perl scripts -- Chris> programs that *are* meant to be run directly. Not scripts. Libraries.

RE: db handles with fork()

2005-03-30 Thread Ramprasad A Padmanabhan
> I would strongly recommend you connect after the fork. Each process needs to > have its own connection. Thanks for the reply. Even I had thought so, probably for efficiency I can use dbi cached_connect Ram -- Netcore Solutions Pvt

RE: db handles with fork()

2005-03-30 Thread Bob Showalter
Ramprasad A Padmanabhan wrote: > Hi, >I am writing a perl application that connect to a database and then > does a fork() > The child completes the process and does a exit(), but the problem is > it closes the database connection which the parent would like to use. > > Can I exit the child pro

db handles with fork()

2005-03-30 Thread Ramprasad A Padmanabhan
Hi, I am writing a perl application that connect to a database and then does a fork() The child completes the process and does a exit(), but the problem is it closes the database connection which the parent would like to use. Can I exit the child process without disconnecting the parent dbi han

Simple encoding function

2005-03-30 Thread Ing. Branislav Gerzo
Hi pals, I'd like to code my own encode function, I have @list of allowed characters, my input is number, and I'd like to 'convert' number to characters. Here is script I coded, but I'm sure it could be really better. This script should work, but there are too much conditions and isn't so clear as

Re: General questions

2005-03-30 Thread Offer Kaye
On Wed, 30 Mar 2005 09:57:38 +0200, GR Kumaran wrote: > > 2. I used "use strict", and I get error for the statement > open(IN_FILE1, ">>test_records.txt"); > > Here the error is > Bareword "IN_FILE1" not allowed while "strict subs" in use > > But if I remove "use strict", the program works

General questions

2005-03-30 Thread GR Kumaran
Hello, 1. I read on many Perl/CGI tutorial/articles that it is best to place and use CGI files in /cgi-bin/ directory than anywhere else, due to avoid many problems. Buy in our website, we have several subdomain and those are all use the same /cgi-bin/ directory, so now there are a lot of files

Re: [PBML] Finding index of given value in an array

2005-03-30 Thread Offer Kaye
On 29 Mar 2005 10:19:09 -0800, Randal L. Schwartz wrote: > > No, you should change it only when appropriate. "35.0" is not eq to "35", > and yet they are numerically equal. > Dratz, foiled again! ;-) > I hope you don't write the rest of your code like that. :( > In this specific case I had n

Re: File::Find question?

2005-03-30 Thread Offer Kaye
On Tue, 29 Mar 2005 23:31:48 +0200 (CEST), Steven Schubiger wrote: > > print $File::Find::name, "\n" unless /\.txt^/; > No, that should be /\.txt$/ , not /\.txt^/ - you're using the wrong anchor. -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

Re: HTML parsing

2005-03-30 Thread FreeFall
I am new to Perl too and have a little try: #!/usr/bin/perl use warnings; use strict; my @data; while (<>) { chomp; push @data,$_ if !/^\ wrote: > Hi all, > > I'm brand new to Perl, and have just a little programming background. I was > tasked with parsing a set of .html

Re: .pm and .pl files.

2005-03-30 Thread John W. Krahn
Srikrishna Raghammudi wrote: Can Any body pls tell me the differnece between .pm and .pl files. .pl was used in Perl4 and earlier to designate Perl Libraries and when Perl5 came out .pm was used to designate Perl Modules. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PR