On Thu, 2009-01-08 at 11:56 +0000, 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 way of doing this? >
Programming is as much about organization and communication as it is about coding. It is possible to write your code too densely to be easily understood. However you can shorten some of your code. while (<$TESTFILE>) { chomp; my @split_line = split( /$t_delim/, $_ ); my %Default_types = ( DEFAULT_INPUT => 'INPUT', DEFAULT_OUTPUT => 'OUTPUT', ); $default_type = $Default_types{$split_line[0]} || undef; -- Just my 0.00000002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. "It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years." --John von Neumann, circa 1950 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/