Re: Making Image::Magick against a specific ImageMagick installation path

2006-02-20 Thread Alan_C
On Monday 20 February 2006 11:47, JupiterHost.Net wrote: > [EMAIL PROTECTED] wrote: > > On Friday 17 February 2006 10:25, JupiterHost.Net wrote: > >>Howdy list, Hi. [ . . ] > The question is if I buile Image Magick (the system library part of it) > with --prefix, how do I tell the Image::magick in

Re: Error in the "if" block

2006-02-20 Thread Chas Owens
On 2/20/06, John W. Krahn <[EMAIL PROTECTED]> wrote: snip > my ( $smallestNum, $largestNum ) = ( sort { $a <=> $b } @numbers )[ 0, -1 ]; > > Although as I said, the for loop is more efficient. snip Ah this old chestnut. Depending on the size of the array sort is faster (after 200 or so items for

Re: globals and modules

2006-02-20 Thread The Ghost
But that's seems like a lot of extra typing: Then in any part of your code where you use the database handle you can say sub foo { my ($foo, $bar) = @_; my $dbh = Project::DB::Handle->new; my $sth = $dbh->prepare(...); I started out with an HTML::Mason where I've shared $dbh via

Re: bug or am I not understanding?

2006-02-20 Thread Tom Phoenix
On 2/20/06, Bowen, Bruce <[EMAIL PROTECTED]> wrote: > Would $a = index($state, /\n); then be the correct format to find the end of > the line or a carriage return? Because that gives errors. I'm getting the > impression you can use \n with some commands and not others. Just > that it doesn't se

Re: bug or am I not understanding?

2006-02-20 Thread Chas Owens
On 2/20/06, Bowen, Bruce <[EMAIL PROTECTED]> wrote: snip > Would $a = index($state, /\n); then be the correct format to find the end of > the line > or a carriage return? Because that gives errors. I'm getting the impression > you can > use \n with some commands and not others. Just that it do

RE: bug or am I not understanding?

2006-02-20 Thread Bowen, Bruce
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Tom Phoenix Sent: Monday, February 20, 2006 10:50 PM To: Bowen, Bruce Cc: beginners@perl.org Subject: Re: bug or am I not understanding? On 2/20/06, Bowen, Bruce <[EMAIL PROTECTED]> wrote: > My question to t

Re: bug or am I not understanding?

2006-02-20 Thread Tom Phoenix
On 2/20/06, Bowen, Bruce <[EMAIL PROTECTED]> wrote: > My question to the group is why would this line recognize that carriage > return. > @lines = split /\n/, ; > and this not recognize the same character; > $a = index($state, "/\n"); The second parameter you're passing to index() is a two-ch

bug or am I not understanding?

2006-02-20 Thread Bowen, Bruce
I have posted question related to this before and have received many suggestions. I have a file of varying number of records of varying lengths, delimited by comas. 022,D,092,000,004,034,000,001,000,000 023,D,031,000,000,000,000,002,000,000 024,@D ,025,000,001,900,900,093,093,900,255,065,000,2

Re: Error in the "if" block

2006-02-20 Thread Ron Smith
> > Sorry, my mistake, that should really be: > > my ( $smallestNum, $largestNum ) = ( sort { $a <=> > $b } @numbers )[ 0, -1 ]; > > Although as I said, the for loop is more efficient. > It just amazes me as to how *flexable* Perl is. Ron Smith [EMAIL PROTECTED] -- To unsubscribe, e-mail:

Re: Error in the "if" block

2006-02-20 Thread Ron Smith
> > Sorry, my mistake, that should really be: > > my ( $smallestNum, $largestNum ) = ( sort { $a <=> > $b } @numbers )[ 0, -1 ]; > > Although as I said, the for loop is more efficient. > I just amazes me as to how *flexable* Perl is. Ron Smith [EMAIL PROTECTED] -- To unsubscribe, e-mail: [

Re: sharing amongst subroutines

2006-02-20 Thread Jeff Pang
>I can do this using "our" in place of "my" - after perl 5.6. hello,even you use 'my' instead of 'our',there is not any problem. where in some a subroutine, you use lexical var which is defined outside of this subroutine,you have made a closure.this var in subroutine is a private copy of lexic

Re: Manipulate graphics with Perl

2006-02-20 Thread Ryan
Truth. In an effort to be brief: I warn for the platform independant module designer. The lack of simplicity I mention is due to the fact ImageMagick isn't a pure-perl module that you can just stick in to your scripts list of dependancies. The complexity stems from image formats, core manipu

Re: sharing amongst subroutines

2006-02-20 Thread The Ghost
I can do this using "our" in place of "my" - after perl 5.6. how do I: { package ThePackage; use strict; my $dbh=$HTML::Mason::Commands::dbh; sub printdbh { print "$dbh\n"; } sub otherSub { print ref $dbh, "\n"; }

sharing amongst subroutines

2006-02-20 Thread The Ghost
how do I: { package ThePackage; use strict; my $dbh=$HTML::Mason::Commands::dbh; sub printdbh { print "$dbh\n"; } sub otherSub { print ref $dbh, "\n"; } sub anotherSub { dosomething($dbh);} } Thanks again

Re: Net::Server

2006-02-20 Thread Tom Allison
Beau E. Cox wrote: On Monday 20 February 2006 10:06, Tom Allison wrote: package AuthServer; @ISA = qw[Net::Server]; my $server = bless { port => 8081, }, 'AuthServer'; $server->run(); No. This _works_: package AuthServer; use Net::Server; @ISA = qw[Net::Server]; AuthServer->run( po

Re: globals and modules

2006-02-20 Thread Chas Owens
On 2/20/06, The Ghost <[EMAIL PROTECTED]> wrote: > I have defined $dbh (a database handle) as a global variable. I have > a module, RD, that needs access to the database. How can I use $dbh > within the RD module? > The best way to handle this is to create a singleton object to hold the database

Re: array getting scalar value

2006-02-20 Thread The Ghost
Actually, it was some of HTML::Mason's caching. So I'd get inconsistent results. Anyway, thanks for the replies! Ryan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: array getting scalar value

2006-02-20 Thread Tom Phoenix
On 2/20/06, The Ghost <[EMAIL PROTECTED]> wrote: > my @columns = @{$self->{columns}}; > foreach (@{$self->{columns}}) {print qq{self->col: $_\n};} # prints > the 3 columns > foreach (@columns) {print qq{col: $_\n};} #prints 3 > > Why? I can't say why your code does anything unexpected for you; it

Re: array getting scalar value

2006-02-20 Thread JupiterHost.Net
The Ghost wrote: my @columns = @{$self->{columns}}; foreach (@{$self->{columns}}) {print qq{self->col: $_\n};} # prints the 3 columns foreach (@columns) {print qq{col: $_\n};} #prints 3 Why? Well, it must be some magic with $self because Perl does not indeed act the way you've described

Re: Manipulate graphics with Perl

2006-02-20 Thread JupiterHost.Net
Ryan wrote: See the Perl interface of ImageMagick at: http://www.imagemagick.org/script/api.php#perl (Warning, not exactly simple) Really? I've found its quite easy as long as you follow best practices (Damian Conway) so that you can read your code later. Fiddling with images is of

Re: Net::Server

2006-02-20 Thread Beau E. Cox
On Monday 20 February 2006 10:29, Beau E. Cox wrote: > On Monday 20 February 2006 10:06, Tom Allison wrote: > > package AuthServer; > > > > @ISA = qw[Net::Server]; > > > > my $server = bless { > >   port  => 8081, > >   }, 'AuthServer'; > > > > $server->run(); > > No. This _works_: > > package Auth

Re: Net::Server

2006-02-20 Thread Beau E. Cox
On Monday 20 February 2006 10:06, Tom Allison wrote: > package AuthServer; > > @ISA = qw[Net::Server]; > > my $server = bless { >   port  => 8081, >   }, 'AuthServer'; > > $server->run(); No. This _works_: package AuthServer; use Net::Server; @ISA = qw[Net::Server]; AuthServer->run( port => 80

Re: Manipulate graphics with Perl

2006-02-20 Thread Ryan
See the Perl interface of ImageMagick at: http://www.imagemagick.org/script/api.php#perl (Warning, not exactly simple) Scott wrote: I need to be able to take an image and break it down in to smaller blocks. This would be used to create an HTML page of smaller images together displaying the

Re: Net::Server

2006-02-20 Thread Tom Phoenix
On 2/20/06, Beau E. Cox <[EMAIL PROTECTED]> wrote: > Net::Server works fine for me. I suggest you specify a log file and set > log-level to the 'debug' value (see the docs). >From my reading of the docs, what the code in the original posting was doing seems to be the way to do the key part of wha

Re: Manipulate graphics with Perl

2006-02-20 Thread JupiterHost.Net
Scott wrote: I need to be able to take an image and break it down in to smaller blocks. This would be used to create an HTML page of smaller images together displaying the large image as a whole, basically like the slice tool in Adobe. I was wondering if there was a way Perl could do this? If

array getting scalar value

2006-02-20 Thread The Ghost
my @columns = @{$self->{columns}}; foreach (@{$self->{columns}}) {print qq{self->col: $_\n};} # prints the 3 columns foreach (@columns) {print qq{col: $_\n};} #prints 3 Why? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Manipulate graphics with Perl

2006-02-20 Thread Scott
I need to be able to take an image and break it down in to smaller blocks. This would be used to create an HTML page of smaller images together displaying the large image as a whole, basically like the slice tool in Adobe. I was wondering if there was a way Perl could do this? If so can someone poi

Re: Net::Server

2006-02-20 Thread Tom Allison
On 2/20/2006, "Beau E. Cox" <[EMAIL PROTECTED]> wrote: >On Sunday 19 February 2006 13:52, Tom Phoenix wrote: >> On 2/18/06, Tom Allison <[EMAIL PROTECTED]> wrote: >> > I am trying to set up a server using Net::Server. >> >> I believe that you omitted a vital piece at the top of your code: a >> pa

Re: Net::Server

2006-02-20 Thread Beau E. Cox
On Sunday 19 February 2006 13:52, Tom Phoenix wrote: > On 2/18/06, Tom Allison <[EMAIL PROTECTED]> wrote: > > I am trying to set up a server using Net::Server. > > I believe that you omitted a vital piece at the top of your code: a > package directive. > > package AuthServer; > > Without that,

Re: FW: Reading a Unicode text file

2006-02-20 Thread Tom Phoenix
On 2/17/06, Baskaran Sankaran <[EMAIL PROTECTED]> wrote: > File: Sample_Hin.txt > > दूसरे राज्य पुनर्गठन आयोग के गठन का यही सही वक्त है। > The sample files were created in Windows in Unicode (both English & Hindi) > and I am able to open then in notepad and wordpad. But, the output as you > see i

Re: Making Image::Magick against a specific ImageMagick installation path

2006-02-20 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: On Friday 17 February 2006 10:25, JupiterHost.Net wrote: Howdy list, When installign Image::Magick you do this: perl Makefile.PL make make install How do I tell it the path that ImageMagick is installed in sot hat its get built agianst them specifically? The docs

Re: globals and modules

2006-02-20 Thread Tom Phoenix
On 2/20/06, The Ghost <[EMAIL PROTECTED]> wrote: > I have defined $dbh (a database handle) as a global variable. I have > a module, RD, that needs access to the database. How can I use $dbh > within the RD module? Every global variable is in some package, in perl. If you haven't used a package

globals and modules

2006-02-20 Thread The Ghost
I have defined $dbh (a database handle) as a global variable. I have a module, RD, that needs access to the database. How can I use $dbh within the RD module? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Matrix Average code / Module Avaialable ?

2006-02-20 Thread Shiping Wang
Hi At 01:08 AM 2/20/2006, I BioKid wrote: Dear All, Is there any program/module to calculate matrix average How about: #!/usr/bin/perl use warnings; use strict; my @sum; while(){ chomp; my @line = split; my $line_avg; for(@line){ $line_avg +=

Re: PERL BOOKS for EDA??

2006-02-20 Thread Paul Johnson
On Mon, Feb 20, 2006 at 08:37:07PM +0530, KARTHY RAJENDRAN wrote: > hi > iam karthy, >which is the best e-book to learn perl, iam working in verilog, is there > any PERL book specifically written for EDA ..( PERL for EDA ) I'm not aware of one. What would you expect such a book to cover?

PERL BOOKS for EDA??

2006-02-20 Thread KARTHY RAJENDRAN
hi iam karthy, which is the best e-book to learn perl, iam working in verilog, is there any PERL book specifically written for EDA ..( PERL for EDA ) kindly reply me have a nice day bye

Re: User define switch

2006-02-20 Thread Matt Johnson
Andrej Kastrin wrote: > Dear all, > > Is there any simple way to add user defined switches in Perl. I want > someting like that: > > perl --filein MyInputFileName --fileout MyOutputFileName ##in command line > > With --filein switch I want to define file, which will be read as the > input and w

User define switch

2006-02-20 Thread Andrej Kastrin
Dear all, Is there any simple way to add user defined switches in Perl. I want someting like that: perl --filein MyInputFileName --fileout MyOutputFileName ##in command line With --filein switch I want to define file, which will be read as the input and with the --fileout the output file.

Radius CPAN Modules

2006-02-20 Thread Chris Knipe
Hi, Is there any modules that supports Radius Disconnect type messages (RFC3576). Spend some extensive time going through what's available on CPAN, but I haven't found anything that supports Disconnect Messages Did I miss anything, or is radclient my only option?? :( Thanks, Chris

Re: regular expression

2006-02-20 Thread Jeff Pang
>is there a better way to do this: > if ($line =~ /(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/o) I think,at least,the 'o' option is not needed here.because your express didn't include any variable. -- Jeff Pang NetEase AntiSpam Team http://corp.netease.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: regular expression

2006-02-20 Thread John W. Krahn
itzik brown wrote: > Hi, Hello, > is there a better way to do this: > if ($line =~ /(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/o) Yes. if ($line =~ /(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/) John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

regular expression

2006-02-20 Thread itzik brown
Hi, is there a better way to do this: if ($line =~ /(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/o) tnx, itzik

Re: Error in the "if" block

2006-02-20 Thread John W. Krahn
Ron Smith wrote: > --- "John W. Krahn" <[EMAIL PROTECTED]> wrote: >> >>But since you are sorting numbers, you probably want >>to do a numeric sort to >>get the correct numbers: >> >>my ( $smallestNum, $largestNum ) = sort { $a <=> $b >>} @numbers; >> > I'm using: my @sorted = sort { $a <=> $b } @nu

Re: IP Number/ IP Address Array

2006-02-20 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > Greetings, Hello, > I need to convert the first column of a list of IP numbers to IP > addresses. I created an array of my list but am stumped on how to > convert the numbers. > > File: > 180884576 imstrmcs05 > 180884577 imstrmcs06 > 180884578 imstrm

Re: dual core cpu

2006-02-20 Thread Ken Perl
If I run modperl2 program, anything special I need to take care? I don't know if the modperl program will benefit from the new cpu technique? On 2/20/06, Rob Coops <[EMAIL PROTECTED]> wrote: > The awnser is a little more complicated than yes or no... > - Does your compiler support dual core? (the

RE: IP Number/ IP Address Array

2006-02-20 Thread Thomas Bätzler
<[EMAIL PROTECTED]> asked: > I need to convert the first column of a list of IP numbers to > IP addresses. I created an array of my list but am stumped > on how to convert the numbers. #!/usr/bin/perl use strict; use warnings; use Socket; sub number_to_ip { return( inet_ntoa( pack( 'N', $

Re: dual core cpu

2006-02-20 Thread Rob Coops
The awnser is a little more complicated than yes or no... - Does your compiler support dual core? (the awnser on most modren systems woudl be yes) - Does the code you are compiling utilize more than one core? (the usual awnser is who knows unless you start going over the code it will be a guessin