justin423 has asked for the wisdom of the Perl Monks concerning the following question:

I have never seen this before. here is the code. use Term::ReadKey; ReadMode('noecho'); $tbpass = ReadLine(0); I am getting this message: Bad name after noecho' What is even weirder is that i get it even when it is commented out with a "#". is this because there is a single ' higher in the code?

Replies are listed 'Best First'.
Re: bad name on a commented out line
by AnomalousMonk (Archbishop) on Feb 13, 2018 at 02:11 UTC
    is this because there is a single ' higher in the code?

    If your code looks something like this:

    my $unterminated_single_quote = '<-- this is not terminated; use Term::ReadKey; ReadMode('noecho'); $tbpass = ReadLine(0);
    then yes. Single-quoted strings can contain embedded literal newlines (update: i.e., single-quoted strings can be multi-line strings).

    Update: Please see Quote and Quote-like Operators and Quote-Like Operators in perlop.


    Give a man a fish:  <%-{-{-{-<