1 msgSpreadsheet::ParseExcel::SaveParser
4 msgFinding a printer; need help

Basic PERL Script
\ Bernard Hill (6 May 2008)
. \ Bill Luebkert (6 May 2008)
. \ Washburn, Frederick (6 May 2008)
. \ Brian Raven (6 May 2008)
. \ Andy_Bach (6 May 2008)

14 msgthreads package missing is_running
1 msgDB_File Module not working
2 msgPERL Telnet Script problem
5 msgGetting MIME::Lite working on Windows
7 msgActivePerl 822 and Windows GUI look/feel
1 msgGD and libgd, please help
2 msgbroken perlapp in version 5-10.
1 msgperl installation wizard
5 msggetopt long
1 msgANNOUNCE: ActiveState Perl Dev Kit 7.2 released
3 msgFW: ActivePerl-5.8.8.822-MSWin32-x86-280952.msi...
2 msgRe: PerlScript - FileSystemObject - Windows Scr...
3 msgppm
7 msgActivePerl 5.10 and Oracle/ODBC
Subject:Basic PERL Script
Group:Activeperl
From:Bernard Hill
Date:6 May 2008


 

Good morning, All.
<br>
<br>Not sure if this list supports basic questions, but I'll pose the query to find out.
<br>
<br>I am new to PERL and working on an basic PERL script. The script will import values into an array. when complete, I want to do a calculation based on two feilds and drop the answer into the third field. Basically I have the following script, but keep getting a syntax error and can't figure out where I've gone wrong:
<br>
<br>sub {
<br> $output = '';
<br>
<br> chomp $_[0];
<br> $delim = $_[1];
<br> @input_fields = split /$delim/, $_[0];
<br>
<br> # input the values into the array
<br> for($i=0; $i<$#input_fields; $i++) {
<br> if i$ == 2
<br> {
<br> # perform the calculation
<br> $input_fields[$i] = $input_fields[$i-1] * $input_fields[$i-2];
<br> }
<br> output = $output . $input_fields[$i] . $delim;
<br> }
<br>
<br> $output = $output . $input_fields[$#input_fields] . "\n";
<br> return($output);
<br>}
<br>
<br>Any help is grealy appreciated!
<br>
<br>Barney
<br>


_______________________________________________
ActivePerl mailing list
ActivePerl
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


© 2004-2008 readlist.com