I'm going to have to refresh or deepen my knowledge of the usage of "farction". :-)

Possibly that's just a typo, in which case, this may be too:

print "Line number $. ls: $_";
  which may be intended to be:
print "Line number $. is: $_";

OTOH, if it's really intended to be ls you may profit by reading about exec, system and backticks.

Or is there some other typo which merely makes ls appear nonsensical inside double quotes in a print statement?

Afterthought: Did you intend your script to look like this?

#!/usr/bin/perl # Cosmo Learning File Open operation PERL(II) class lecture. 814366 $fname = "814366.txt"; open XYZ, $fname, or die "Error open: $!"; while (<XYZ>) { print "Line number $. ls: $_"; } # Does not farction "line 7: syntax error near unexpected token from + shell!!`)'

If so, as you've been advised, use code tags, or -- more verbosly -- pay attention to the advisories below the text entry box and read Markup in the Monastery.


In reply to Re: Syntax Problem / Padre vs Command Line by ww
in thread Syntax Problem / Padre vs Command Line by aridzonan

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.