New and struggling

Discussion in 'Scripting & Programming' started by PhoenixAngelique, Feb 3, 2008.

  1. PhoenixAngelique

    PhoenixAngelique Byte Poster

    100
    0
    23
    I'm doing a CIW Master etc. and have come to the end of the perl section and for the first time during the course I feel like cracking my head on a brick wall.

    I passed all of my assessments at nothing below 90% but I just cannot grasp what I'm supposed to be doing for this one final part.

    I went right the way back to the beginning of the section and am doing all of the practical bits again but have no idea how I got a section of code to pull information from a seperate text file. I guess it doesn't help that insomnia has kicked in and I'm ill so my focus isn't at it's best but is there any chance anyone can help me out with this?

    It's driving me crazier than I already am :)
     
    WIP: CIW Master Website Design Manager
  2. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,624
    117
    224
    I do a lot of programming in Perl so I may be able to help.

    I take it this is a TMA? If so which one? (rather than dumping possibly copyright stuff into the forum!)

    Harry.
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+
  3. PhoenixAngelique

    PhoenixAngelique Byte Poster

    100
    0
    23
    Thanks Harry,

    The part in my origional post thatI was rambling about is from a Lab file and is stopping me doing the TMA below (It's pretty much the entirety of the darned thing).

    It's number 10 the final one of the section (my brain has gone dead lol) - create a perl program that analyses texts files on their content.

    It has to check for an argument and if none exists, prompt for and allow input of the filenme manually.
    The filename has to be checked to ensure it's in MS-DOS format, be no longer than 8 characters. If no ext given must add .TXT itself and remain same if ext exists.
    If filename is incorrect format it should display an appropriate error message.

    Program then needs to check if filename exists using the filename given to it, if not suitable error message then end.
    If filname exists but is empty, message and end.

    The file should then be read and checked to display crude stats on the number of characters, words, lines, sentences and paragraphs within the file.

    That's my bulletpoint version of what the thing says. Why do they take pleasure in wording these do it from scratch one's so confusingly?!
     
    WIP: CIW Master Website Design Manager
  4. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,624
    117
    224
    You *should* have covered all the requirements in earlier modules. It may help to go back and revise them.
    Use @ARGV
    'split' and 'length' will get you started here
    'stat' might be used here.
    Count the lines as you read the file and accumulate the other stats.
    I thought that was fairly clear. If you are going to be creating web pages it is important to be able to read and understand 'requirements' documents! :p

    Harry.
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+
  5. PhoenixAngelique

    PhoenixAngelique Byte Poster

    100
    0
    23
    lol yeah i simplified what they had said into that little part - it took them 3 sides of A4 to say everything that i just smmarised.

    I AM going back through from the beginning but there seems to be a part where they just don't explain it properly so it gets you confused and frustrated and as a result leaves you kind of unable to grasp it.

    You have actally helped immensly. Thank you. I've been trying t reak it down like that in my own mind for 2 days and haven't been able. Sometimes it just needs a fresh pair of eyes/set of brain cells.
     
    WIP: CIW Master Website Design Manager
  6. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,624
    117
    224
    'Breaking things down' is actualy a very important part of programming.

    The trick is to sub-divide the problem over and over. Eventualy you get to small parts where the code to do each part is (usualy) obvious. You build up these parts to get the whole program.

    Harry.
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+
  7. PhoenixAngelique

    PhoenixAngelique Byte Poster

    100
    0
    23
    I agree Harry, just been tough to do that recently. I've been ill and obsessing over the thing ehich made it hard for me to do - usualy not an issue for me :)
     
    WIP: CIW Master Website Design Manager

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.