Perl problems
GavinWraith (26) 1563 posts |
!Builder just does not work for me. I have discovered that when BuildSys.perl.ImageName gets run by !Builder the ENV array is empty. If I add a line defining $dir to the value it should have it runs further but then complains that SYSTEM is undefined. So I need to find out why ENV appears to be empty when the script is run from !Builder. If I run it directly, and add in the line print ”$x”; in the for-loop defining envmap I can see that ENV is not empty. So the problem lies not in the script itself but in its being called by !Builder. Has anybody else had this problem? What a vile * of a language Perl is, by the way. What masochists the poor Perl-hackers must be! |
GavinWraith (26) 1563 posts |
To reply to myself: I see that at the bottom of the !Help file in Apps.!Perl there was a bug with %ENV not initialised, supposed to be fixed in Port 1.51. I have a nasty feeling that that may be over-optimistic. Most C source files have a header file detailing the default maximum sizes of various things – stacks, etc, on a per platform basis. I could not find it in RISCOS.Utilities.Perl. Does anybody know where that information has been hidden? |
GavinWraith (26) 1563 posts |
I have been investigating the Perl provided for !Builder a bit further, and looking at Steve Ellacott’s code for creating the ENV array. What I find odd about Perl in general is its insistence on having an %ENV array at all, without providing a builtin function to mimic ANSI C’s getenv() in stdlib, which is no doubt implemented directly using the OS_ReadVarVal SWI. Why should you ever need to know what all the system variables are in a RISC OS context? You only need to evaluate the system variables that you are interested in. Believe it or not, ENV is created for this implementation of Perl by writing the results of the show command into a temporary file and then reading and analysing the file. Talk about a waste of effort! No doubt Perl was the only tool available in the early days of Acorn, and no doubt there are reasons why one might want %ENV in a Unix context rather than just a getenv() function; but in a RISC OS context it makes little sense to use %ENV at all. On my system (RISC OS 5.13) when !Builder uses Perl the %ENV array is empty and I just get error messages. Has anybody succeeded in building anything on an Iyonix? |
Steve Revill (20) 1361 posts |
I have. Exactly as released (make sure you’ve installed the patch-one update). The secret is to make sure the Perl which your system sees is the one we released. If you have another version of Perl on your Iyonix, it’s probably getting in the way and breaking everything. Unset perl* and then manually run Apps.!Perl in our release and you should find that the build works. |
GavinWraith (26) 1563 posts |
There is another Perl hidden away on my hard disc, but it is not filer_booted at startup, and *show gives the version in the ROOL distribution; so that is not my problem. I am really puzzled why !Builder does not work – I followed all the instructions. |