Open a text editor. Type into your text editor the following:

use strict; use warnings; print "Hello world.\n";

Now save the file with a name of "mytest.pl" in a directory that's easy to find from the command line. Then start a CMD shell. Change directory into the path where you just saved your file. Type the following:

perl mytest.pl

Your little test script will run, and will print "Hello world." Now you wrote your first program, and executed it. This may not be the sleekest way to start up a Perl script, but it's guaranteed to work as long as you've got Perl installed correctly. If it doesn't work for you, go ask if you can have your old job back instead.

Once you've accomplished getting your script to run, you've resolved about half of what I understood you to be asking in your question... at least if I understood part of it. It was pretty incomprehensible in the first place.

We've now shown you how to get the elevator to go to the 5th floor. I'm guessing we'll be asked which button to push to get it to go to the 6th next. It might be a good idea to hire a tutor for a few hours to get you started in the right direction. It seems like whatever is needed we're not succeeding in providing.

By the way: After reading over your question a few times I just don't see how file handles and streams relate to the question. I realize i haven't provided any insight there, but it just seems like if you're having trouble getting a script to run, we ought to address that first before moving on to file IO.


Dave


In reply to Re: how to create a perl program using filehandle and streams ? by davido
in thread how to create a perl program using filehandle and streams ? by Monk_perl

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.