array problem

2010-11-15 Thread shawn wilson
so, i'm thinking i'm not understanding references here again, but here's what i have. i fill in my array here: my $worksheetin = $workbookin-worksheet(0); my ( $row_min, $row_max ) = $worksheetin-row_range(); my ( $col_min, $col_max ) = $worksheetin-col_range(); for my $row ( $row_min ..

Re: array problem

2010-11-15 Thread shawn wilson
too much freaking data. i increased my scroll buffer and found that i do get data, just not the last 1k lines err On Mon, Nov 15, 2010 at 12:33 PM, shawn wilson ag4ve...@gmail.com wrote: so, i'm thinking i'm not understanding references here again, but here's what i have. i fill in

Re: array problem

2010-11-15 Thread Uri Guttman
sw == shawn wilson ag4ve...@gmail.com writes: swmy $worksheetout = $workbookout-add_worksheet( '$year' ); why are you quoting $year? that doesn't do what you think it does. in fact it is a bug. you aren't checking if you get results out of that call which is another problem. uri -- Uri

Re: array problem

2010-11-15 Thread shawn wilson
On Mon, Nov 15, 2010 at 1:54 PM, Uri Guttman u...@stemsystems.com wrote: sw == shawn wilson ag4ve...@gmail.com writes: swmy $worksheetout = $workbookout-add_worksheet( '$year' ); why are you quoting $year? that doesn't do what you think it does. in fact it is a bug. you aren't

Re: Array problem

2008-07-02 Thread Beyza
Thanks for the answers. I have tried to use quotemeta but it did not work as expected, DBI's quote function was exactly what I want. Thanks again, On Jul 1, 6:35 pm, [EMAIL PROTECTED] (Amit Saxena) wrote: use $*dbh*-*quote*($str) On Tue, Jul 1, 2008 at 4:59 AM, Gunnar Hjalmarsson [EMAIL

Re: Array problem

2008-07-01 Thread Amit Saxena
use $*dbh*-*quote*($str) On Tue, Jul 1, 2008 at 4:59 AM, Gunnar Hjalmarsson [EMAIL PROTECTED] wrote: Beyza wrote: I have an array which has strings like; John's House Bla bla; etc, When I use them in an SQL query, perl gives an error. So, I need to put escape character for every

Array problem

2008-06-30 Thread Beyza
Hi, I would like to know how to insert escape character in front of special characters in an array. I have an array which has strings like; John's House Bla bla; etc, When I use them in an SQL query, perl gives an error. So, I need to put escape character for every special character. Is there

Re: Array problem

2008-06-30 Thread Aruna Goke
Beyza wrote: Hi, I would like to know how to insert escape character in front of special characters in an array. I have an array which has strings like; John's House Bla bla; etc, When I use them in an SQL query, perl gives an error. So, I need to put escape character for every special

Re: Array problem

2008-06-30 Thread Rob Dixon
Beyza wrote: Hi, I would like to know how to insert escape character in front of special characters in an array. I have an array which has strings like; John's House Bla bla; etc, When I use them in an SQL query, perl gives an error. So, I need to put escape character for every

Re: Array problem

2008-06-30 Thread Gunnar Hjalmarsson
Beyza wrote: I have an array which has strings like; John's House Bla bla; etc, When I use them in an SQL query, perl gives an error. So, I need to put escape character for every special character. Is there any quick way to do it? perldoc -f quotemeta -- Gunnar Hjalmarsson Email:

Re: Array problem

2006-01-23 Thread Ditlev, Unix Consulting
Is this what you wan't ? open INPUT,$ARGV[0]; while ($line=INPUT){ push (@array,$line); } foreach $i(@array){ print $i; } Andrej Kastrin [EMAIL PROTECTED] skrev i en meddelelse news:[EMAIL PROTECTED] I wrote simple script, which have to concatenate multiple lines into

Array problem

2006-01-22 Thread Andrej Kastrin
I wrote simple script, which have to concatenate multiple lines into array and then print each element of tihis array: open INPUT,$ARGV[0]; while ($line=INPUT){ push (@array,$line); foreach $i(@array){ print $i; } } Input is e.g. line 1 line 2 I don't know where is the problem,

RE: Array problem

