I sincerely doubt that XP or Strawberry has anything to do with this!
This very simple program should work on any version of Perl and on any platform!
use warnings;
use strict;
print "type something: ";
my $input = <STDIN>;
print "you typed", $input;
# of course:
# print "you typed $input";
# would be the same
I don't know if you are using some kind of development environment to run the code or not? Save this .pl file
verbatim and run it from the Windows XP command line - not from within any development environment.
Before posting, I tested this on Win XP to avoid a typo problem. I am using an Active State build, but that shouldn't matter in the slightest.
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.