Hi everyone,
I'll admit, I'm brand spankin' new to Perl and programming in general (I have some experience with HTML but that was years ago). I picked up Perl as a hobby and I'm very interested in becoming decent at it. I was advised to come here by my programming friends - they have many great things to say about this community, and so, here I am :)
Although I am learning from couple of books (Apress; Beginning Perl, 3rd Ed. and Perl for Dummies 5th Ed.) I am having trouble with my first assignment from the Beginning Perl book fro Apress - the assignment is to create a basic Hello World.pl file and execute it.
So here is the deal, I'm on Ubuntu, and I follow the instructions as detailed below from my book:
1)The book tells me to crack open a text editor and write this:
#!/usr/bin/perl
use warnings;
print "Hello World!\n";
2) Next, the book instructs me to go my command terminal and create two directories. The way it instruct me, is that it tells me to type the following in the command terminal:
$ mkdir begperl
$ cd begperl
3) Next the books instructs me to save the file from step 1 as helloworld.pl and save it in the directory that was made. What confusing to me is, I do not know exactly which directory it's referring me to - I should also point out I'm somewhat new to Ubuntu as well (been using it for 2 weeks now) so perhaps I just dont know how to save it properly?
4) The book asks me to go to my command terminal and type the following:
$ perl helloworld.pl
and the book shows that it's supposed to show up on the screen as Hello World!
Thats really where I run into my problem.
You see, every time I try to run it, it tells me it cannot be ran, because no such files or directory exist. But, I followed every step to the letter, I dont know why it's saying it doest find anything. In fact, I navigated to the actual 2 directories I was instructed to create, and I found the .pl file there.
So I'm actually stuck, and I'm not sure exactly what I'm doing wrong.
Please help out dear monks :)
-Samurai Monkey
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.