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,782 of 135,536   
   Mike Scott to Richard Kettlewell   
   Re: Perl question   
   14 Jan 26 10:07:59   
   
   From: usenet.16@scottsonline.org.uk.invalid   
      
   On 14/01/2026 08:49, Richard Kettlewell wrote:   
   > Lars Poulsen  writes:   
   >> 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?   
   >   
   > I have two hints:   
   >   
   > 1. Post the actual script, not a different script that is “something   
   >     like” it.   
   >   
   > 2. Post the errors you get, not just say that they are “syntax errors”.   
   >   
   > I have no idea why you think anyone would be able to debug your real   
   > script when they can’t see it. We’re not telepaths.   
      
   True, but that last colon should be a semicolon. Does the shebang allow   
   a space?   
   >   
      
      
   --   
   Mike Scott   
   Harlow, England   
      
   --- 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