Thanks a lot guys, and you were right I should start learning some perl, I didn't realize How far behind I was. I did start some reading I did lot of research on google read lot of scripts, and I started to like perl. Maybe I am at the wrong forum( if I am could point me to the right direction)., cuz I am just a beginner. And I think perlmonks is for more advanced help. You may laugh at my problems, but everybody is at different stage of knowledge. any ways. I did start lab09 on my own today. Could you please tell me guys what do you think and if there is any errors, here is lab 9 and I am really sorry if I am waisting your time. this would be my last thing asking.


Script 1
Create a script named “lab09-1” script to:
Display your full name (first and last) on the 1st line
The script should
o accept filenames as command line arguments
o each record in the file is a numeric value
o accumulate each value into a total amount field
o print each value (zero decimal places) formatted as follows:


File name Value (print heading)
Filename1 1000 (print each detail value indicating the file it is from)

o when all records from all files have been processed print the total
Display a message on the last line indicating the script is finishing
Filenames: lab6, myfile, alpha, bones

here is the script

#!/perl/bin/perl
#
# Author: L.H
# Script Name: lab6-1
# Date Written: March 15, 2005
#Purpose: Basic I/0
#
#

foreach $file (@ARGV) {
open(FILE, "$file");


while (<FILE>) {

$sum+=$_;
print "$file $_";
}
print "$sum";
}

but I still can't get total for each file, so far I managed to get the total for one file only.


In reply to Re^2: Solution for your prof by kocaweb
in thread <> diamond Operator by kocaweb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.