magic line 
Author Message
 magic line

Hello everybody,

I'm running perl 5.002 with Tk b11.02 on HPUX. The company standard is
to install local applications under /cadappl which is automounted. The
applications are started from $HOME/cadbin/appl which is a link to
/cadappl/some/dir/appl.
I installed perl under /cadappl/packages/gnu/perl5.002 and created a
link $HOME/cadbin/perl -> /cadappl/packages/gnu/perl5.002/bin/perl.

Now I experince a strange behaviour with the magic line. The following
script runs just fine:

#!/user/duebi/cadbin/perl -w
use strict;
use Tk;
my $main = new MainWindow;
$main->Label(-text => 'Hello, world!')->pack;
$main->Button(-text => 'Quit',
              -command => sub{exit}
             )->pack;
MainLoop;

When I change the magic line to read

#!/cadappl/packages/gnu/perl5.002/bin/perl -w

I get the following errors:

./testpTk.pl[2]: use:  not found
./testpTk.pl[3]: use:  not found
./testpTk.pl[4]: my:  not found
./testpTk.pl[4]: syntax error at line 5 : `(' unexpected

Any ideas ?

All hints and suggestions are greatly appreciated.
TIA
Bernhard

--
Philips Semiconductors
----------------------------------------------------------
Telecom Product Group   Berhard Duebi
Binzstrasse 44          System Manager

CH-8045 Zuerich         Fax:    +41 1 465 18 06
Switzerland             Voice:  +41 1 465 15 40



Sat, 21 Nov 1998 03:00:00 GMT  
 magic line

Quote:

>Hello everybody,

>I'm running perl 5.002 with Tk b11.02 on HPUX. The company standard is
>to install local applications under /cadappl which is automounted. The
>applications are started from $HOME/cadbin/appl which is a link to
>/cadappl/some/dir/appl.
>I installed perl under /cadappl/packages/gnu/perl5.002 and created a
>link $HOME/cadbin/perl -> /cadappl/packages/gnu/perl5.002/bin/perl.

>Now I experince a strange behaviour with the magic line. The following
>script runs just fine:

>#!/user/duebi/cadbin/perl -w

 1234567890123456789012345678   = 28 chars (-w switch before 32)

Quote:
>use strict;
>use Tk;
>my $main = new MainWindow;
>$main->Label(-text => 'Hello, world!')->pack;
>$main->Button(-text => 'Quit',
>              -command => sub{exit}
>             )->pack;
>MainLoop;

>When I change the magic line to read

>#!/cadappl/packages/gnu/perl5.002/bin/perl -w

 123456789012345678901234567890123456789012345  = 45 (perl interp beyond 32)

Quote:
>I get the following errors:

>../testpTk.pl[2]: use:  not found
>../testpTk.pl[3]: use:  not found
>../testpTk.pl[4]: my:  not found
>../testpTk.pl[4]: syntax error at line 5 : `(' unexpected

>Any ideas ?

>All hints and suggestions are greatly appreciated.

Well Bernhard this is only a suggestion - as right at the moment I don't have
access to an hpux machine - but I think you may be experiencing the difficulty
mentioned in the perlrun(1) man page:

    Because many operating systems silently chop off kernel
    interpretation of the #! line after 32 characters, some switches
    may be passed in on the command line, and some may not; you
    could even get a "-" without its letter, if you're not careful.

so '32' is a magic number - perhaps you should just go with the symlink (?)

If it is any consolation, you can be quite thankful that you are not running
Ultrix where even the symlink trick will not work! (I know I tried :(

I may be wrong on this, however.

Peter Prymmer



Sun, 22 Nov 1998 03:00:00 GMT  
 magic line

Quote:

> I'm running perl 5.002 with Tk b11.02 on HPUX. The company standard is
...
> script runs just fine:

> #!/user/duebi/cadbin/perl -w
> When I change the magic line to read

> #!/cadappl/packages/gnu/perl5.002/bin/perl -w

> I get the following errors:

    Just a guess, but your magic line is greater than
32 characters.  This one bit me on the {*filter*}in Solaris,
and your version of HPUX may have this limitation, too.
Maybe not, but it doesn't hurt to rule it out.

Aaron



Sun, 22 Nov 1998 03:00:00 GMT  
 magic line

Bernhard doesn't say which version of HPUX, but this is exactly the
behavior I get under HPUX 9.04.

Greg



Tue, 24 Nov 1998 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. help - 3 magic lines sorting large text

2. line termination cleaning (AKA: White Magic)

3. Magic #! line problem

4. Embedded Magic.

5. CGI.pm name-and-file-handle magic? variable

6. Magic String - Tying and overloading

7. perl5/Tk magic "Ev" variables

8. make -- magic like ++ is?

9. perl v.s. inetd (I forgot the magic)

10. more with magic variables: I guess I'm being stupid

11. info on perl magic?

12. module proposal - file recognition magic in perl

 

 
Powered by phpBB® Forum Software