RE: Passing hashes as parameters to construct objects

2004-12-01 Thread Michael Kraus
Big thanks to Larry and Edward for their help. Regards, Michael S. E. Kraus Software Developer Wild Technology Pty Ltd ___ ABN 98 091 470 692 Level 4 Tiara, 306/9 Crystal Street, Waterloo NSW 2017, Australia Telephone 1300-13-9453 | Facsimile 1300-88-9453 http://www

Re: Passing hashes as parameters to construct objects

2004-12-01 Thread Edward Wijaya
On Thu, 02 Dec 2004 16:20:17 +1100, Michael Kraus <[EMAIL PROTECTED]> wrote: I've noticed a lot of modules can be initialised in the form: my $instance = Module->new( option => "value1", option2 => "value2" ) How is this implemented? Is the above simply passing a hash reference? Any function, in

Passing hashes as parameters to construct objects

2004-12-01 Thread Michael Kraus
G'day... I've noticed a lot of modules can be initialised in the form: my $instance = Module->new( option => "value1", option2 => "value2" ) How is this implemented? Is the above simply passing a hash reference? Is it something like: --- SNIP --- package Module; sub new { my $obclas

RE: Spam:Two classes sharing the same method

2004-12-01 Thread Michael Kraus
Hrmmm... Provided my own work-around for this... Comments more than welcome... --- SNIP --- package Second_Object; use First_Object; # ... code ... sub addServerError { my $self = shift; my $desc = shift; if ( $desc !~ /^$self:/ ) { $desc = "$s

Re: ftp script

2004-12-01 Thread JupiterHost.Net
Carl Johnson wrote: I'm very new to perl, can any share an example ftp script? I need to ftp from one server directory to another server to a directory I think Net::FTP has some examples, see search.cpan.org :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Sufficient effort

2004-12-01 Thread sentinel
JupiterHost.Net wrote: As a support person and coder I agree with Felix and Gunnar - *some* effort definately needs done or else we'll breed a bunch of clueless helpless leeches and spend our own precious time doing it. In other words its damaging to both OP and the replier. Rather when some re

ftp script

2004-12-01 Thread Carl Johnson
I'm very new to perl, can any share an example ftp script? I need to ftp from one server directory to another server to a directory Thanks C

Two classes sharing the same method

2004-12-01 Thread Michael Kraus
G'day all... I'm wanting two different classes to share the same error functionality. OK, rather than trying to talk aroud a lot of what I want to do I'll show you some code: ---SNIP--- package Error; sub new { my $class = shift; $class = ref $class || $class; my @error

Re: Spam:Re: CGI::Untaint [was: Running Perl ...]

2004-12-01 Thread Gunnar Hjalmarsson
Michael Kraus wrote: OK... My thoughts are this - checking out the module before casting judgement on it is a good thing(tm) :) Sure, but I hope I included enough of disclaimers... ;-) The module leaves validation up to the end user/programmer... It is simply a module of convenience. It does not bl

RE: Spam:Re: CGI::Untaint [was: Running Perl ...]

2004-12-01 Thread Michael Kraus
G'day... > Comments from others would be appreciated. Michael, what's > your thinking behind using CGI::Untaint? OK... My thoughts are this - checking out the module before casting judgement on it is a good thing(tm) :) The module leaves validation up to the end user/programmer... It is simply

Re: File Upload Using CGI

2004-12-01 Thread JupiterHost.Net
Sorry? How is foo( -name => $cgi->param("name"), -email => $cgi->param('email')); better than foo( -name => $query{name}, -email => $query{email}); ? Hey Jenda, I was referring to one of the questions about why people still want the hash like %IN and not paying much attention to th

Re: subroutine problem

2004-12-01 Thread Jonathan Paton
Dear Mike, Surprised you've been stumped for 3 hours, but sometimes the most obvious bugs are the hardest to find. In your code you have: ... &printSequence; foreach my $id (@list) { ... That function call is causing your problem. Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: File Upload Using CGI

