Re: How do I dynamically adjust to CSV format?

2008-03-25 Thread Chas. Owens
On Tue, Mar 25, 2008 at 9:22 PM, Dennis G. Wicks <[EMAIL PROTECTED]> wrote: > Greetings, > > I get data in CSV files from several different sites > and I can't get the date/time formats to be consistent, > let alone have the fields arranged in the same order. > > I can put in the field/column n

Re: How do I dynamically adjust to CSV format?

2008-03-25 Thread yitzle
If there is a header row that describes what is in each column, you can use the contents of that column's header as a hash key... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Running an interactive program with filehandles

2008-03-25 Thread Chas. Owens
On Tue, Mar 25, 2008 at 8:30 PM, ANJAN PURKAYASTHA <[EMAIL PROTECTED]> wrote: snip > HP->autoflush(1); snip > Unfortunately this gives me a list of errors: > > perl handle_test.pl > Can't locate object method "autoflush" via package "IO::Handle" at > handle_test.pl line 7. snip In order to u

How do I dynamically adjust to CSV format?

2008-03-25 Thread Dennis G. Wicks
Greetings, I get data in CSV files from several different sites and I can't get the date/time formats to be consistent, let alone have the fields arranged in the same order. I can put in the field/column names by hand in a first record but I can't find hoe to go about using them to change m

Running an interactive program with filehandles

2008-03-25 Thread ANJAN PURKAYASTHA
Consider the following program- HydrophobicityProfiler.pl Here is a sample run of the program: perl HydrophobicityProfiler.pl Enter the name of the sequence file (try protein.txt) and then press Enter: ../data/protein.txt Enter the desired window size as an odd number and then press Enter: 5 Which

Re: Question about CGI.pm

2008-03-25 Thread Mark Wagner
On 3/25/08, LesleyB <[EMAIL PROTECTED]> wrote: > > I'm using the OO form in case that makes any difference. Assuming a > 'my $qry = new CGI;' > > The first sentence > "By default, all HTML that is emitted by the form-generating functions > is passed through a function called escapeHTML(): " >

Re: copy array

2008-03-25 Thread John W. Krahn
[EMAIL PROTECTED] wrote: On Mar 25, 8:50 am, [EMAIL PROTECTED] (Sharan Basappa) wrote: Is there a way I can copy only part of an array into another array. For example, I want to copy only first 8 elements of source array into destination array. You can use the splice( ). See example: #!/usr

Re: Plotting widget in Perl?

2008-03-25 Thread Chas. Owens
On Tue, Mar 25, 2008 at 2:52 PM, Gowtham M <[EMAIL PROTECTED]> wrote: > Thanks for the help. I tried to install Gtk2::Ex::Graph::* modules. > Couldn't succeed. > > There was an error while building GD.pm: snip > Indeed, this structure is not having 'gd_free' member! snip > What have I missed? Is th

Re: subroutine

2008-03-25 Thread Chas. Owens
On Tue, Mar 25, 2008 at 1:47 PM, Bobby <[EMAIL PROTECTED]> wrote: > Hi, > > I need another set of eyes to help look over the codes below. I have a > subroutine that check for a comma in $strA and do some regex replacement, if > there's no comma then return the values of the two arguments passed

Re: Plotting widget in Perl?

2008-03-25 Thread Gowtham M
Thanks for the help. I tried to install Gtk2::Ex::Graph::* modules. Couldn't succeed. There was an error while building GD.pm: gcc -c -I/usr/include -I/usr/include/gd -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_O

subroutine

2008-03-25 Thread Bobby
Hi, I need another set of eyes to help look over the codes below. I have a subroutine that check for a comma in $strA and do some regex replacement, if there's no comma then return the values of the two arguments passed to it. The IF in my sub worked but the Else part didn't return any thing wh

Re: Plotting widget in Perl?

2008-03-25 Thread Chas. Owens
On Tue, Mar 25, 2008 at 1:31 PM, Gowtham M <[EMAIL PROTECTED]> wrote: > Hello experts, > > This question is related to GUI development with perl. I am > willing write a perl script which I can use to visualize some > data. > > Basically, I have two tables. > > Table1 > (x1, y1), (x2, y2) .

Plotting widget in Perl?

2008-03-25 Thread Gowtham M
Hello experts, This question is related to GUI development with perl. I am willing write a perl script which I can use to visualize some data. Basically, I have two tables. Table1 > (x1, y1), (x2, y2) ... (xn, yn) Table2 > (a1,b1), (a2,b2), . (am,bm) I am looking for a Widge

Re: Concatenating Strings

2008-03-25 Thread Bobby
Thanks for all your input, using a hash does make things a lot easier for me. Rob Dixon <[EMAIL PROTECTED]> wrote: kens wrote: > > # Or if you must use a counter > > my $count = 0; > > while ( defined($strA[$count]) ) > { >print "$strA[$count++]\n"; > } for my $count (0 .. $#strA) { p

Re: Really literal string

2008-03-25 Thread Gunnar Hjalmarsson
Chas. Owens wrote: #!/usr/bin/perl use strict; use warnings; my $s = 'foo $bar baz'; print "$s\n"; $s = <<'END_OF_STRING'; $s used to hold just: foo $bar baz END_OF_STRING print $s; It should be noted that those methods are not quite equivalent. C:\home>type test.pl my $s = 'My programs

Re: copy array

