On Tue, Sep 04, 2001 at 04:01:26PM +0200, Yves Bastide wrote:
> On Tue, Sep 04, 2001 at 02:22:56PM +0100, Jose Abilio Oliveira Matos wrote:
> >   
> >   As a curiosity, did reLyX worked before?
> >   I guess that if it work then we had a strange case of interaction beetween
> > BLOCK and the variable outside. Hardly what anyone would expect.
> 
> BEGIN blocks are executed immediately after compilation.  Variable names
> are known, but assignments in "my" constructs haven't been done yet.
> 
> With the previous version of reLyX, try
> $ perl -w reLyX-1.2 
> you'll get
> Use of uninitialized value in concatenation (.) or string at
> /usr/local/bin/reLyX-1.2 line 52.
> 
> the uninitialized value being $mainscript...

Good point. I think you need to do 

   use vars qw($whatever @variables $you're_setting_in_the_BEGIN)

in the BEGIN block in order to get the vars to work. I might be wrong though
:)

> BTW (Amir I guess?) why 
> #!/usr/bin/perl
> then
> $^W = 1; # same as 'perl -w'
> 
> ?  This disables -w in the BEGIN {}, as seen here

Good question. I don't know why we did that. My guess is that the configure
tool that writes the first line couldn't for some reason add the -w, so we
used ^W instead. However, this was all done 2 or 3 years ago, so I don't
remember. 

In fact:

##########################
fermi2:~/lyx/reLyX>rlog -r1.5 reLyX.in

[snip]
File which configure turns into an executable wrapper for reLyX
----------------------------
revision 1.5
date: 1998/11/02 15:10:14;  author: karger;  state: Exp;  lines: +3 -1
Use $^W instead of -w switch, because Jean-Marc asked me to.
###########################

Aha! JMarc, do you remember why we did this?

-Amir

Reply via email to