2004-12-01 Thread Jenda Krynicky
From: "JupiterHost.Net" <[EMAIL PROTECTED]> > Charles K. Clarkson wrote: > > > Manas Kulkarni <[EMAIL PROTECTED]> wrote: > > > > : %in = $query->Vars; # get the form data into a hash > > : > > > >Arrgh! I have never understood the desire to immediately > > place all parameters in a hash. T

Re: Sufficient effort

2004-12-01 Thread Jenda Krynicky
From: Gunnar Hjalmarsson <[EMAIL PROTECTED]> > In another thread the list admin, Casey West wrote: > > Gunnar Hjalmarsson wrote: > >> there may or may not be volunteer programmers available who are > >> ready to provide such comprehensive answers to people who have > >> obviously

Re: Sufficient effort

2004-12-01 Thread JupiterHost.Net
Casey West wrote: It was Wednesday, December 01, 2004 when JupiterHost.Net took the soap box, saying: : I also agree that lazy posters should maybe be handled a bit less : harshly lest we become the qmail list ;p If anything this is my biggest complaint. : In the case being discussed the code po

subroutine problem

2004-12-01 Thread Michael Robeson
I have written a rather simplistic script so I can get used to LWP::Simple etc... Anyway I am using a subroutine to "get" and "print" data from a website. I have gotten it to work except for the fact that the first iteration of the subroutine "uses" no data at all, yet after that it works f

Re: Sufficient effort

