home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.linux.misc      Linux-specific topics not covered by oth      135,536 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 134,787 of 135,536   
   Lars Poulsen to Lars Poulsen   
   Re: Perl question **solved **   
   14 Jan 26 13:09:25   
   
   From: lars@beagle-ears.com   
      
   On 2026-01-14, Lars Poulsen  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   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca