Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #81114

Re: Perl question **solved **

From Lars Poulsen <lars@beagle-ears.com>
Newsgroups comp.os.linux.misc
Subject Re: Perl question **solved **
Date 2026-01-14 13:09 +0000
Organization A noiseless patient Spider
Message-ID <slrn10mf5c5.2q1o6.lars@cleo.beagle-ears.com> (permalink)
References <slrn10me2bs.2q1o6.lars@cleo.beagle-ears.com>

Show all headers | View raw


On 2026-01-14, Lars Poulsen <lars@beagle-ears.com> wrote:
> [Posted here, beause I can't find a live perl group; if you know of one,
> please refer me there.]
>
> I had a strange problem pop up today. I am working on a msall program,
> and my program file starts with something like this:
>      #! /usr/bin/perl
>      #
>          use strict;
>      my $aaa;
>      my @bbb = ( # "1ab",
>                    "2bc",
>                    "3cd"
>                ):
>
> Program runs fine, when I pun it using "perl program".
> But when I "chmod +x program" and run it as "./program"
> it has syntax errors on "use strict;" and on the commented
> out first line of @bbb.
>
> I am puzzled. Why would that be? For my use today, it does not
> matter, but I have not seen this before, and I keep the "use strict;"
> line in all my production code. Any hints for how to figure out what's
> wrong?

To those who told me it is silly to post an abbreviated version that
might contain typos or other significant deviations:
  Yes, you are right, and as noted, the colon on the last line is indeed a
  typo.

To those who asked for a more detailed error message than just "syntax
error":
  That really was all I got:
          Syntax error on line xxx near "?some tokens?"
  Which means that the error is so stupid you should be able to see it
  at a glance.

*** Resolution ***

Yes, it really was COMPLETELY STUPID, as I knew it was.
And I found it when I came back after sleeping on it.

There was a blank line at the top, and the error messages must
have come from the shell (bash) rather than from perl.
-- 
Lars Poulsen - an old geek in Santa Barbara, California

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Perl question Lars Poulsen <lars@beagle-ears.com> - 2026-01-14 03:11 +0000
  Re: Perl question Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-01-14 05:42 +0000
  Re: Perl question Anssi Saari <anssi.saari@usenet.mail.kapsi.fi> - 2026-01-14 10:28 +0200
  Re: Perl question Richard Kettlewell <invalid@invalid.invalid> - 2026-01-14 08:49 +0000
    Re: Perl question Mike Scott <usenet.16@scottsonline.org.uk.invalid> - 2026-01-14 10:07 +0000
      Re: Perl question Giovanni <lsodgf0@home.net.it> - 2026-01-14 11:38 +0100
  Re: Perl question ram@zedat.fu-berlin.de (Stefan Ram) - 2026-01-14 10:44 +0000
    Re: Perl question Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-01-14 11:07 +0000
  Re: Perl question **solved ** Lars Poulsen <lars@beagle-ears.com> - 2026-01-14 13:09 +0000
    Re: Perl question **solved ** Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-01-14 20:53 +0000
      Granularity of programs (was: Re: Perl question **solved **) Nuno Silva <nunojsilva@invalid.invalid> - 2026-01-14 23:51 +0000
        Re: Granularity of programs c186282 <c186282@nnada.net> - 2026-01-14 20:40 -0500
  Re: Perl question Eric Pozharski <apple.universe@posteo.net> - 2026-01-14 13:29 +0000
    Re: Perl question Eli the Bearded <*@eli.users.panix.com> - 2026-01-15 06:11 +0000
      Re: Perl question Eric Pozharski <apple.universe@posteo.net> - 2026-01-16 21:34 +0000
  Re: Perl question rbowman <bowman@montana.com> - 2026-01-14 19:06 +0000

csiph-web