Why doesn't this work: perl -e @s=([1,2],[3,4]); print $s[0][0];

2008-10-31 Thread Zembower, Kevin
(This should probably be an easy one for someone.} Why doesn't this work: [EMAIL PROTECTED]:/usr/local/src/rrd$ perl -e @s=([a,b],[c,d]);print $s[0][0]; syntax error at -e line 1, near ][ Execution of -e aborted due to compilation errors. [EMAIL PROTECTED]:/usr/local/src/rrd$ perl -e @s=([1,2

Re: Why doesn't this work: perl -e @s=([1,2],[3,4]); print $s[0][0];

2008-10-31 Thread Paul Johnson
On Fri, Oct 31, 2008 at 01:34:05PM -0400, Zembower, Kevin wrote: (This should probably be an easy one for someone.} Why doesn't this work: [EMAIL PROTECTED]:/usr/local/src/rrd$ perl -e @s=([a,b],[c,d]);print $s[0][0]; syntax error at -e line 1, near ][ Execution of -e aborted due

RE: Why doesn't this work: perl -e @s=([1,2],[3,4]); print $s[0][0];

2008-10-31 Thread Zembower, Kevin
Oh, it was that simple. Thanks so much, Paul. -Kevin -Original Message- From: Paul Johnson [mailto:[EMAIL PROTECTED] Sent: Friday, October 31, 2008 1:42 PM To: Zembower, Kevin Cc: 'beginners@perl.org' Subject: Re: Why doesn't this work: perl -e @s=([1,2],[3,4]); print $s[0][0]; On Fri

Re: Why doesn't this work: perl -e @s=([1,2],[3,4]); print $s[0][0];

2008-10-31 Thread John W. Krahn
Zembower, Kevin wrote: (This should probably be an easy one for someone.} Why doesn't this work: [EMAIL PROTECTED]:/usr/local/src/rrd$ perl -e @s=([a,b],[c,d]);print $s[0][0]; syntax error at -e line 1, near ][ Execution of -e aborted due to compilation errors. The shell interpolates your

Why doesn't this work: matching capturing

2008-02-26 Thread Zembower, Kevin
I have a data file that looks like this: uSF1 MD1500 0092149355224510209 0101001 88722397N0720900 116759 0Block Group 1 S 1158 662+39283007-076574503 uSF1 MD1500 0092150355224510209 0101002 88722397N0720900 109338

Re: Why doesn't this work: matching capturing

2008-02-26 Thread Paul Lalli
On Feb 26, 1:19 pm, [EMAIL PROTECTED] (Kevin Zembower) wrote: I have a data file that looks like this: uSF1  MD1500  009214935522451020                9  0101001 88722397N0720900 116759             0Block Group 1 S      1158      662+39283007-076574503 uSF1  MD1500  

RE: Why doesn't this work: matching capturing

2008-02-26 Thread Zembower, Kevin
: Why doesn't this work: matching capturing On Feb 26, 1:19 pm, [EMAIL PROTECTED] (Kevin Zembower) wrote: I have a data file that looks like this: uSF1  MD1500  009214935522451020                9  0101001 88722397N0720900 116759             0Block Group 1 S      1158      662+39283007

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

2008-01-12 Thread davidfilmer
On Jan 11, 1:16 pm, [EMAIL PROTECTED] (Kevin Zembower) wrote: $type eq unknown ? $type=human : $type=both; You're trying to use the trinary like you would an if-then-else. You want to instead use it in an assignment: $type = ($type eq 'unknown') ? 'human' : 'both'; -- The best way to get a

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

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 want and expect. The

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 machine

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?

2004-11-13 Thread Zeus Odin
hope I have done the same. Thanks a lot! You're welcome. Good luck. -ZO -Original Message- From: Zeus Odin [mailto:[EMAIL PROTECTED] Sent: Friday, November 12, 2004 12:09 AM To: Li, Aiguo (NIH/NCI) Subject: Re: Why doesn't this work? Aiguo Li [EMAIL PROTECTED] wrote

Re: Why doesn't this work?

2004-11-11 Thread Zeus Odin
Aiguo Li [EMAIL PROTECTED] wrote in message... Hello, Hello. I have the following dataset and want to calculate a P/A ratio for each replicates in the dataset. In this case, treatment 1 has 4 replicats and treatment2 has 3 replicates. The P/A = [((#of P)*2) + (# of M)]/# of replicates. The

RE: Why doesn't this work?

2004-11-11 Thread Li, Aiguo (NIH/NCI)
the # of replicates in each treatment. Thanks, Aiguo -Original Message- From: Zeus Odin [mailto:[EMAIL PROTECTED] Sent: Thursday, November 11, 2004 8:08 AM To: [EMAIL PROTECTED] Subject: Re: Why doesn't this work? Aiguo Li [EMAIL PROTECTED] wrote in message... Hello, Hello. I have

Re: Why doesn't this work?

2004-11-11 Thread Zeus Odin
Aiguo Li [EMAIL PROTECTED] wrote in message ... Probe id Treat1 Treat2 AffX-BioB-5_at (2p +M)/4 =2 (2*3+0)/3=2 FFX-BioB-M_at (2*3+0)/4 =1.7 (2*3+0)/3=2 AFFX-BioB-3_at (2*2+0)/4 =1 (2*2+0)/3=1.3 AFFX-BioC-5_at (2*2+1)/4 =1.25 (2*1+1)/3=1 AFFX-BioC-3_at (2*1+1)/4 = 0.75 (2*2+1)/3=1.7 The

Why doesn't this work?

2004-11-09 Thread Brian Gehrke
The following subroutine should take an input path (Dir0), process that directory by recursively calling itself on subdirectories or processing any files it contains. The problem I am experiencing is that in the following example file structure it process Dir1 correctly, but after it returns

Why doesn't this work?

2004-11-09 Thread Li, Aiguo (NIH/NCI)
Hello, I have the following dataset and want to calculate a P/A ratio for each replicates in the dataset. In this case, treatment 1 has 4 replicats and treatment2 has 3 replicates. The P/A = [((#of P)*2) + (# of M)]/# of replicates. The output should be two columns of P/A ratios for two

RE: Why doesn't this work?

2004-11-09 Thread Jim
The following subroutine should take an input path (Dir0), process that directory by recursively calling itself on subdirectories or processing any files it contains. The problem I am experiencing is that in the following example file structure it process Dir1 correctly, but after it

RE: Why doesn't this work?

2004-11-09 Thread Ajey Kulkarni
If you are running this on *NIX box, plain old 'find' command is enough too. ~A On Tue, 9 Nov 2004, Jim wrote: The following subroutine should take an input path (Dir0), process that directory by recursively calling itself on subdirectories or processing any files it contains. The

RE: Why doesn't this work anymore ?

2003-01-27 Thread Joel Hughes
Is it possible for a server to see the difference between a browser and a script using the LWP::UserAgent module ? Can I fix this ? Hi Rene, I have come across this kind of problem before. Usually it is the useragent string (try pretending to be IE!) or because your not sending any cookies.

Re: Why doesn't this work anymore ?

2003-01-26 Thread Octavian Rasnita
: Monday, January 27, 2003 2:37 AM Subject: Why doesn't this work anymore ? Hi all, Don't know if this is off-topic : I have a script that uses the LWP::UserAgent module to retrieve some page content from an other website. This worked fine, untill a few days ago. Now all I get is a 403

Re: Why doesn't it work?

2002-03-19 Thread Curtis Poe
--- Octavian Rasnita [EMAIL PROTECTED] wrote: Hi all, I tried the following line to open another location, but it doesn't work. print $screen - redirect(-uri='http://localhost/index.html'); It doesn't redirect to another location. It just prints the following: Status: 302 Moved

Why doesn't it work?

2002-03-17 Thread Octavian Rasnita
Hi all, I tried the following line to open another location, but it doesn't work. print $screen - redirect(-uri='http://localhost/index.html'); It doesn't redirect to another location. It just prints the following: Status: 302 Moved Location: http://localhost/index.html Do you have any idea

Why doesn't RETURN work?

2001-10-24 Thread Gross, Stephan
I have a subroutine sub xyz { if ($a = $b) { return; } } When I run this in the debugger, it stays frozen on the RETURN statement. Shouldn't the RETURN break out of the xyz subroutine? Also, this used to work until I made some changes. Am I missing something

RE: Why doesn't RETURN work?

2001-10-24 Thread Barry Carroll
: Wednesday, October 24, 2001 2:47 PM To: 'Beginner Perl' Subject: Why doesn't RETURN work? I have a subroutine sub xyz { if ($a = $b) { return; } } When I run this in the debugger, it stays frozen on the RETURN statement. Shouldn't the RETURN break out of the xyz subroutine

RE: Why doesn't RETURN work?

2001-10-24 Thread RArul
How about if($a == $b) ? -Original Message- From: Gross, Stephan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 9:47 AM To: 'Beginner Perl' Subject: Why doesn't RETURN work? I have a subroutine sub xyz { if ($a = $b) { return; } } When I run

RE: Why doesn't RETURN work?

2001-10-24 Thread Gross, Stephan
, October 24, 2001 9:59 AM To: 'Gross, Stephan'; 'Beginner Perl' Subject: RE: Why doesn't RETURN work? Hi, 'if ($a = $b)' is not comparing $a to $b, it is assigning the value of $b into $a If you want to test for numeric equivalence, use two '='s like 'if ($a == $b)' Then your code should

Re: Why doesn't RETURN work?

2001-10-24 Thread Brett W. McCoy
On Wed, 24 Oct 2001, Gross, Stephan wrote: I have a subroutine sub xyz { if ($a = $b) { return; } } When I run this in the debugger, it stays frozen on the RETURN statement. Shouldn't the RETURN break out of the xyz subroutine? Also, this used to work until

RE: why doesn't this work

2001-09-03 Thread John Edwards
it didn't equal 1. The above says unless status equals 1 or 2, fail, which is what you need. HTH John -Original Message- From: dan radom [mailto:[EMAIL PROTECTED]] Sent: 03 September 2001 17:00 To: [EMAIL PROTECTED] Subject: why doesn't this work I'm very new to perl. I have been trying

Re: why doesn't this work

2001-09-03 Thread dan radom
Thanks. That got it. dan * Jeff 'japhy/Marillion' Pinyan ([EMAIL PROTECTED]) wrote: On Sep 3, dan radom said: if ( $#ARGV+1 !=2 ) { That's better written as: if (@ARGV != 2) { print \n; print usage cat.pl port up\/down\n; print \n; exit; }

RE: why doesn't this work

2001-09-03 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 3, John Edwards said: unless ( $status == (1 || 2) ) { print \nport status must be either up or down\n\n; exit; } else { system(/usr/bin/snmpset hostname password interfaces.ifTable.ifEntry.ifAdminStatus.$port i $status); } The above says unless status equals 1 or

Re: why doesn't this work

2001-09-03 Thread smoot
dan radom [EMAIL PROTECTED] said: You have a logic error. The if test should be: if (! ( $status eq 1 || $status eq 2)) { #if (( $status ne 1 ) || ( $status ne 2 )) { A few other style pointers follow: You can replace this: if ( $#ARGV+1 !=2) { with if ( @ARGV != 2) { @arrayname

Re: why doesn't this work

2001-09-03 Thread smoot
[EMAIL PROTECTED] said: dan radom [EMAIL PROTECTED] said: You have a logic error. The if test should be: if (! ( $status eq 1 || $status eq 2)) { Well, I know better than that. Should be = not eq. -- Smoot Carl-Mitchell Consultant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For