References and subroutine ?

2005-04-22 Thread Michael Gale
Hello, I have an array and I would like to pass it to a subroutine: &printlist([EMAIL PROTECTED]); sub printlist { my $array_ref = (shift); my $max; my $maxnew = @{$array_ref}; for(my $i=0;$i < $maxnew; $i++){ print "\t\t\t\t\t";

RE: References and subroutine ?

2005-04-22 Thread Charles K. Clarkson
Michael Gale wrote: : I am passing the reference of an to the subroutine, which using : (shift) assigns the first scaler to my scaler array_ref. So now : array_ref scaler is equal to the passed scaler allowing me to use : array_ref as a reference. : : Correct ? Ye

How to add my own start method to existing HTML::Parser class to Scrape Screens?

2005-04-22 Thread Siegfried Heintze
I'm trying to screen scape some information off the web. I anticipate that I'll want to have it multi-threaded. As per Lincoln Stein's book, I'm using HTML::Parser and passing a function pointer (you can tell I'm a C programmer) to $parser->handler(start=> \&start, 'self,tagname, attr,text,skipp

Sort array by value length ?

2005-04-22 Thread Michael Gale
Hello, I have an array of names and would like to sort the array by the length of the name but am having difficulty. Any suggestions ? I tried creating two arrays, one with the names and another with the length values, then sorting the length values but found it difficult to print them out. M

Starting Template for calling C from Perl

2005-04-22 Thread Siegfried Heintze
I was looking at "Programming Perl" trying to understand how to write OS vendor neutral C functions to be called by perl and felt a little overwhelmed (as usual when reading that book). Can someone recommend a template that works with windows/MSVC/nmake or Cygwin/GCC/make (unix clone for windows p

RE: Starting Template for calling C from Perl

2005-04-22 Thread Siegfried Heintze
T, We presently implement some very proprietary algorithms on our web site that implements case management for trial lawyers. I am anticipating that some of our customers will find a remote web site to be a security problem -- even with SSL. (I think SSL will be two slow for us). I anticipate that

Re: Starting Template for calling C from Perl

2005-04-22 Thread toolscripts
I don't think there are any such examples besides the manual. There are generally clear warnings as to why not to try to do the c code from scratch. Either work with the xs system directly, or try http://www.swig.org which has good and bad sides to it. If you described the problem you're having I c

Re: Sort array by value length ?

2005-04-22 Thread John W. Krahn
Michael Gale wrote: Hello, Hello, I have an array of names and would like to sort the array by the length of the name but am having difficulty. Any suggestions ? $ perl -le' my @names = qw/ zero one two three four five six seven eight nine /; print "@names"; my @sorted_names = sort @names; print

RE: Sort array by value length ?

2005-04-22 Thread Ankur Gupta
> Hello, Hi, > I have an array of names and would like to sort the array by > the length of the name but am having difficulty. > > Any suggestions ? if you want to sort in ascending order @sorted = sort { length($a) <=> length($b) } @unsorted; or if in descending order @sorted = sort { le

Re: GetOpt::Long

2005-04-22 Thread John Doe
Hi Wim > Hi Bob, > > You gave me the following answer earlier: > >sub foo { > > local @ARGV = @_; > GetOptions(...blah...); > > ... >} > > If I run it as a seperate script, commenting out the (local @ARGV = @_;) > line, then it works. But it does not work when called as

Re: Comparing results of type unknown

2005-04-22 Thread Chris Devers
On Fri, 22 Apr 2005, Manish Sapariya wrote: > I want to compare the two rows of db result returned by > query using DBI module. > > If I simply use != operator it gives me error when comparing > the columns which are of char type. > > Does there exist anyway wherein I can do one liner compare >

Comparing results of type unknown

2005-04-22 Thread Manish Sapariya
Hi List, I want to compare the two rows of db result returned by query using DBI module. If I simply use != operator it gives me error when comparing the columns which are of char type. Does there exist anyway wherein I can do one liner compare irrespective of data types? OR checking the column nam

Oracle function call

2005-04-22 Thread Bedanta Bordoloi, Gurgaon
Disclaimer: This message and any attachment(s) contained here are information that is confidential, proprietary to HCL Technologies and its customers. Contents may be privileged or otherwise protected by law. The information is solely intended for the individual or the entity it is addresse

function call from shell script

2005-04-22 Thread Bedanta Bordoloi, Gurgaon
Disclaimer: This message and any attachment(s) contained here are information that is confidential, proprietary to HCL Technologies and its customers. Contents may be privileged or otherwise protected by law. The information is solely intended for the individual or the entity it is addresse

Re: using reference to the fetched rows

2005-04-22 Thread Manish Sapariya
Should have read perldoc DBI Note that the same array reference is returned for each fetch, so don't store the reference and then use it after a later fetch. Also, the elements of the array are also reused for each row, so take care if you want to take a refer

using reference to the fetched rows

2005-04-22 Thread Manish Sapariya
Hi list, When using DBI module as, my $return_list = $sth->fetchrow_arrayref; Can I copy the reference to some other variable say, e.g. my $CopyOfResult = $return_list; and do another query using the same handle and use $CopyOfResult and $return_list? My question is how does perl will release the m

Re: Script that spans multiple files

2005-04-22 Thread M. Kristall
Charles K. Clarkson wrote: Daniel Kasak wrote: : : I have a large script ( 6000 lines ) that I'd like to break into : logical units. Is there a way I can tell perl to 'append' a list : of files into 1 script so that I can call subs from any of the : files and have them t