perl.beginners
  Home FAQ Contact Sign in
perl.beginners only
 
Advanced search
January 2008
motuwethfrsasuw
 123456 1
78910111213 2
14151617181920 3
21222324252627 4
28293031    5
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
perl.beginners Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Why doesn't this work: trinary operator?         


Author: Kevin Zembower
Date: Jan 11, 2008 13:16

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 in at the bottom.

Thanks for your guidance.

-Kevin

Kevin Zembower
Internet Services Group manager
Center for Communication Programs
Bloomberg School of Public Health
Johns Hopkins University
111 Market Place, Suite 310
Baltimore, Maryland 21202
410-659-6139
====================================
my $type = "unknown"; #The default.
Show full article (1.28Kb)
3 Comments
  Re: find2perl         


Author: Oryann9
Date: Jan 11, 2008 11:32

>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, Inc. - +1 503 777
>0095
>stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
>Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.

-

Is this what you mean on line 9? I tried and it does not seem to work,
meaning it still descending.
Show full article (1.50Kb)
no comments
  installing Math::Complex         


Author: Anjan Purkayastha
Date: Jan 11, 2008 11:06

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 bad status, install seems imposssible.

any thoughts?

Anjan
--
ANJAN PURKAYASTHA, PhD.
Senior Computational Biologist
==========================

1101 King Street, Suite 310,
Alexandria, VA 22314.
703.518.8040 (office)
703.740.6939 (mobile)
Show full article (0.66Kb)
1 Comment
  where to download Perl Module Math::Trig::acos()         


Author: Jenny Chen
Date: Jan 11, 2008 10:46

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
1 Comment
  RE: Creating an encrypted zipfile on Unix for Windows users         


Author: Richard Fernandez
Date: Jan 11, 2008 07:02

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,
zip will exit
with an error). The password prompt is repeated
to save the
user from typing errors.

--
Rodrick R. Brown
http://www.rodrickbrown.com
<http://www.rodrickbrown.com>

Thanks Rodrick!
Show full article (0.83Kb)
no comments
  user arguments, oracle - insert, delete and drop!         


Author: Perlmunky
Date: Jan 11, 2008 06:11

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 associated
text.

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. I
have tried using $dbh->quote($string) but this creates errors if the key
word entered by the users is null - as oracle thinks this is not a keyword.

hints, tips and solutions accepted :)

I don't have admin rights and can't install any modules that aren't already
available. The project is running under perl catalyst.

Thanks in advance
5 Comments
  Re: which is better when reading files         


Author: Rob Dixon
Date: Jan 11, 2008 05:28

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;
> $input = IO::File->new("< filedata")
> or die "Couldn't open filedata for reading: $!\n";
>
> while (defined($line = $input->getline())) {
> chomp($line);
> STDOUT->print($line) if $line =~ /blue/; ...
Show full article (1.53Kb)
2 Comments