2004-12-01 Thread Casey West
It was Wednesday, December 01, 2004 when JupiterHost.Net took the soap box, saying: : *That* (posting the "Here is my code that outputs this" that doesn't : even come close to compiling let alone having output and not due to : simple "missed the last colon" pasting mistakes) is not being : inn

Re: File Upload Using CGI

2004-12-01 Thread JupiterHost.Net
Manas Kulkarni wrote: OK. Advice taken. I have a moustache and I definitely don't wear diapers ;) Haha good one, lol ;) Thanks a lot, Manas. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Sufficient effort

2004-12-01 Thread JupiterHost.Net
I also agree that lazy posters should maybe be handled a bit less harshly lest we become the qmail list ;p I want to clarify, by "lazy" I don't mean uninformed. If someone doesn't now how to post to a list or where to look for documentation or what perl is let alone how to use it, thats fine, we

Re: Sufficient effort

2004-12-01 Thread Casey West
It was Wednesday, December 01, 2004 when JupiterHost.Net took the soap box, saying: : I also agree that lazy posters should maybe be handled a bit less : harshly lest we become the qmail list ;p If anything this is my biggest complaint. : In the case being discussed the code posted after it was

Re: File Upload Using CGI

2004-12-01 Thread Manas Kulkarni
OK. Advice taken. I have a moustache and I definitely don't wear diapers ;) Thanks a lot, Manas. Quoting "JupiterHost.Net" <[EMAIL PROTECTED]>: > > > Charles K. Clarkson wrote: > > > Manas Kulkarni <[EMAIL PROTECTED]> wrote: > > > > : %in = $query->Vars; # get the form data into a hash > >

Re: Sufficient effort

2004-12-01 Thread JupiterHost.Net
Felix Li wrote: What's wrong with demonstrating to your would be teacher that you are worthy of being taught? Either I'll do it for you to prevent you from learning anything or you make an effort. Having programmed for over thirty years, I side with Gunnar. As a support person and coder I agree wit

Re: Source Code Audit

2004-12-01 Thread Jonathan Paton
Joshua, Do you think it is the script, or the PSP/perl enviroment that is leaking memory? How serious is the memory leak? Are you using the latest perl? If it is your perl code that leaks (try a dummy script as a check) then the most likely cause is circular references or eval problems. On old

Re: Sufficient effort

2004-12-01 Thread Felix Li
What's wrong with demonstrating to your would be teacher that you are worthy of being taught? Either I'll do it for you to prevent you from learning anything or you make an effort. Having programmed for over thirty years, I side with Gunnar. Felix Li - Original Message - From: "Gunnar

Re: Source Code Audit

2004-12-01 Thread Casey West
It was Wednesday, December 01, 2004 when Joshua Berry took the soap box, saying: : Quite honestly, I am not much of a programmer so these modules (even : though they are simple) are a little over my head. The output is always : more cryptic than what I can understand. If this is the case I might

RE: Source Code Audit

2004-12-01 Thread Joshua Berry
Quite honestly, I am not much of a programmer so these modules (even though they are simple) are a little over my head. The output is always more cryptic than what I can understand. Thanks -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 01, 200

RE: Source Code Audit

2004-12-01 Thread Bob Showalter
Joshua Berry wrote: > Does anyone know somebody or some company that does Perl source code > auditing? I don't know personally. Perhaps you can get help here... > I have written a Perl Server application that is leaking > memory and cannot find the leak. There are some modules on CPAN that might

Re: Source Code Audit

2004-12-01 Thread James W. Thompson, II
http://www.secway.fr/services/source.php?PARAM=us https://sardonix.org/ I have no affiliation nor do I even give a rip about either of these but I turned them up on Google On Wed, 1 Dec 2004 15:55:58 -0600, Joshua Berry <[EMAIL PROTECTED]> wrote: > Does anyone know somebody or some company

Re: File Upload Using CGI

2004-12-01 Thread JupiterHost.Net
Charles K. Clarkson wrote: Manas Kulkarni <[EMAIL PROTECTED]> wrote: : %in = $query->Vars; # get the form data into a hash : : foreach $key(keys %in) { : if($key eq 'sequences') { : $file_data = $in{$key}; : } : } Arrgh! I have never understood the desire to immediately place all para

Source Code Audit

2004-12-01 Thread Joshua Berry
Does anyone know somebody or some company that does Perl source code auditing? I have written a Perl Server application that is leaking memory and cannot find the leak. Thanks, Josh Berry | CISSP GCIA Information Security 214-765-1296 --

RE: Sufficient effort

2004-12-01 Thread Adamiec, Larry
> -Original Message- > From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 01, 2004 15:45 > To: [EMAIL PROTECTED] > Subject: Sufficient effort > > > In another thread the list admin, Casey West wrote: > > Gunnar Hjalmarsson wrote: > >> there may or may not be

Sufficient effort

2004-12-01 Thread Gunnar Hjalmarsson
In another thread the list admin, Casey West wrote: Gunnar Hjalmarsson wrote: there may or may not be volunteer programmers available who are ready to provide such comprehensive answers to people who have obviously not made any efforts of their own. Posting a message to this list is considered suff

RE: File Upload Using CGI

2004-12-01 Thread Charles K. Clarkson
Manas Kulkarni <[EMAIL PROTECTED]> wrote: : %in = $query->Vars; # get the form data into a hash : : foreach $key(keys %in) { : if($key eq 'sequences') { : $file_data = $in{$key}; : } : } Arrgh! I have never understood the desire to immediately place all parameters in a hash. This

Re: File Upload Using CGI

2004-12-01 Thread Jonathan Paton
Dear Manas, Use the CGI module, which provides a upload() method. In fact, I googled about for a tutorial that didn't use perl 4's cgi-lib module. Read: http://www.sitepoint.com/article/uploading-files-cgi-perl Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman

Addition to doubt: File Upload using CGI

2004-12-01 Thread Manas Kulkarni
Hi, I made a slight mistake in my previous post. I am not getting the key value, I am getting the name of the file instead(not the absolute path). Thanks, Manas. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

File Upload Using CGI

2004-12-01 Thread Manas Kulkarni
Hey All ! I know this is not the place to ask cgi doubts but since cgi is just a small part of my work, I had subscribed to only this list. Anyways, I am writing a perl-cgi script which will accept a file from the user through an HTML form and the script will write this file on the server side. Th

Re: [ADMIN] Re: Reading external file. Open files from listing and do a searc h and replace then continue...

2004-12-01 Thread Casey West
It was Wednesday, December 01, 2004 when Gunnar Hjalmarsson took the soap box, saying: : Casey West wrote: : >It was Wednesday, December 01, 2004 when Gunnar Hjalmarsson took the : >soap box, saying: : >>What do you refer to as "the original question"? To me it's this: : >>http://www.mail-archive.

Re: [ADMIN] Re: Reading external file. Open files from listing and do a searc h and replace then continue...

2004-12-01 Thread Gunnar Hjalmarsson
Casey West wrote: It was Wednesday, December 01, 2004 when Gunnar Hjalmarsson took the soap box, saying: Casey West wrote: The original question was places squarely within reasonable query boundaries. What do you refer to as "the original question"? To me it's this: http://www.mail-archive.com/begi

Re: [ADMIN] Re: Reading external file. Open files from listing and do a searc h and replace then continue...

2004-12-01 Thread Casey West
It was Wednesday, December 01, 2004 when Gunnar Hjalmarsson took the soap box, saying: : Casey West wrote: : >The original question was places squarely within reasonable query : >boundaries. : : What do you refer to as "the original question"? To me it's this: : http://www.mail-archive.com/beginn

Re: [ADMIN] Re: Reading external file. Open files from listing and do a searc h and replace then continue...

2004-12-01 Thread Gunnar Hjalmarsson
Casey West wrote: The original question was places squarely within reasonable query boundaries. What do you refer to as "the original question"? To me it's this: http://www.mail-archive.com/beginners%40perl.org/msg64453.html -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To

[ADMIN] Re: Reading external file. Open files from listing and do a searc h and replace then continue...

2004-12-01 Thread Casey West
It was Tuesday, November 30, 2004 when Bob Showalter took the soap box, saying: : Chris Devers wrote: : > On Tue, 30 Nov 2004, FlashMX wrote: : > : > > Yea...ok fine...Whats the purpose of this "beginners" list anyway. : > > : > > To put it bluntly Gunnar. Your attitude sucks! : > : > We're here

Re: Reading external file. Open files from listing and do a search and replace then continue...

2004-12-01 Thread Gunnar Hjalmarsson
Lawrence Statton wrote: while I respect Gunnar's point of view, and his skill - sometimes his bedside manner is suboptimum. Perhaps instead of taking every opportunity to castigate someone for malusing the list, we can be a little more politic -- ask more questions. sometimes a beginner is just #

YPM::Yapp module question

2004-12-01 Thread radhika sambamurti
Hi, I have a need to work with a perl script that uses quite a few YPM modules. YPM::Yapp and so on. When I do perldoc YPM::Yapp, the module referes to YPM scripts. What does this mean? Thanks. Radhika -- It's all a matter of perspective. You can choose your view by choosing where to stand. Larr

Re: Reading external file. Open files from listing and do a search and replace then continue...

2004-12-01 Thread Chap Harrison
On Nov 30, 2004, at 7:19 PM, Lawrence Statton wrote: So, in the spirit of Holiday Blessings and Peace on Earth, Goodwill Toward Man that is tradition between November and January, when we can get back to our regularly scheduled program of hatred and global domination, let's declare it Be Kind To C

Re: Regex Unicode Bug?

2004-12-01 Thread Jonathan Paton
With: use strict; use warnings; use utf8; use Encode qw/is_utf8 decode/; my $junktext = "\x{0142}\x{e7}\x{263a}\x{0104}\x{263a}\x{0104}re\x{e7}enu\x{263a}"; my $matches = ($junktext =~ s/(\x{263a})/* was smily */gi); print $matches . " = " . $junktext; On 5.8.3 I get: Wide character in print

Re: Reg. Associative array in perl

2004-12-01 Thread Randal L. Schwartz
> "Owen" == Owen Cook <[EMAIL PROTECTED]> writes: Owen> Well that's the way hashes work. If you have a recent version of Perl, at Owen> least the order will be the same different order each time you run the Owen> program. Actually, that's exactly backwards. :) On recent versions of Perl, the

