Re: Conditional question

2007-07-02 Thread Chas Owens
On 7/3/07, Paul Johnson <[EMAIL PROTECTED]> wrote: snip And, in this case, more accurate. Unless you know something the rest of us don't. snip The trinary operator (?:) returns the value of either the true or false portion depending on the conditional portion, so putting print in both the true

Re: Component Object Model

2007-07-02 Thread Sunil Prabhakaran
hi Yes of course Try Win32::OLE module For me this Blog http://www.perl.com/pub/a/2005/04/21/win32ole.html is a good starter. regards sunil On 7/2/07, ash <[EMAIL PROTECTED]> wrote: Hello! Does Perl support COM? If yes can I have an example of creating an object and using functions? Thank yo

Re: Conditional question

2007-07-02 Thread Paul Johnson
On Tue, Jul 03, 2007 at 01:31:59AM -0400, Chas Owens wrote: > On 7/3/07, Prabu Ayyappan <[EMAIL PROTECTED]> wrote: > >You can even do like this > > > >$var1 == 0 && $var2 == 1 ? print "hai" : print "bye"; > snip > > If you are going for succinctness, then try this > > print !$var1 && $var2 ? "h

Re: Conditional question

2007-07-02 Thread Paul Johnson
On Mon, Jul 02, 2007 at 11:28:47PM -0600, Joseph L. Casale wrote: > Heh, I never tried to use "and"? I assumed it wasn't that simple! Problem > with learning something from the beginning is I don't even know what that's > called so searching the net is rather hard:) Of course, searching the net

Re: Conditional question

2007-07-02 Thread Chas Owens
On 7/3/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: Heh, I never tried to use "and"? I assumed it wasn't that simple! snip Well, it is a little more complicated than that. There are three and operators in Perl: bitwise (&), high precedence logical (&&), and low precedence logical (and). In

Re: Conditional question

2007-07-02 Thread Chas Owens
On 7/3/07, Prabu Ayyappan <[EMAIL PROTECTED]> wrote: You can even do like this $var1 == 0 && $var2 == 1 ? print "hai" : print "bye"; snip If you are going for succinctness, then try this print !$var1 && $var2 ? "hai" : "bye"; But in general, you are better off using the longer forms as they

RE: Conditional question

2007-07-02 Thread Joseph L. Casale
Heh, I never tried to use "and"? I assumed it wasn't that simple! Problem with learning something from the beginning is I don't even know what that's called so searching the net is rather hard:) I'll try this! Thanks. jlc -Original Message- From: Chas Owens [mailto:[EMAIL PROTECTED] Sen

Re: Conditional question

2007-07-02 Thread Prabu Ayyappan
You can even do like this $var1 == 0 && $var2 == 1 ? print "hai" : print "bye"; Thanks and Regards, Prabu.M.A "Joseph L. Casale" <[EMAIL PROTECTED]> wrote: I want to script an "if" based on two conditions, var1=0 and var2=1. Is there some quicker way to write this in one "if" stateme

Re: Conditional question

2007-07-02 Thread Chas Owens
On 7/3/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: I want to script an "if" based on two conditions, var1=0 and var2=1. Is there some quicker way to write this in one "if" statement like: If ($var1=0 ?and? var2=1) { Do my stuff } I know I can nest a second if, but just hoped

Conditional question

2007-07-02 Thread Joseph L. Casale
I want to script an "if" based on two conditions, var1=0 and var2=1. Is there some quicker way to write this in one "if" statement like: If ($var1=0 ?and? var2=1) { Do my stuff } I know I can nest a second if, but just hoped I could do it quicker :) Thanks! jlc

Re: book on perl

2007-07-02 Thread Randal L. Schwartz
> ""alex" == "alex [EMAIL PROTECTED] com" <[EMAIL PROTECTED]> writes: "alex> Hi Mayank, "alex> For a beginners book, you can check out Oreilly's Learning Perl. It's "alex> an easy read split up into chapters that you can finish in an hour and "alex> exercises at the end of each. "alex> It cove

Re: Test::Class fixture problem

2007-07-02 Thread Adrian Howard
Belated response... On 1 Jul 2007, at 23:19, Ovid wrote: [snip] I've just spent quite a bit of time debugging a problem where a Test::Class setup method was misbehaving. My tests passed, but mysql was spitting out errors directly to STDERR and quite a bit of tracing led me to the following

Re: book on perl

2007-07-02 Thread Francisco Valladolid
Hi, On 7/2/07, Garg, Mayank IN BOM SISL <[EMAIL PROTECTED]> wrote: Hi all, Can some one suggest me a good book on perl (basics and advanced) My recommendations is the next: 1.- Elements of programming with perl from Manning 2.- Beginning Perl, from Cozens 3.- Learning Perl from Randal Schw

Re: Problem with runaway format