2006-01-22 Thread Thomas Bätzler
Andrej Kastrin [EMAIL PROTECTED] asked: I wrote simple script, which have to concatenate multiple lines into array and then print each element of tihis array: open INPUT,$ARGV[0]; while ($line=INPUT){ I would instead suggest you use the special filehandle. This automagically opens any

Re: Array problem

2006-01-22 Thread Mazhar
Mr Andrej, I think the following code will work for u, open INPUT,$ARGV[0]; while (INPUT){ @array=$_; } foreach $i(@array){ print $i; } Regards Mazhar On 1/23/06, Thomas Bätzler [EMAIL PROTECTED] wrote: Andrej Kastrin [EMAIL PROTECTED] asked: I wrote simple script, which have to

Re: Array problem

2006-01-22 Thread John Doe
Andrej Kastrin am Montag, 23. Januar 2006 07.55: I wrote simple script, which have to concatenate multiple lines into array and then print each element of tihis array: I don't know where is the problem, Please, help! The basic problem is that you try to print the result within the (while)

Re: Two Dimensional Array Problem

2005-06-05 Thread Wiggins d'Anconia
Always group reply so others can help and be helped, and to avoid getting accidentally ignored. Because it's up-side down. Why is that? It makes replies harder to read. Why not? Please don't top-post. - Sherm Pendley, Mac OS X list Aaron Huber wrote: On 6/3/05, Wiggins d'Anconia [EMAIL

Two Dimensional Array Problem

2005-06-03 Thread ahuber
I am trying to send the output of a mysql query to a two dimensional array. This is what I've tried using push. while (@results = $sth-fetchrow_array ()) { $x = $results[0]; $y = $results[1]; push (@data,[$x],[$y]); } However, I don't get back a two dimensional array, I get back a

RE: Two Dimensional Array Problem

2005-06-03 Thread brian . barto
:42 PM To: beginners@perl.org Subject: Two Dimensional Array Problem I am trying to send the output of a mysql query to a two dimensional array. This is what I've tried using push. while (@results = $sth-fetchrow_array ()) { $x = $results[0]; $y = $results[1]; push (@data,[$x],[$y

RE: Two Dimensional Array Problem

2005-06-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: I am trying to send the output of a mysql query to a two dimensional array. This is what I've tried using push. while (@results = $sth-fetchrow_array ()) { $x = $results[0]; $y = $results[1]; push (@data,[$x],[$y]); push( @data, [ $x , $y

Re: Two Dimensional Array Problem

2005-06-03 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: I am trying to send the output of a mysql query to a two dimensional array. This is what I've tried using push. while (@results = $sth-fetchrow_array ()) { $x = $results[0]; $y = $results[1]; push (@data,[$x],[$y]); } However, I don't get back a

RE: Two Dimensional Array Problem

2005-06-03 Thread brian . barto
: Two Dimensional Array Problem [EMAIL PROTECTED] wrote: I am trying to send the output of a mysql query to a two dimensional array. This is what I've tried using push. while (@results = $sth-fetchrow_array ()) { $x = $results[0]; $y = $results[1]; push (@data,[$x],[$y

RE: Two Dimensional Array Problem

2005-06-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
in order and you are using say a hash which has array. Wags ;) -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Friday, June 03, 2005 3:01 PM To: [EMAIL PROTECTED]; beginners@perl.org Subject: RE: Two Dimensional Array

Re: Two Dimensional Array Problem

2005-06-03 Thread Chris Charley
[snip] Hi Brian, I usually deal with multidimensional arrays this way: $i = 0; while (@results = $sth-fetchrow_array ()) { $x = $results[0]; $y = $results[1]; @points = ($x, $y); $data[$i] = [EMAIL PROTECTED]; $i++; } Just a note about a possible problem with the statement:

Re: Concatenating line into array problem

2004-06-11 Thread John W. Krahn
Edward Wijaya wrote: Hi groups, Hello, I have a file which contain many many of this line (Fasta Format): YNL331C CAATATGCGAGGGACCTACATGTTGA CATGACAATGAATTCTATTGAA YKL071W ATAATTATTCCTGTTTCTTTAACCTG GTGTACAAACACTTAAGC What I would like to do is to concatenate the