Re: sorting with Swartz Transform

2004-12-01 Thread Randal L. Schwartz
> "John" == John W Krahn <[EMAIL PROTECTED]> writes: John> But of course I knew that! :-) John> I should have said "but it doesn't beat the Guttman Rosler John> Transform for speed." Yes. The ST can sort any multilevel complex sort, and is "programmer efficient". When the GRT *can* be used

Regex Unicode Bug?

2004-12-01 Thread angie ahl
Hi list. I wonder in anyone would mind confirming this for me: I've just spotted a strange behaviour with unicode and regex in perl 5.8.1 as documented in the following script. $junktext is a string of unicode characters containing 3 smilys. 1 smily is at the end of the string. when doing a reg

Re: pdf 2 bmp

2004-12-01 Thread Joshua Colson
PDF is not a set of images. It is precisely typeset text (optionally with images embedded). That being said, I'm not sure of how you could convert a pdf to bmp or if it can be done with perl. However, I think that I've heard you can do those sort of things with ghostscript (if you're using GNU/Linu

Re: Making hash from two arrays

2004-12-01 Thread Jonathan Paton
Dear Sean, Hash Slice (only reminded of this the other day). Example code: use strict; use warnings; my @first = 'A' .. 'Z'; my @second = 'a' .. 'z'; my %hash; @[EMAIL PROTECTED] = @second; use Data::Dumper; print Dumper(\%hash); __END__ Not a particularly "beginner" way to do it though.

Re: Reading external file. Open files from listing and do a search and replace then continue...

2004-12-01 Thread Lawrence Statton
> > Got it so far. > > open CHECKFILE, "< file.in" or die qq(Cannot open file "file.in": $!); > @filecontent = ; > foreach $line (@filecontent) { > print " $line"; > } > close (INFILE); > > > The input file (list of files) looks something like this: > > P: 1

Re: Reading external file. Open files from listing and do a search and replace then continue...

2004-12-01 Thread Lawrence Statton
> > Sure...if I know someone can do the job. I'll just go to rentacoder.com > > I'd be more than happy to consult for your Perl needs, send me an email > off list if you're interested. > > >>If not, "steal it from the market" might be more apt. > > > > > > So you don't take examples you find o

Re: Search Tab-delimited file for Null fields

2004-12-01 Thread Lawrence Statton
John Krahn wrote: > Debbie Cooper wrote: > > my @empty = (); > > my @headings = (); > > Aggregate variables created with my() are empty by default so assigning an > empty list to them is redundant. > I hope I am not opening a can of worms by getting into a style disucssion, and I will preface t

Making hash from two arrays

2004-12-01 Thread Sean Davis
I have two arrays of equal length and I would like to make a hash using one array as the keys and one as the values. Is there a simpler way of doing this besides making a loop and counter variable? Thanks, Sean -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: CGI::Untaint [was: Running Perl ...]

2004-12-01 Thread Gunnar Hjalmarsson
JupiterHost.Net wrote: I think, CGI::Validate would have been a better name since it describes what its supposed to be doing better and if it happens to untaint data in the process so be it. You have a point there. If the module enforces validation of form data, it does a good thing. All too man

Re: CGI::Untaint [was: Running Perl ...]

2004-12-01 Thread JupiterHost.Net
JupiterHost.Net wrote: Gunnar Hjalmarsson wrote: Michael Kraus wrote: now I'm wondering what others on this list would recommend regarding CGI::Untaint(?). :) While thinking about this again, one reason I'm not sure I like it is it sounds like more a pragma like use streict; no strict; It *seem

Using SOAP,stubmaker

2004-12-01 Thread E.Horn
Hi! Has one of you experience with SOAP? And can someone tell me what stubmaker does? Regards -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Checking if a scalar value is a number or not

2004-12-01 Thread Ramprasad A Padmanabhan
On Wed, 2004-12-01 at 19:04, Bob Showalter wrote: > Ing. Branislav Gerzo wrote: > > Mat Harris [MH], on Wednesday, December 1, 2004 at 12:19 (+) > > contributed this to our collective wisdom: > > > > > > Is there any special function for that job? > > > > > personally I would use a rexex: > >

RE: Search Tab-delimited file for Null fields

2004-12-01 Thread Debbie Cooper
You probably don't appreciate the fact that I'm including the prior message in this latest email. But I want to let you all know how much stuff like this helps someone like me who's learning Perl. To understand how my code could be more efficient is a great learning tool. I can look up things in

Re: Checking if a scalar value is a number or not

2004-12-01 Thread Ing. Branislav Gerzo
Bob Showalter [BS], on Wednesday, December 1, 2004 at 08:34 (-0500 ) wrote these comments: >> if ($myunknownvalue =~ m/^\d+$/) BS> Your regex matches the string "123\n", if it matters. I think, it is good, and 99% users expect that, even they don't know that. -- ...m8s, cu l8r, Brano. [Dave.

RE: Checking if a scalar value is a number or not

2004-12-01 Thread Bob Showalter
Ing. Branislav Gerzo wrote: > Mat Harris [MH], on Wednesday, December 1, 2004 at 12:19 (+) > contributed this to our collective wisdom: > > > > Is there any special function for that job? > > > personally I would use a rexex: > > if ($myunknownvalue =~ m/^\d*$/) > > personally I would change

Re: Checking if a scalar value is a number or not

2004-12-01 Thread Paul Johnson
On Wed, Dec 01, 2004 at 02:00:49PM +0100, Ing. Branislav Gerzo wrote: > Mat Harris [MH], on Wednesday, December 1, 2004 at 12:19 (+) > contributed this to our collective wisdom: > > >> Is there any special function for that job? > > MH> personally I would use a rexex: > MH> if ($myunknownval

RE: Checking if a scalar value is a number or not

2004-12-01 Thread Bob Showalter
John wrote: > Hello > > Is there any special function for that job? See the FAQ article: perldoc -q 'is a number' -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Checking if a scalar value is a number or not

2004-12-01 Thread Mat Harris
On Wed, Dec 01, 2004 at 02:00:49PM +0100, Ing. Branislav Gerzo wrote: > Mat Harris [MH], on Wednesday, December 1, 2004 at 12:19 (+) > contributed this to our collective wisdom: > > >> Is there any special function for that job? > > MH> personally I would use a rexex: > MH> if ($myunknownvalu

Re: Checking if a scalar value is a number or not

2004-12-01 Thread Ing. Branislav Gerzo
Mat Harris [MH], on Wednesday, December 1, 2004 at 12:19 (+) contributed this to our collective wisdom: >> Is there any special function for that job? MH> personally I would use a rexex: MH> if ($myunknownvalue =~ m/^\d*$/) personally I would change this regex to: if ($myunknownvalue =~ m/^\

Re: Checking if a scalar value is a number or not

2004-12-01 Thread Mat Harris
On Wed, Dec 01, 2004 at 02:12:58 +0200, John wrote: > Hello > > Is there any special function for that job? personally I would use a rexex: if ($myunknownvalue =~ m/^\d*$/) { print "this is a number\n"; } else { print "this is some crap\n"; } hope this helps mat -- Cats land

Checking if a scalar value is a number or not

2004-12-01 Thread John
Hello Is there any special function for that job?

Shutdown gateway socket: Transport endpoint is not connected

2004-12-01 Thread ds10025
Morning I'm getting above error in the error log. Could some help in explaining how and & why? Below is the code that generate it. I see: # Done writing. # $gateway->shutdown( 1 ); shutdown( $gateway, 1 ) # IO::Socket::INET is broken in Perl 5.005? or return $self->log( 4, "Shut

pdf 2 bmp

2004-12-01 Thread John
Has anyone know how to do that task? It think that is quite easy as far as pdf is a set of images.

Re: Reg. Associative array in perl

2004-12-01 Thread Owen Cook
On Wed, 1 Dec 2004, Owen Cook wrote: I meant to say > Well that's the way hashes work. If you have a recent version of Perl, at least the order will be the same different order each time you run the program. Owen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: Reg. Associative array in perl

2004-12-01 Thread Owen Cook
On 1 Dec 2004, Prabahar Mosas wrote: Please check the below coding because I actually expect one output but this code print unpredictable output. I expect the following output. Apache Windows Dos Linux Unix Solaris But Machine giving output is below