Hello all, Im new to perl and perl monks. Im reading perl in 24 hours by Clinton Pierce.

Most books who promise you to learn X in Y hours, days, weeks, any, generally lie and most often are just crap. Now, IIRC this particular one is a notable exception.

My question is: My first program, #!usr/bin/perl print "Hello, World!\n"; When I bring up my ms dos and type in "perl hello" I get this message, Can't open perl script "Hello": Permission denied. Can somone please tell how I get permission. thanks

(BTW: use <code> tags for writing code here, even if it's very short like in this case.)

That's strange, there should be no permission issues under Windows. Aren't you using cygwin by any chance? Whatever, if you have installed Activeperl, the installation program should have set the .pl association for you which means you can call your program hello.pl and run it like thus:

C:\temp>hello.pl Hello, World

Additionally, you can add .pl to the PATHEXT environment variable, which comes handy if you write some utility and put it somewhere in your PATH, so that you can call it utility.pl but you will run it without specifying the extension:

utility argument1 argument2...

Now, coming to your problem, how is you program actually called? Just hello? Isn't it by any chance hello.pl?


In reply to Re: Can't open perl script: Permission denied by blazar
in thread Can't open perl script: Permission denied by Chris21

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.