Re: Why doesn't this work: trinary operator?

2008-01-11 Thread Rob Dixon
John W. Krahn wrote: Zembower, Kevin wrote: When I execute this line: $type eq "unknown" ? $type="human" : $type="both"; $type is always "both". PRECEDENCE! ?: has higher precedence than = You want to do it like this: $type = $type eq 'unknown' ? 'human' : 'both'; Your code parses as:

Re: Why doesn't this work: trinary operator?

2008-01-11 Thread John W. Krahn
Zembower, Kevin wrote: When I execute this line: $type eq "unknown" ? $type="human" : $type="both"; $type is always "both". PRECEDENCE! ?: has higher precedence than = You want to do it like this: $type = $type eq 'unknown' ? 'human' : 'both'; John -- Perl isn't a toolbox, but a small m

Re: Why doesn't this work: trinary operator?

2008-01-11 Thread Stephen Kratzer
On Friday 11 January 2008 16:16:27 Zembower, Kevin wrote: > When I execute this line: > > $type eq "unknown" ? $type="human" : $type="both"; > > $type is always "both". But executing this line: > > if ($type eq "unknown") {$type="human"} else {$type="both"}; > > $type is "human", which is want I wa

Why doesn't this work: trinary operator?

2008-01-11 Thread Zembower, Kevin
When I execute this line: $type eq "unknown" ? $type="human" : $type="both"; $type is always "both". But executing this line: if ($type eq "unknown") {$type="human"} else {$type="both"}; $type is "human", which is want I want and expect. The context for these statements in my program is pasted

Re: find2perl

2008-01-11 Thread oryann9
>You're misusing it. Set it within the wanted() routine when you're >looking at >a directory that you don't want to descend. It'll be cleared to 0 >before >calling wanted(), so setting it before calling find() is completely >useless. >-- >Randal L. Schwartz - Stonehenge Consulting Services,

Re: installing Math::Complex

2008-01-11 Thread Chas. Owens
On Jan 11, 2008 2:06 PM, ANJAN PURKAYASTHA <[EMAIL PROTECTED]> wrote: > i too am having problems installing the Math::Complex module. Specifically, > LWP does not seem to be available. At the end of the build steps I get an > error message: > writing makefile for Math::Complex > Not OK > running ma

installing Math::Complex

2008-01-11 Thread ANJAN PURKAYASTHA
i too am having problems installing the Math::Complex module. Specifically, LWP does not seem to be available. At the end of the build steps I get an error message: writing makefile for Math::Complex Not OK running make test Can't test without successul make Running make install make had returned b

Re: where to download Perl Module Math::Trig::acos()

2008-01-11 Thread Chas. Owens
On Jan 11, 2008 1:46 PM, Jenny Chen <[EMAIL PROTECTED]> wrote: > Hi everyone, > > How is everybody doing? I need to use Math::Trig::acos(), but not able to > find it on CPAN. Does anyone know where I can download it from? > > Thanks > > Jenny > acos is in Math::Trig which is part of Math::C

Re: user arguments, oracle - insert, delete and drop!

2008-01-11 Thread Chris Charley
- Original Message - From: "perlmunky" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Friday, January 11, 2008 9:11 AM Subject: user arguments, oracle - insert, delete and drop! Hi List, I am in the process of making a web service which will (at some point) query an ora

where to download Perl Module Math::Trig::acos()

2008-01-11 Thread Jenny Chen
Hi everyone, How is everybody doing? I need to use Math::Trig::acos(), but not able to find it on CPAN. Does anyone know where I can download it from? Thanks Jenny

Re: user arguments, oracle - insert, delete and drop!

2008-01-11 Thread Tom Phoenix
On Jan 11, 2008 9:43 AM, <[EMAIL PROTECTED]> wrote: > I have written some stuff - I am just concerned that people on the > big bad web know far more about these things (oracle - perl) than I > and that they will, with little trouble, side-step my parameter > checking. So, show us your code; and

Re: insert and query a db

2008-01-11 Thread Tom Phoenix
On Jan 10, 2008 10:50 PM, <[EMAIL PROTECTED]> wrote: > Only the content of the first 2 fields is displayed: In your shoes, I would check that 'use warnings' and 'use strict' are in place, and other basics, then I'd start debugging at the database. Check out the tracing facility, documented in th

Re: user arguments, oracle - insert, delete and drop!

2008-01-11 Thread Tom Phoenix
On Jan 11, 2008 6:11 AM, perlmunky <[EMAIL PROTECTED]> wrote: > I realise that this is not smart, at least without any parameter checking. > I need a way of making the information 'safe' - avoid sql injections etc. > hints, tips and solutions accepted :) Have you tried writing Perl code to do th

RE: Creating an encrypted zipfile on Unix for Windows users

2008-01-11 Thread RICHARD FERNANDEZ
Create a Zip archive instead man zip for more information -e Encrypt the contents of the zip archive using a password which is entered on the terminal in response to a prompt (this will not be echoed; if standard error is not a tty

user arguments, oracle - insert, delete and drop!

2008-01-11 Thread perlmunky
Hi List, I am in the process of making a web service which will (at some point) query an oracle DB with some user supplied text. Currently the page allows the user to select the information in the insert from a tick box, the tables from a list and the conditional they can choose and then enter as

Re: which is better when reading files

2008-01-11 Thread Rob Dixon
Enjoy_Life wrote: > hi, who can tell me which is better of the following codes? why there are different methods to read files? thanks 1. open(INPUT, "< filedata") or die "Couldn't open filedata for reading: $!\n"; while () { print if /blue/; } close(INPUT); 2. use IO::File;

Re: insert and query a db

2008-01-11 Thread bbrecht56
On Jan 7, 1:50 pm, [EMAIL PROTECTED] (John Moon) wrote: > [>>] ... > > Please try (not tested). Placeholders help me a lot: > > my $sth_insert = $dbh->prepare('Insert into info (id, name, grade, > phone, cell, house, car) >values (?,?,?,?,?,?,?)') > or die DBI->errstr;

Re: which is better when reading files

2008-01-11 Thread Enjoy_Life
thanks On Jan 11, 2008 5:04 PM, Jeff Pang <[EMAIL PROTECTED]> wrote: > On Jan 11, 2008 2:00 PM, Enjoy_Life <[EMAIL PROTECTED]> wrote: > > hi, who can tell me which is better of the following codes? > > why there are different methods to read files? > > thanks > > > > 1. open(INPUT, "< filedata")

Re: which is better when reading files

2008-01-11 Thread Jeff Pang
On Jan 11, 2008 2:00 PM, Enjoy_Life <[EMAIL PROTECTED]> wrote: > hi, who can tell me which is better of the following codes? > why there are different methods to read files? > thanks > > 1. open(INPUT, "< filedata") or die "Couldn't open filedata for reading: > $!\n"; > while () { > pr