User Profile

Collapse

Profile Sidebar

Collapse
Albert Cardenas
Albert Cardenas
Last Activity: Apr 18 '12, 04:45 AM
Joined: Mar 21 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Albert Cardenas
    replied to My average
    in Perl
    Thank you! I appreciate the help. Code works great now! I just had to modify and add the "g" at the end

    [CODE=perl]$filesize =~ s/,//g;[/CODE]

    So now it looks like

    [CODE=perl]#!/usr/bin/perl
    open (ALBERT_LAB, "Lab3.txt") or die ("Cannot open file");
    while(<ALBERT_L AB>)
    {
    chomp;
    ($date, $time, $ampm, $filesize, $filename) = split("...
    See more | Go to post

    Leave a comment:


  • Albert Cardenas
    replied to My average
    in Perl
    Excuse my ignorance but I literally started learning Perl 2 days ago just for this one assignment I have to do and I have no idea about your comment?

    Are you saying I need to remove a specific comma from my code? or the comma from the line of code you gave me?

    secondly, I dunno if I'm supposed to replace a certain line of code with the code you gave me or if I'm supposed to add it to the lab?

    Sorry, I'm trying...
    See more | Go to post

    Leave a comment:


  • Albert Cardenas
    started a topic My average
    in Perl

    My average

    I'm trying to figure this out but my $average is not calculating right.

    My $filesize is supposed to add into my $totalFileSize after every iteration. Then $totalFileSize is supposed to be divided by $count and that NUMBER is supposed to equal $average.

    Here is my code and the output I get.

    -----------------------------------------------------------
    Code:
    #!/usr/bin/perl
    open (ALBERT_LAB, "Lab3.txt")
    ...
    See more | Go to post
    Last edited by Frinavale; Mar 21 '12, 01:43 PM. Reason: Added code tags.
No activity results to display
Show More
Working...