2007-07-02 Thread Mathew
Tom Phoenix wrote: > On 7/2/07, Mathew <[EMAIL PROTECTED]> wrote: > >> foreach my $date (@searchDate) { >> while (my $ticket = $tix->Next) { > > Seeing this worries me. I don't know enough about what's going on to > tell whether it's wrong or not, but it looks wrong. When the outer > loop

Re: how to get references from imbricated capturing parenthesis ?

2007-07-02 Thread marin
Hi, Thanks a lot you for your solutions.. I'will study its :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Problem with runaway format

2007-07-02 Thread Tom Phoenix
On 7/2/07, Mathew <[EMAIL PROTECTED]> wrote: foreach my $date (@searchDate) { while (my $ticket = $tix->Next) { Seeing this worries me. I don't know enough about what's going on to tell whether it's wrong or not, but it looks wrong. When the outer loop goes on to the second iteration,

Re: install of perl 5.8.8

2007-07-02 Thread Chas Owens
On 6/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I have never installed Perl. I downloaded 5.8.8 into solaris 10 server. Is there an eaaasy instruction for installation. There is already v.5.8.4 installed. thanks In order of ease: 1. Hire someone to install it for you

Re: Problem with runaway format

2007-07-02 Thread Mathew
Tom Phoenix wrote: > On 7/1/07, Mathew Snyder <[EMAIL PROTECTED]> wrote: > >> The problem didn't surface until I went from using the %tikSubj hash >> seen near >> the top of the code snippet to a multi-level hash. But then, using >> %tikSubj >> presents its own bug for some reason. > > One trick

Re: sorted hash positions

2007-07-02 Thread Chas Owens
On 7/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: snip wat i need is for ex if i gave 34567 it has to tell the position of the hash 4th position... how can i do that. snip Given what you have said, I would define your problem as Given a list of coins and their current value, let m

Re: Problem with runaway format

2007-07-02 Thread Mathew
kens wrote: > On Jul 1, 5:40 am, [EMAIL PROTECTED] (Mathew Snyder) wrote: >> I have a script which places data 4 levels deep in a HoHoHoH. It grabs >> tickets >> in our ticket system using the systems API and places attributes about each >> piece of activity into the hash. The has is called %tick

Re: parsing a line

2007-07-02 Thread Chas Owens
On 7/1/07, alok nath <[EMAIL PROTECTED]> wrote: Hi Chas, Can you please explain the portion ( ([\w ]*\w)\s*= )of the regex.? And why its stored in $s.Can it be directly stored in hash my %rec. Thanks Alok snip First off, the results of the regex are not being stored in $s; the regex is bei

Re: Problem with runaway format

2007-07-02 Thread Tom Phoenix
On 7/1/07, Mathew Snyder <[EMAIL PROTECTED]> wrote: The problem didn't surface until I went from using the %tikSubj hash seen near the top of the code snippet to a multi-level hash. But then, using %tikSubj presents its own bug for some reason. One tricky bit about using formats is that the v

Re: sorted hash positions

2007-07-02 Thread Paul Lalli
On Jul 2, 9:20 am, [EMAIL PROTECTED] wrote: > i had a problem with hashes...can any one help > > ihad a hash with keys and values... > > # DEFINE A HASH > %coins = ( "12345" , 91, >"987658" ,35.5, >"wer123", 99.8, > "456hn",56.4, >

Re: sorted hash positions

2007-07-02 Thread Martin Barth
ohh I forgot something - oops my $what_i_am_looking_for = "34567"; my $index = 0; # LOOP THROUGH IT foreach $value (sort {$coins{$a} cmp $coins{$b} } keys %coins) { $index++; next unless $value == $what_i_am_looking_for; print "<$value---$index> $coins{$value}>\n"; } --

Re: sorted hash positions

2007-07-02 Thread Martin Barth
On Mon, 02 Jul 2007 06:20:26 -0700 [EMAIL PROTECTED] wrote: lets say you're looking for "34567" so my $what_i_am_looking_for = "34567"; # LOOP THROUGH IT foreach $value (sort {$coins{$a} cmp $coins{$b} } keys %coins) { next unless $value == $what_i_am_looking_for; print "<$value--->

Re: sorted hash positions

2007-07-02 Thread Tom Phoenix
On 7/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: %coins = ( "12345" , 91, "987658" ,35.5, "wer123", 99.8, "456hn",56.4, "34567",78.9, "0",99.9, "yui345",45.4); wat i ne

Re: book on perl

2007-07-02 Thread [EMAIL PROTECTED]
Hi Mayank, For a beginners book, you can check out Oreilly's Learning Perl. It's an easy read split up into chapters that you can finish in an hour and exercises at the end of each. It covers file i/o (the essentials) and has enough to let you do some practical work. Then alternatively, there's Pr

Component Object Model

2007-07-02 Thread ash
Hello! Does Perl support COM? If yes can I have an example of creating an object and using functions? Thank you in advance. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

sorted hash positions

2007-07-02 Thread nagandla
i had a problem with hashes...can any one help ihad a hash with keys and values... # DEFINE A HASH %coins = ( "12345" , 91, "987658" ,35.5, "wer123", 99.8, "456hn",56.4, "34567",78.9, "0",99.9,

Re: Problem with runaway format

2007-07-02 Thread kens
On Jul 1, 5:40 am, [EMAIL PROTECTED] (Mathew Snyder) wrote: > I have a script which places data 4 levels deep in a HoHoHoH. It grabs > tickets > in our ticket system using the systems API and places attributes about each > piece of activity into the hash. The has is called %tickets. It looks lik

Re: how to get references from imbricated capturing parenthesis ?

2007-07-02 Thread julien blitte
Hello, I'm transcoding 4 bytes hex data to an IPv4 address. Thanks a lot for your solution : It's works ;) Regards, 2007/6/30, Tom Phoenix <[EMAIL PROTECTED]>: On 6/29/07, marin <[EMAIL PROTECTED]> wrote: > I'm trying to get references from a simple regular exepression like > this : > > "a4

interpolation of function reference in a here doc

2007-07-02 Thread Gabriel Striewe
Dear List, I wanted to interpolate a function reference in a here doc. The following works fine: my $hello = sub { return "hello world!"; }; printf "hello $s\n", &$hello(); But when I use a heredoc instead, it doesn't work: print

Re: interpolation of function reference in a here doc

2007-07-02 Thread Rob Dixon
Gabriel Striewe wrote: I wanted to interpolate a function reference in a here doc. The following works fine: my $hello = sub { return "hello world!"; }; printf "hello $s\n", &$hello(); But when I use a heredoc instead, it doesn't work: print < First of all,

Re: interpolation of function reference in a here doc

2007-07-02 Thread Xavier Noria
On Jul 2, 2007, at 2:46 PM, Gabriel Striewe wrote: Dear List, I wanted to interpolate a function reference in a here doc. The following works fine: my $hello = sub { return "hello world!"; }; printf "hello $s\n", &$hello(); In Perl printf is rarely used beca

Re: interpolation of function reference in a here doc

2007-07-02 Thread Adriano Ferreira
On 7/2/07, Gabriel Striewe <[EMAIL PROTECTED]> wrote: Dear List, I wanted to interpolate a function reference in a here doc. The following works fine: my $hello = sub { return "hello world!"; }; printf "hello $s\n", &$hello(); But when I use a heredoc instead,

Re: AJAX, Graphs and Perl backend

2007-07-02 Thread Jay Savage
On 7/1/07, Mathew <[EMAIL PROTECTED]> wrote: cldmismgr wrote: > On Jul 1, 1:05 am, [EMAIL PROTECTED] (Mathew Snyder) wrote: >> Does anyone know what the best route to creating graphs using AJAX and Perl >> would be? I've been running various searches on this and haven't found any >> solid inform

Re: book on perl

2007-07-02 Thread Hal Wigoda
not anymore. On Jul 2, 2007, at 3:55 AM, Prabu Ayyappan wrote: Hi, There is some good stuffs in the below link. http://www.unix.org.ua/orelly/ Thanks, Prabu "Garg, Mayank IN BOM SISL" <[EMAIL PROTECTED]> wrote: Hi all, Can some one suggest me a good book on perl (basics and adva

Re: book on perl

2007-07-02 Thread Dr.Ruud
Garg, Mayank schreef: > Can some one suggest me a good book on perl (basics and advanced) See also http://learn.perl.org -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: book on perl

2007-07-02 Thread Paul Lalli
On Jul 2, 4:55 am, [EMAIL PROTECTED] (Prabu Ayyappan) wrote: > There is some good stuffs in the below link. > > PLEASE do not do that! Do not post the URL to a site which pirates the copyrighted work of respected authors. It's extremely rude. If you want to sample a book before you buy it,

Re: book on perl

2007-07-02 Thread Paul Lalli
On Jul 2, 3:35 am, [EMAIL PROTECTED] (Mayank IN BOM SISL Garg) wrote: > Can some one suggest me a good book on perl (basics and advanced) Hello. You've asked a Frequently Asked Quesiton. If you already have Perl installed, you can access the FAQ by using the `perldoc` utility. At a command lin

Re: book on perl

2007-07-02 Thread Prabu Ayyappan
Hi, There is some good stuffs in the below link. http://www.unix.org.ua/orelly/ Thanks, Prabu "Garg, Mayank IN BOM SISL" <[EMAIL PROTECTED]> wrote: Hi all, Can some one suggest me a good book on perl (basics and advanced) Thanks & Regards, Mayank Garg

Re: book on perl

2007-07-02 Thread Frank Terbeck
Garg, Mayank IN BOM SISL <[EMAIL PROTECTED]>: > Can some one suggest me a good book on perl (basics and advanced) Linked from . Regards

Re: book on perl

2007-07-02 Thread Eko Budiharto
camel books by oreilly. There are all good books even for beginners or for advanced. Oreilly books are the best. On 7/2/07, Garg, Mayank IN BOM SISL <[EMAIL PROTECTED]> wrote: Hi all, Can some one suggest me a good book on perl (basics and advanced) Thanks & Regards, Mayank Garg -- Eko

book on perl

2007-07-02 Thread Garg, Mayank IN BOM SISL
Hi all, Can some one suggest me a good book on perl (basics and advanced) Thanks & Regards, Mayank Garg