Re: Concatenating line into array problem

2004-06-11 Thread John W. Krahn
John W. Krahn wrote: This should do what you want: $/ = ''; while ( ) { next unless s/\s+\S.*//; chomp; tr/\n//d; print $_\n; } After seeing your data file change that to: $/ = ''; while ( ) { next unless s/\S+.*\n//; chomp; tr/\n//d; print $_\n;

Re: Concatenating line into array problem

2004-06-11 Thread Zeus Odin
This works: ---BEGIN CODE--- #!/usr/bin/perl use warnings; use strict; $/ = ''; while (DATA) { s/(.*?\n.*?)\n/$1/s; print; } __DATA__ YNL331C CAATATGCGAGGGACCTACATGTTGA CATGACAATGAATTCTATTGAA YKL071W ATAATTATTCCTGTTTCTTTAACCTG GTGTACAAACACTTAAGC ---END CODE---

Concatenating line into array problem

2004-06-10 Thread Edward Wijaya
Hi groups, I have a file which contain many many of this line (Fasta Format): YNL331C CAATATGCGAGGGACCTACATGTTGA CATGACAATGAATTCTATTGAA YKL071W ATAATTATTCCTGTTTCTTTAACCTG GTGTACAAACACTTAAGC What I would like to do is to concatenate the line below into one single string. Such as the

RE: Concatenating line into array problem

2004-06-10 Thread Tim Johnson
); next; } chomp; $line .= $_; } shift @crseq; print join(\n, @crseq), \n; -Original Message- From: Edward Wijaya [mailto:[EMAIL PROTECTED] Sent: Thursday, June 10, 2004 9:09 PM To: [EMAIL PROTECTED] Subject: Concatenating line into array

Re: Concatenating line into array problem

2004-06-10 Thread Edward Wijaya
On Thu, 10 Jun 2004 21:19:17 -0700, Tim Johnson [EMAIL PROTECTED] wrote: while () { if (/^/) { push (@crseq, $line); next; } chomp; $line .= $_; } shift @crseq; print join(\n, @crseq), \n;

RE: Concatenating line into array problem

2004-06-10 Thread Charles K. Clarkson
From: Edward Wijaya mailto:[EMAIL PROTECTED] wrote: : #---My Code -- : while () { : if (/^/) { : next; : } : chomp; : $line .= $_; : } : push (@crseq, $line); : print join(\n, @crseq), \n; How about: my @crseq; while ( ) { next unless/^[ACGT]/;

Re: Concatenating line into array problem

2004-06-10 Thread Edward Wijaya
How about: my @crseq; while ( ) { next unless/^[ACGT]/; chomp; push @crseq, $_ . scalar ; } print @crseq; Hi Charles, Thanks for your reply. Your code works for my example in email, but not the file with more lines, (please see attached file). So sorry if I didn't give precise

RE: Concatenating line into array problem

2004-06-10 Thread Charles K. Clarkson
From: Edward Wijaya mailto:[EMAIL PROTECTED] wrote: :: How about: :: :: my @crseq; :: while ( ) { :: next unless/^[ACGT]/; :: chomp; :: push @crseq, $_ . scalar ; :: } :: print @crseq; :: : : Hi Charles, : : Thanks for your reply. : : Your code works for my example in email,

Re: Array problem, I think

2002-11-16 Thread badchoice
0 @F1@ FAM 1 HUSB @I13@ 1 WIFE @I14@ 1 CHIL @I8@ 0 @F2@ FAM 1 HUSB @I10@ 1 WIFE @I8@ 1 CHIL @I11@ 1 CHIL @I12@ etc. $/ = undef; for (split /\n0/, ) { ($key) = /\@(..)/; $hash{$key} = [ /\@(\w+)\@$/gm ]; } $individuals{F1}[0] = I13; $individuals{F1}[1] = I14;

Re: Array problem, I think

2002-11-16 Thread Paul Johnson
On Mon, Nov 11, 2002 at 06:17:58PM -0500, Cacialli, Doug wrote: I've got oodles of data. It looks like this: 0 @F1@ FAM 1 HUSB @I13@ 1 WIFE @I14@ 1 CHIL @I8@ 0 @F2@ FAM 1 HUSB @I10@ 1 WIFE @I8@ 1 CHIL @I11@ 1 CHIL @I12@ etc. [ snip problem ] I'm familiar with substr, split, m//,

Array problem, I think

2002-11-11 Thread Cacialli, Doug
Y'all, I'm new to programming in perl, and relatively new to programming at all, so I apologize if this is a little hard to follow. I've got oodles of data. It looks like this: 0 @F1@ FAM 1 HUSB @I13@ 1 WIFE @I14@ 1 CHIL @I8@ 0 @F2@ FAM 1 HUSB @I10@ 1 WIFE @I8@ 1 CHIL @I11@ 1 CHIL @I12@ etc.

Re: Array problem, I think

2002-11-11 Thread Cacialli, Doug
One additional thing: The data exists in an array, where each line of raw data is a scalar string within the array. -Original Message- From: Cacialli, Doug Sent: Monday, November 11, 2002 6:18 PM To: '[EMAIL PROTECTED]' Subject: Array problem, I think Y'all, I'm new to programming

Re: Array problem, I think

2002-11-11 Thread Jason Tiller
Hi, Doug, :) On Mon, 11 Nov 2002, Cacialli, Doug wrote: I'm new to programming in perl, and relatively new to programming at all, so I apologize if this is a little hard to follow. Wasn't hard at all! You described the problem very succinctly. I've got oodles of data. It looks like this:

Re: Array problem, I think

2002-11-11 Thread Wiggins d'Anconia
This solution works well and is clean, if you are curious about some of the *magic* he is performing in his foreach I would suggest reading up on the special variable $_ for those of us experienced in perl it isn't as daunting to just throw a foreach (@array) in the code and know that it is

Re: Array problem, I think

2002-11-11 Thread Jason Tiller
Hi, Wiggins, :) On Mon, 11 Nov 2002, Wiggins d'Anconia wrote: This solution works well and is clean, if you are curious about some of the *magic* he is performing in his foreach I would suggest reading up on the special variable $_ for those of us experienced in perl it isn't as daunting to

Re: Array problem, I think

2002-11-11 Thread Wiggins d'Anconia
No need to apologize. Agreed. http://danconia.org Jason Tiller wrote: Hi, Wiggins, :) On Mon, 11 Nov 2002, Wiggins d'Anconia wrote: This solution works well and is clean, if you are curious about some of the *magic* he is performing in his foreach I would suggest reading up on the special

Re: Array Problem

2002-01-21 Thread maureen
Thanks so much for your help on this. I tried this suggestion, but unfortunately, the array @indata does not seem to contain the usernames from the file pwdata.txt. I've been looking at this for hours. I hope someone can help me figure out what I am missing here. The objectives for this code and

Re: Array Problem

2002-01-21 Thread Leon
- Original Message - From: maureen [EMAIL PROTECTED] To: Leon [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, January 21, 2002 8:39 AM Subject: Re: Array Problem if ($username ne /$in{username}/) { Anything in between the forward slash are usually used as a regular expression

Re: Array Problem

2002-01-16 Thread Leon
- Original Message - From: maureen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Currently, the array seems to only be picking up the last name listed in the text file. @indata = FILE; close(FILE); foreach $i (@indata) { #remove hard return character from each record chomp($i);

Array Problem

2002-01-15 Thread maureen
Hello! I hope someone can help me. I am working on the following code, written to accomplish these tasks: 1)Accept username and password from an HTML page 2)Open a text file and store the username and passwords listed there in an array 3)Compare the username and password in the array to the

Array Problem.

2001-12-10 Thread Andre` Niel Cameron
Hi, I have a prob:) I need to search threw an array and remove an item based on its name. I was thinking about maybie a for each loop but I am not sure how to go about it. Heres what I need to do: say $object= sword; I have an array @AllObjects('beer', 'nuts', 'sword', 'and more stuff') Now

Re: Array Problem.

2001-12-10 Thread Curtis Poe
--- Andre` Niel Cameron [EMAIL PROTECTED] wrote: Hi, I have a prob:) I need to search threw an array and remove an item based on its name. I was thinking about maybie a for each loop but I am not sure how to go about it. Heres what I need to do: say $object= sword; I have an array