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

    A great article -


    ....the only thing about it i didnt like was that closing note ' well be back in a couple of weeks.....' - ya mean we have to wait that long for the next in this great series?!
    <br>
    <br>
    :)
  2. #2
  3. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)
    John,

    We'll do our best to make the wait less tiresome - we've got some exciting stuff coming up over the next few weeks. So stay tuned!

    Thanks for the praise - we're glad you liked the article :)

    Vikram Vaswani
    Melonfire
    http://www.melonfire.com
  4. #3
  5. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    just a suggestion...


    could you include links to previous entries at the top of each article for the people like me that arrive late in the series and also links that progress for people that start from the beginning.
    <br>
    <br>
    thanks for listening!
  6. #4
  7. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Linking Error


    Hi,
    I'm just getting into server side languages, so I was just downloading your articles, and I noticed that the link to number 4 actually goes to number 2! I had to manually type in the url.

    Just thought you might like to know so you could fix it.

    D@nny
    http://WebFever.cjb.net
  8. #5
  9. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    help


    i'm trying to use the example script mind
    but to no use, i keep getting this message:
    bash: ./mnd.pl: no such file or directory

    i have no idea what is wrong could some1 give me a hint, please? :)

    the code i use is this:
    Code:
    #!usr/bin/perl
    
    open(MIND,"> thoughts.txt") or die "cannot open file: $! \n";
    	
    print <MIND>;
    
    close(MIND);
    print("bijna klaar Shane, nog ff doorzeten jong");
  10. #6
  11. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: help


    Try this:
    <br>
    #!usr/bin/perl
    <br>
    open(MIND,"> thoughts.txt") or die "cannot open file: $! n";
    <br>
    print MIND "bijna klaar Shane, nog ff doorzeten jong";
    <br>
    close(MIND);
    <br>
    <br>
    Keep in mind that this won't append to the end of the file, but rather it will wipe whatever is in mind.txt and replace it with your new data. If thoughts.txt doesn't exist, it will create a new file.
    <br>
    -Matt
  12. #7
  13. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: help


    

    i forgot the slash before usr:(
    #!usr/bin/perl = #!/usr/bin/perl

    thank you for your time and help matt :)
    with regards,
    shane
  14. #8
  15. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Problems with checking if a file exists.


    Run through a browser this gives me the loved "Internal Server Error":

    <!-- Code -->
    <p><pre><font color=#008000><xmp>
    $path ="/usr/local/apache/index.htm";
    if (-e $path)
    {
    print "File exists!\n";
    }
    else
    {
    print "nope";
    }
    </xmp></font></pre><p>
    <!-- Code -->

    But when run from a shell it runs just fine.
    Is there a different way to do this. I dont see what could be wrong.
  16. #9
  17. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: A great article -


    Likewise - refreshing to see a programming guide so concise and simple to follow - I'm becoming hooked on Perl after this - please sir may we have some more...?
  18. #10
  19. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Problems with checking if a file exists.


    Yes there is a difference. When printing to a browser you have to proceed it with a header to let the browser know what type of data it is receiving. In this case, it's text/html. So at the top of your program type
    <br>
    <br>
    print "Content-type: text/html\n\n";
    <br>
    <br>
    It must have two newlines ("\n"). This tells the browser that it has reached the end of the document headers, and to display anything it receives from now on.
    <br>
    <br>
    Also, you have to be sure you're including the path to perl at the top of your program. Apache (or whatever web server) will use that to know what interperter to use.
    <br>
    <br>
    - Amir
  20. #11
  21. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    ":" not expected


    I get the following error after copying and pasting the code form the web pade into dtpad & "chmod +x fileTwo.pl":

    Enter path to file:
    ./fileTwo.pl[5]: 0403-057 Syntax error at line 6 : `;' is not expected.

    The first few lines are:
    <snip>
    #!/usr/bin/perl

    # ask for file path and process it
    print "Enter path to file: ";
    $path = <STDIN>;
    chomp $path;

    # test for existence
    if (-e $path)
    {
    print "File exists!\n";

    # test for size
    if (-z $path)
    {
    print "File is empty.\n";
    }
    else
    {
    print "File is not empty.\n";
    }

    # test for read access
    if (-r $path)
    </snip>
    The closing "}" for the if is just b4 the "else" way down the page...
    What am I missing?
    Thanks!
    John
  22. #12
  23. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Excellent !


    I really learned a lot! Keep them coming!
  24. #13
  25. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    a good article !


    Being beginner in perl I've been reading some doco about Perl for the last 2 weeks. This is probably the best simple, concise and feature-rich tutorial about Perl I've seen so far.

    Good work !!
  26. #14
  27. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Killer!


    I really wish I had found this series on Perl earlier. You guys did a great job of helping me review and understand the basics of Perl.

    Thanks!
    ~Tom
  28. #15
  29. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Great Article!


    Thanks for these articles.
    They are very clear and easy to follow.
    The way the general discussion of file input and array functions such as pop() and slice() etc led into the excellent text to HTML perl example is brilliant in that it illustrated the points with code I can use and adapt immediately.
    To sum up - thanks greatly and well done!!
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo