Re: Neater way to declare variables

2009-01-08 Thread Ron Bergin
On Jan 8, 3:56 am, andrew.tayl...@hmrcaspire.com (Andrew Taylor) wrote: > Hello > > I have a script that is (at one point) reading through a file.  The file > is processed line by line and each line split into an array like so: > > while (<$TESTFILE>) > > { > >   my $cur_line=$_; > >   chomp ($cur_

Re: Neater way to declare variables

2009-01-08 Thread Jenda Krynicky
From: "Taylor, Andrew \(ASPIRE\)" > I have a script that is (at one point) reading through a file. The file > is processed line by line and each line split into an array like so: > > while (<$TESTFILE>) > { > my $cur_line=$_; > chomp ($cur_line); while (defined(my $cur_line = <$TESTFILE>))

Re: Neater way to declare variables

2009-01-08 Thread Telemachus
On Thu Jan 08 2009 @ 11:56, Taylor, Andrew (ASPIRE) wrote: > # In a number of places, I have code that looks like the following. > > > > my $default_type; > > > > if( $split_line[0] eq "DEFAULT_INPUT" ) > > { > > $default_type = "INPUT"; > > } > This works OK, but I'm tryin

Re: Neater way to declare variables

2009-01-08 Thread Mr. Shawn H. Corey
On Thu, 2009-01-08 at 11:56 +, Taylor, Andrew (ASPIRE) wrote: > This works OK, but I'm trying to avoid declaring variables seperately > from assigning them (wherever possible), and trying to keep the size > of > the script down without losing human legibility. > > Is there a neater/cleverer

Neater way to declare variables

2009-01-08 Thread Taylor, Andrew (ASPIRE)
Hello I have a script that is (at one point) reading through a file. The file is processed line by line and each line split into an array like so: while (<$TESTFILE>) { my $cur_line=$_; chomp ($cur_line); my @split_line = split( /$t_delim/, $cur_line ); # In a numbe