Hello dear monks, thank you for helping me with my previous question regarding my first assignment which I was given by the book I'm learning from. In the second assignment, I've been given an exercise which asks the practitioner to compare two files. Firstly, it asks me to type the code
print "Hi Mom.\nThis is my second program.\n" I open up my text editor in ubuntu, and type up this code:
#!/usr/bin/perl
use warnings;
print "Hi Mom.\nThis is my second program.\n";
and I save it as "newline.pl"
Unfortunately, when I open up the terminal in Ubuntu, it doesn't work. I typed in
perl begperl/newline.pl I specified begperl as the folder because that's where it is located.
However, I get this message back: "Can't open perl script "begperl/newline.pl": No such file or directory"
I then tried writing the code as
print "Hi mom. This is my second program." and saved it as
newline.pl and still I got the same message returned to me as: "Can't open perl script "begperl/newline.pl": No such file or directory"
That's funny to me because when I created helloworld.pl that is the same folder where I saved it in, and it worked just like it was supposed to. I'm not sure as to why it's not working now. When I type in
perl begperl/helloworld.pl it still works fine, I get the message, Hello World! What am I doing wrong?
Thank you for your suggestions in advance - it's highly appreciated :)
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.