Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    What about Attachments!


    I am running around the net like a Carl Lewis, trying to find an easy perl sciprt to allow a file to be emailed. How do you do THAT!

    K
  2. #2
  3. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: What about Attachments!


    http://www.stonehenge.com/merlyn/WebTechniques/col46.html
    maybe?
  4. #3
  5. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Counter


    Opening a file is a high overhead operation (in processing time.) Much more efficient to open in read write mode:
    <CODE>
    open(FH,"+<$FileName);
    $Counter = <FH>;
    chomp($Counter);
    $Counter++;
    seek(FH,0,0);
    truncate(FH,0);
    print FH "$Count\n";
    close (FH);
    </CODE>

    Also, on an active site, you want lock the file or else there is a chance someone else could accidently reset the counter to zero.
  6. #4
  7. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    or die()


    It is always good practice to add a die() statment when opening a file.

    An example:

    <!-- Code -->
    <p><pre><font color=#008000><xmp>
    open(IN,$file) or die "Cannot open $file: $!";
    </xmp></font></pre><p>
    <!-- Code -->


    $! contains the reason why the file wasn't opened.
  8. #5
  9. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: What about Attachments!


    Thanks

    I'll look into it
  10. #6
  11. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    How?


    Hello.

    I am really new to PERL and want to know where to put all of the code. What I mean is where do I paste the CGI bit and the HTML bit etc...

    Also after I have cut & pasted the code into my HTML doc, do I have to type any more code or variables into it?

    Thanks for your help.

    Clueless.
  12. #7
  13. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    How?


    Hello.

    I am really new to PERL and want to know where to put all of the code. What I mean is where do I paste the CGI bit and the HTML bit etc... (in what order).

    Also after I have cut & pasted the code into my HTML doc, do I have to type any more code or variables into it?

    Thanks for your help.

    Clueless.
  14. #8
  15. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: or die()


    Its happening man.
  16. #9
  17. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Garbage Characters


    I was able to get this program up and running w/o any problems, but any punctuation left in the comments field is converted into ASCII. Any way around this?
  18. #10
  19. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Counter


    This has been a very enjoyable series. I haven't written this much code in years!

    How is locking done? That indeed is important. I had to abandon my old counter because it would reset often -- that was why.
  20. #11
  21. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Counter


    <CODE>
    open(FILE,"+<$FileName");
    flock(FILE,2);
    open read update and write back
    flock(FILE,8)
    </CODE>
    one caveat, only works on Unix systems.

    Urb
  22. #12
  23. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Field checking


    How do you set it up so it checks to make sure all the fields were entered and have valid information?
  24. #13
  25. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)
  26. #14
  27. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Confused!


    hey!

    Well the tutorial was good and i must say very informative. I have C/C++ knoledge and I am working a s an intern for a firm. IT needed me to read Perl tutorial which i did and it wwas very informative.

    The only thing which is baffling me or i am still confused is about what is CGI script and whats the use of it with webpages where should we have these things. I mean all was going well till this CGI script and all. I don't get whole of it.

    Thankx
    Jawad.
  28. #15
  29. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo