Dear Monks, The simplest script #!/usr/bin/perl use strict; use warnings; print "Hello, World...\n"; Works fine in my computer (Printing in the CMD screen "Hello World") but in other computers did not print anything on the screen after installing the same perl version. What is happening?

That's pretty unusual, and I think you'll have to explain exactly how you're calling this script on both computers so we can help you better. Since you say "CMD" I guess this is Windows? Are you using ActivePerl or Strawberry Perl, and what version? When you open the command prompt on both computers and type perl -v, it should output the same thing; that's assuming your PATH environment variable is set up correctly; if for example you're using the portable edition of Strawberry Perl, you'll have to navigate to its folder first (Update: or use its batch file to start the shell). It should also do the same when you type perl scriptname.pl for your script filename. Or, are you double-clicking the scripts to run them? Note that this sometimes requires additional steps to get working. (By the way, please use <code> tags to format code and data.)


In reply to Re: Print hello world not working by haukex
in thread Print hello world not working by ferbio

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.