in reply to Syntax Problem / Padre vs Command Line

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.

Replies are listed 'Best First'.
Re^2: Syntax Problem / Padre vs Command Line
by ww (Archbishop) on Dec 28, 2009 at 01:24 UTC
    For the benefit of all intrigued by OP's problem, he replied to my post above, by private message, thusly:
    aridzonan says Re Re: Syntax Problem / Padre vs Command Line Made the changes you suggested with the same "Unexpecte token" err. Is there an perl enviromental variable that I need to set? Padre has no problem with this bit of code. However, KDevelop, Eric and Shell return the err.

    aridzonan: that doesn't exactly enlighten me on what you did, so perhaps you'll post for the benefit of all of us -- yourself included.