2008-03-25 Thread Chas. Owens
On Tue, Mar 25, 2008 at 12:14 PM, LesleyB <[EMAIL PROTECTED]> wrote: snip > BTW I use a Debian system and use perldoc quite a lot. To check the > syntax for this problem I did > 'perldoc perlintro' and then searched for the word array. The > solution to your problem is there. Not sure how yo

Question about CGI.pm

2008-03-25 Thread LesleyB
Hi I have been exploring CGI.pm and am of course interested in the HTML escaping procedure. perldoc CGI thrwos up this "By default, all HTML that is emitted by the form-generating functions is passed through a function called escapeHTML(): $escaped_string = escapeHTML("unescaped string")

Re: copy array

2008-03-25 Thread LesleyB
Sharan Basappa wrote: > Hi, > > Is there a way I can copy only part of an array into another array. > For example, I want to copy only first 8 elements of source array > into destination array. > > Regards I think you might need this technique #!/usr/bin/perl -w use strict; # my @arr1 =

Re: Really literal string

2008-03-25 Thread Gunnar Hjalmarsson
Keenlearner wrote: I like to store multiline perl code inside a scalar variable, but I don't want perl to interpolate the variable inside the code. my $t = "abc"; my $s = < Use single quotes. my $s = <<'TEXT'; http://perldoc.perl.org/perlop.html#Single-Quotes -- Gunnar Hjalmarsson Email

Re: Really literal string

2008-03-25 Thread Jenda Krynicky
From: Keenlearner <[EMAIL PROTECTED]> > I like to store multiline perl code inside a scalar variable, but I > don't want perl to interpolate the variable inside the code. > > my $t = "abc"; > > my $s = < This is a test $t > TEXT > > The above code still interpolate the string. I know that I can

Re: Really literal string

2008-03-25 Thread Chas. Owens
On Tue, Mar 25, 2008 at 12:01 PM, Keenlearner <[EMAIL PROTECTED]> wrote: > I like to store multiline perl code inside a scalar variable, but I > don't want perl to interpolate the variable inside the code. > > my $t = "abc"; > > my $s = < This is a test $t > TEXT > > The above code still inte

Re: Really literal string

2008-03-25 Thread Rob Dixon
Keenlearner wrote: I like to store multiline perl code inside a scalar variable, but I don't want perl to interpolate the variable inside the code. my $t = "abc"; my $s = < If you put your terminating identifier in single-quotes, it behaves as if the entire here-document is in single-quotes:

Re: copy array

2008-03-25 Thread Keenlearner
On 25 Mar, 23:50, [EMAIL PROTECTED] (Sharan Basappa) wrote: > Hi, > > Is there a way I can copy only part of an array into another array. > For example, I want to copy only first 8 elements of source array > into destination array. > > Regards Sure there is, @rainbow = ("red", "green", "blue", "y

Re: copy array

2008-03-25 Thread [EMAIL PROTECTED]
On Mar 25, 8:50 am, [EMAIL PROTECTED] (Sharan Basappa) wrote: > Hi, > > Is there a way I can copy only part of an array into another array. > For example, I want to copy only first 8 elements of source array > into destination array. > > Regards Hi, You can use the splice( ). See example: #!/us

Really literal string

2008-03-25 Thread Keenlearner
I like to store multiline perl code inside a scalar variable, but I don't want perl to interpolate the variable inside the code. my $t = "abc"; my $s =

Re: copy array

2008-03-25 Thread Rob Dixon
Sharan Basappa wrote: On Tue, Mar 25, 2008 at 9:31 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: >> Sharan Basappa wrote: > Hi, > > Is there a way I can copy only part of an array into another array. > For example, I want to copy only first 8 elements of source array > into destination array.

Re: copy array

2008-03-25 Thread Sharan Basappa
thanks. I can also assume that variables work instead of 0..7 ($1..$2) so that I can write this as an general algo On Tue, Mar 25, 2008 at 9:31 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > > Sharan Basappa wrote: > > Hi, > > > > Is there a way I can copy only part of an array into another array.

Re: copy array

2008-03-25 Thread Rob Dixon
Sharan Basappa wrote: Hi, Is there a way I can copy only part of an array into another array. For example, I want to copy only first 8 elements of source array into destination array. my @dest = @source[0..7]; Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

copy array

2008-03-25 Thread Sharan Basappa
Hi, Is there a way I can copy only part of an array into another array. For example, I want to copy only first 8 elements of source array into destination array. Regards -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: how to replace @ inside of { }

2008-03-25 Thread Gunnar Hjalmarsson
Rob Dixon wrote: Richard Lee wrote: Gunnar Hjalmarsson wrote: C:\home>type test.pl use Data::Dumper; my %HoA = ( something => [ qw/val1 val2 val3 and so forth/ ], something2 => [ qw/vala valb valc and so forth/ ], something3 => [ qw/valZ valZ1 valZ2 so forth/ ], ); my %HoH; while

Re: Info from flat file

2008-03-25 Thread Chas. Owens
On Tue, Mar 25, 2008 at 3:32 AM, Manoj <[EMAIL PROTECTED]> wrote: > Chas, > > I have a question on this. Will the pattern $/ used considered for other > opened files also? I was trying to match the IP with ip-host file and > considering the whole ip-host text file as single line even though ther

RE: Info from flat file

2008-03-25 Thread Manoj
Chas, I have a question on this. Will the pattern $/ used considered for other opened files also? I was trying to match the IP with ip-host file and considering the whole ip-host text file as single line even though there is newline. Can you shower some light in this? Thanks K -Original Mes