perl.riscos http://www.nntp.perl.org/group/perl.riscos/ ... Copyright 1998-2015 perl.org Fri, 27 Mar 2015 20:27:24 +0000 ask@perl.org File::Find by Derek.Moody Hi Folks,<br/><br/>Perl 5.8.8-1 RO 3.7 in raFS<br/><br/>Can someone check the following:<br/>Substitute appropriate directories for &#39;dira dirb&#39; (shift-drag) and see how<br/>deep this script goes...<br/><br/>########################<br/><br/>#!/usr/bin/perl -w<br/><br/>use File::Find;<br/>use strict;<br/><br/>my @dirs= qw/ dira dirb /;<br/><br/>find(\&amp;wanted, @dirs);<br/><br/>sub wanted{<br/>print &quot;$File::Find::dir - $_\n&quot;;<br/>}<br/><br/>########################<br/><br/>It only goes one directory deep here :-(<br/><br/>Runs full depth on my linux box.<br/><br/>Cheerio,<br/><br/>-- <br/>&gt;&gt; derek.moody@clara.net<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2008/04/msg327.html Wed, 09 Apr 2008 07:35:13 +0000 Re: CGI module by Derek.Moody On Fri 13 Oct, Colin Foster wrote:<br/><br/>&gt; Have been trying to use the CGI module but find that the statement<br/>&gt; $name = param(&#39;name&#39;); and others does not work.<br/><br/>For what value of not working?<br/><br/>&gt; The CGI package requires 5.004 and is copyrighted 1995-1998. I am <br/>&gt; using it with Perl 5.8.8 and WebJames RiscOS 5.11<br/><br/>Using 5.8.8 CGI.pm 3.15 WebJames 0.47 and RISCOS 3.7 under raFS<br/><br/>No problem here, the following works as expected:<br/><br/>#######################<br/><br/>#!perl -w<br/><br/>use strict;<br/>use CGI qw/:standard/;<br/><br/>my $name=param(&#39;name&#39;);<br/><br/>print header,start_html(&#39;What I got&#39;),h1(&quot;I got $name&quot;);<br/><br/>print end_html;<br/><br/>#######################<br/><br/>On my setup I have to dial-up the Next slot a bit - try about 5Mb.<br/><br/>Still no joy?<br/>To see if you&#39;ve a naming mismatch insert this before the last line:<br/><br/>print p(&#39;Here is a list of all parameters and their values:&#39;);<br/>print &quot;&lt;dl&gt;\n&quot;;<br/>if (param()){<br/> foreach my $entry (param){<br/> print &quot;&lt;dt&gt;$entry&lt;/dt&gt;&lt;dd&gt;&quot;<br/> .param($entry)<br/> .&quot;&lt;/dd&gt;\n&quot;;<br/> }<br/>}<br/>print &quot;&lt;/dl&gt;\n&quot;;<br/><br/><br/>&gt; Is there a more up to date CGI module available.<br/><br/>The latest on CPAN is 3.25 but I doubt there&#39;s anything there that would<br/>make any difference to parameter access. When your setup runs out of steam<br/>you&#39;ll gain a lot more by switching to a dedicated host than you will by<br/>tweaking modules on RISCOS.<br/><br/>Cheerio,<br/><br/>-- <br/>&gt;&gt; derek.moody@clara.net<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2006/10/msg326.html Fri, 13 Oct 2006 07:00:26 +0000 CGI module by Colin Foster Hi,<br/><br/>Have been trying to use the CGI module but find that the statement<br/>$name = param(&#39;name&#39;); and others does not work.<br/><br/>The CGI package requires 5.004 and is copyrighted 1995-1998. I am <br/>using it with Perl 5.8.8 and WebJames RiscOS 5.11<br/>Is there a more up to date CGI module available.<br/><br/>Regards,<br/>Colin.<br/><br/><br/> http://www.nntp.perl.org/group/perl.riscos/2006/10/msg325.html Fri, 13 Oct 2006 04:25:16 +0000 Re: Out of memory! by Alex Waugh Philip Perry &lt;pjperry@freeuk.com&gt; wrote:<br/><br/>&gt; Hello All,<br/>&gt; <br/>&gt; Is there any way around the 28640K memory limit for a TaskWindow?<br/>&gt; <br/>&gt; Posted to both RISCOS Perl list and AoL as though the difficulty arises<br/>&gt; from a BIG perl hash it appears to be limited by RISCOS (3 &amp; 4). rather<br/>&gt; than Perl itself.<br/><br/>There are two options:<br/>Use RISC OS 5, which raises the limit to 1GB.<br/>Make Perl use a dynamic area for the heap.<br/><br/>The latter can be done by editing !Perl.!Boot to set Perl$Heap rather<br/>than unset it. However, this will stop system() and similar functions<br/>from working correctly. As your script doesn&#39;t use these functions then<br/>it should be fine.<br/><br/>Alex<br/><br/>-- <br/>Alex Waugh alex@alexwaugh.com<br/><br/>PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/<br/> http://www.nntp.perl.org/group/perl.riscos/2006/08/msg324.html Sun, 20 Aug 2006 15:29:35 +0000 Re: Out of memory! by Philip Perry Hello All,<br/><br/>Is there any way around the 28640K memory limit for a TaskWindow?<br/><br/>Posted to both RISCOS Perl list and AoL as though the difficulty arises<br/>from a BIG perl hash it appears to be limited by RISCOS (3 &amp; 4). rather<br/>than Perl itself.<br/><br/>A little background:<br/><br/>I&#39;ve recently been investigating the idea of a<br/>dynamic &#39;mutable base&#39; position value number system (place notation). A<br/>number system similar to the familiar decimal/arabic system but with<br/>each column base determined by the number of digits in the preceding<br/>column(s). There is no limit, theoretically, on how many digits a column<br/>may hold. And this mutable base system has no &#39;zero&#39; (which implies a<br/>set base or pattern of bases), rather the previous history of the<br/>number... how it built up its earlier columns, is stored in place of<br/>zero.<br/><br/>A particular feature of this system is that many, indeed most, numbers<br/>can be accessed by more than one digit sequence. Primes are the<br/>exception, they have only one sequence. In contrast to the primes, some<br/>numbers are fecund, relative to their size, for example 1296<br/>(2x2x2x2x3x3x3x3) can be expressed as 70 different combinations of<br/>columns of 2 and 3 digits... and beyond the 70 arrangements there are<br/>all the multiplied out possibilities like 4x2x2x27x3. Other numbers have<br/>a particularly diverse &#39;quality&#39;, for example 210 (2x3x5x7) with 24<br/>different digit sequences, contrasting with 64 which has many<br/>&#39;multiplied out&#39; arrangements of 2s, but a bare sameness to them all.<br/><br/>Another feature of this number system is that all numbers possess a<br/>&#39;prime state&#39; -i.e. for the number 210, one column of 210 digits! And a<br/>&#39;ground state&#39; -i.e. 7x5x3x2, a column of 7 units, followed by a column<br/>of 5 digits, followed by a column of 3 digits followed by a column of 2<br/>digits. It is convenient to express the column digits as decimal<br/>numbers, eg. for the number 24... in two columns... 3~ 8 or 4~ 6. [From<br/>the EofM articles you might recognise these two digit sequences as a<br/>perfect cadence (chords V7 -&gt; I) taken in isolation.]<br/><br/>I am not much of a programmer and use Perl in the spirit of Basic for<br/>the ordinary user on the early Archimedes... to solve my own problems<br/>and tasks (well sometimes). The task here (below) is to write out all<br/>the different arrangements of columns which access a given number. The<br/>script below has been a bit of a struggle, is probably needlessly<br/>complex, and relies on checking new arrangements against those already<br/>found... thus the BIG hash in the second section. There is I expect a<br/>simple routine to do this, but I haven&#39;t been able think of it :-( I am<br/>still trying, however, this one does do the job. The problem with it is<br/>that beyond mutable base numbers of eight columns the script requires<br/>more than than 28640K of memory. The TaskWindow gives up: &quot;Out of<br/>memory!&quot;<br/><br/>My computer has 72MB of memory, is there any way for the TaskWindow to<br/>access this? Or some other way around it? I have RO 3 and 4 machines and<br/>Perl 5.8.8.<br/><br/>Best regards, Philip.<br/><br/><br/><br/>#!perl<br/>#digseq - finds all possible arrangements of a set of digits, that is,<br/># all the unique nested configurations of a mutable base number, for<br/># example, M60[5] nesting M6 nesting M2 - (h1,2,3,4,5,10,15,30). This<br/># MBN 30 can be accessed by six alternative digit sequences: 5~3~2,<br/># 5~2~3, 3~5~2, 3~2~5, 2~5~3 and 2~3~5; each physically distinguishable<br/>#<br/># Usage: [perl] digseq -n&lt;number&gt;<br/># i.e. perl digseq -n210<br/># Usage: [perl] digseq -f&lt;factor,factor,...&gt;<br/># i.e. perl digseq -f2,3,5,7<br/># Usage: [perl] digseq -h<br/>#<br/># First the script works out the prime factors of the given number.<br/># The &#39;factors&#39; (@digits) are marked as &#39;positions&#39; (0..n) in @array.<br/># The $total (max number of possible arrangements) is worked out and<br/># @array filled with positions 0..n. Next two randomly chosen positions<br/># are swapped and the new sequence of positions checked for already<br/># existing as a key in %digseq. Random swapping is redo-ne until an<br/># unknown sequence is found. Then the algorithm after the else statement<br/># finds a &#39;sector&#39; of the total positions. The while loop continues this<br/># cycle until all possible positions ($total) are reached. There is some<br/># redundancy in these sectors, but it does eventually find everything.<br/># As the script relies on a random search, this can take some time for 8+<br/># digits, so perhaps running as a background task is a good idea. There is<br/># I expect a more efficient recursive algorithm, but it has eluded me :-(<br/># Once $total is reached, the postions are turned into the original digits<br/># and printed out. Where the digits or factors are not unique i.e. 2,2,3,3<br/># (but the positions are) the %hash keys winnow out multiple arrangements.<br/># The output is in the form: digit sequence =&gt; number of identical seq.<br/># copyright pjperry@freeuk.com 2006.<br/><br/>use strict;<br/>my @digits;<br/>{<br/> my $number = undef;<br/><br/> if ($ARGV[0] =~ /^-n/) { #Get conversion option (s2e or e2s)<br/> $number = substr($ARGV[0], 2); #score2event-list or vice versa.<br/> if ( $number &lt; 1 || $number != int($number) ) { # Check input.<br/> print &quot;digseq script accepts only positive whole numbers.&quot;;<br/> print;<br/> &amp;help_usage(); <br/> exit 0;<br/> }<br/><br/> } elsif ($ARGV[0] =~ /^-f/) {<br/> my $factors = substr($ARGV[0], 2); #score2event-list or vice versa.<br/> @digits = split /,/, $factors; # Maybe check for pos whole numbers?<br/><br/> } else {<br/> print &quot;Usage: [perl] digseq -n&lt;number&gt;\n&quot;;<br/> print &quot;i.e. perl digseq -n210\n&quot;;<br/> print &quot;Usage: [perl] digseq -f&lt;factor,factor,...&gt;\n&quot;;<br/> print &quot;i.e. perl digseq -f2,3,5,7\n&quot;;<br/> print &quot;Usage: [perl] digseq -h\n&quot;;<br/> print &quot;Sorry, further help text not written yet.\n&quot;; <br/> #&amp;help_usage(); #Print help/usage &amp; close.<br/> exit 0;<br/> }<br/><br/> #--- first section finds the prime factors of a given number ---<br/> if ( $number ) {<br/> my ($num, $j, $i, $n, $n_sqd, $s_sqd, $s, $f1, $f2, $m, $p);<br/> my (@pairs, @primes, @primes2);<br/><br/> $num = $number; # Reduce to odd number<br/> while ($num % 2 == 0 &amp;&amp; $num &gt; 1) { # placing 2 factors in<br/> push @digits, 2; # @digits.<br/> $num /= 2;<br/> }<br/> <br/> if ($num &gt; 1) { # Find all factors and multiples<br/> $j = int( sqrt($num) ) + 1; # of rump odd $num (&gt;1) left<br/> $i = 2; # from divide by 2, above.<br/> $n = $num;<br/> while ( $n &gt; $j ) {<br/> $n = ($num / $i) + ($i / 4); # Resonance algorithm, whole<br/> if ( $n == int($n) ) { # numbers signal factor/multiple.<br/> $n_sqd = $n * $n;<br/> $s_sqd = $n_sqd - $num;<br/> $s = sqrt( $s_sqd );<br/> $f1 = $n + $s;<br/> $f2 = $n - $s;<br/> push @pairs, $f2; # Put results in @pairs<br/> push @pairs, $f1;<br/> }<br/> $i += 4;<br/> }<br/> #print &quot;Pairs = @pairs\n&quot;;<br/> shift @pairs; # First pair 1 and $num, discard 1.<br/> foreach (@pairs) { # Sieve out primes from multiples<br/> $m = &amp;primeFactor($_); # by running them through the &#39;res<br/> if ($m &gt; 0) { # algorithm&#39; again, one by one,<br/> push @primes, $m; # primes will only produce a single<br/> } # pair - see sub primeFactor.<br/> }<br/> $n = $num; # Now we have each unique prime,<br/> foreach $p (@primes) { # (above 2) but for many numbers<br/> my $go = 1; # they may be used more than once.<br/> while ($go == 1) { # So divide $num by each unique $p<br/> push @primes2, $p; # in turn, and check if &#39;mod the<br/> $n = $n / $p; # result&#39; allows another division<br/> if ($n % $p != 0) { # by $p, until no more, then pass<br/> $go = 0; # on to next unique $p.<br/> }<br/> }<br/> }<br/> @primes2 = sort { $a &lt;=&gt; $b } @primes2;<br/> @digits = (@digits, @primes2); # sort the sieved primes and store<br/> } # in @digits after any twos.<br/> print &quot;Prime factors of $number are: @digits\n&quot;;<br/> }<br/>}<br/><br/> #--- Second section find all unique arrangements of the digits---<br/><br/>{<br/> my ($total, $keyCount, $r, $r2, $tmp, $str, $cnt, $key);<br/> my (@array, @backwards, @fields, %digseq, %hash, @k); <br/> my $n = $#digits; # How many digits?<br/> my $np1 = $n + 1; # Save a few cpu cycles.<br/><br/> $total = 1;<br/> foreach (0..$n) { # Setup total posible seqences<br/> $total = $total * ($_ + 1);<br/> $array[$_] = $_; # Setup &#39;positions&#39; of @digseq<br/> } # values in @array.<br/><br/> $keyCount = 0;<br/> while ($total &gt; $keyCount) {<br/> $r = int(rand($np1)); # Start redo here.<br/> $r2 = int(rand($np1));<br/> $tmp = $array[$r]; # Do random swap of @array positions.<br/> $array[$r] = $array[$r2];<br/> $array[$r2] = $tmp;<br/> $tmp = &quot;&quot;;<br/> $str = join &quot; &quot;, @array; # Join poistions into digit seq str.<br/> $str .= &quot; &quot;;<br/> if ( exists $digseq{$str} ) {<br/> $str = &quot;&quot;; # Is it a new sequence? Or redo.<br/> redo;<br/> } else {<br/> $str = &quot;&quot;;<br/> foreach (0..$n - 1) { # Find a &#39;sector&#39; of arrangements.<br/> my ($a, $b); # Avoid conflict with sort<br/> foreach (0..$n) { <br/> foreach (@array) { $str .= &quot;$_ &quot; }<br/> $digseq{$str} += 1; # BIG hash<br/> $str = &quot;&quot;;<br/> @backwards = reverse @array;<br/> foreach (@backwards) { $str .= &quot;$_ &quot; }<br/> $digseq{$str} += 1; # Nominal &#39;1&#39;, key holds the positions.<br/> $str = &quot;&quot;;<br/> $a = shift @array;<br/> push @array, $a; <br/> } # Value $a carried over from rotation.<br/> pop @array; # Pops $a back out, Here the first<br/> $b = shift @array; # &amp; second values are rotated.<br/> unshift @array, $a;<br/> unshift @array, $b;<br/> }<br/> }<br/> $keyCount = keys %digseq;<br/> print &quot;digit sequences found: $keyCount, out of total possible: $total\n&quot;;<br/> }<br/><br/> @k = keys %digseq; # Turn positions held in keys into <br/> foreach (@k) { # their values (factors) plus ~<br/> @fields = split /\s+/, $_;<br/> foreach (@fields) {<br/> $str .= &quot;$digits[$_]~ &quot;; <br/> }<br/> $str = substr($str, 0, (length($str) - 2)); # Clip final &#39;~ &#39;<br/> $hash{$str} += 1; # Sieve out duplicte arrangements<br/> $str = &quot;&quot;; # and record how many.<br/> }<br/><br/> foreach $key (sort {$a &lt;=&gt; $b} keys %hash) {<br/> $cnt++; # Sort by first digit and count.<br/> print &quot;$key =&gt; $hash{$key}\n&quot;; # Turn off warnings: str not numeric.<br/> }<br/> print &quot;total number of possible configurations: $total\n&quot;;<br/> print &quot;total number of different configurations: $cnt\n&quot;;<br/>}<br/>exit 0;<br/><br/> #---- This subroutine is used by the first section of the script ----<br/> sub primeFactor { # Sub is handed one factor/multiple.<br/> my ($num, $j, $i, $n, $n_sqd, $s_sqd, $s, $f1, $f2, $tot, $z, @pairs );<br/> $num = $_[0];<br/> $j = int( sqrt($num) ) + 1; # Sub splits $num into all possible<br/> $i = 2; # whole factor/multiples. Primes get<br/> $n = $num; # only 1 and $num, none primes have<br/> while ( $n &gt; $j ) { # more than one pair.<br/> $n = ($num / $i) + ($i / 4); # Resonance algorithm, whole<br/> if ( $n == int($n) ) { # numbers signal factor/multiple.<br/> $n_sqd = $n * $n;<br/> $s_sqd = $n_sqd - $num;<br/> $s = sqrt( $s_sqd );<br/> $f1 = $n + $s;<br/> $f2 = $n - $s;<br/> push @pairs, $f2;<br/> push @pairs, $f1;<br/> }<br/> $i += 4;<br/> }<br/> $tot = @pairs; # If only one pair, the arg/$num is<br/> if ($tot == 2) { # prime and is returned, otherwise<br/> $z = $_[0]; # zero.<br/> } else {<br/> $z = 0;<br/> }<br/> } <br/><br/><br/><br/>-- <br/>Philip Perry, pjperry@freeuk.com<br/>http://www.pjperry.freeuk.com/<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2006/08/msg323.html Sun, 20 Aug 2006 14:47:28 +0000 Re: Anyone using 5.8.8 & WebJames 0.47 ? by Derek.Moody On Wed 02 Aug, Derek.Moody wrote:<br/>&gt; <br/>&gt; Can anyone replicate this?<br/><br/>Ah, er, don&#39;t bother - sorted it - my fault as I&#39;d half guessed.<br/><br/>It was a testing artifact - when I reinstated the old versions and retested<br/>the same occurred - I had added a couple of new routines to one of my<br/>library scripts and masked CGI::header() - of course I hadn&#39;t bothered to<br/>retest -working- scripts on the old setup :-(<br/><br/>And no harm done as the local library is just a dev&amp;test environment.<br/><br/>Thank you for your attention - and sorry to waste it.<br/><br/>Cheerio,<br/><br/>-- <br/>&gt;&gt; derek.moody@clara.net<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2006/08/msg322.html Wed, 02 Aug 2006 23:54:32 +0000 Anyone using 5.8.8 & WebJames 0.47 ? by Derek.Moody Can anyone replicate this?<br/><br/> Perl 5.8.8<br/> WebJames 0.47 - vial localhost loopback, Ant.<br/><br/>On upgrading both recently I found some (previously OK) local Perl cgi<br/>scripts were failing.<br/><br/>Minimal Perl script:<br/><br/>print &quot;One\nTwo\n&quot;;<br/><br/>If run directly it produces the expected output, if invoked via WebJames the<br/>output is:<br/><br/>One[00]Two<br/><br/>Where [00] is a null byte.<br/><br/>(When I use CGI.pm, the symptom persists. Carp and Strict don&#39;t illuminate.)<br/><br/>Now I&#39;ve probably missed a setting somehere but...<br/><br/>Cheerio,<br/><br/>-- <br/>&gt;&gt; derek.moody@clara.net<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2006/08/msg321.html Tue, 01 Aug 2006 23:26:22 +0000 Re: Perl 5.8.8 by Philip Perry On Mon 17 Apr, Alex Waugh wrote:<br/>&gt; <br/>&gt; Hi<br/>&gt; <br/>&gt; I&#39;ve updated my Perl port to version 5.8.8.<br/>&gt; It available as usual from http://www.alexwaugh.com/perl/<br/>&gt; <br/>&gt; Enjoy.<br/><br/>Many thanks.<br/><br/>I have it up and running on RO 3.6 and 3.71 (yet to put it on RO 4)<br/>and can report that it is working fine with Sean Burke&#39;s MIDI modules.<br/><br/>Thanks again, Philip.<br/><br/><br/>-- <br/>Philip Perry, pjperry@freeuk.com<br/>http://www.pjperry.freeuk.com/<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2006/04/msg320.html Tue, 25 Apr 2006 15:28:50 +0000 Perl 5.8.8 by Alex Waugh Hi<br/><br/>I&#39;ve updated my Perl port to version 5.8.8.<br/>It available as usual from http://www.alexwaugh.com/perl/<br/><br/>Enjoy.<br/><br/>Alex<br/><br/>-- <br/>Alex Waugh alex@alexwaugh.com<br/><br/>PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/<br/> http://www.nntp.perl.org/group/perl.riscos/2006/04/msg319.html Mon, 17 Apr 2006 14:54:33 +0000 Perl 5.8.6 by Alex Waugh Hi<br/><br/>http://www.cp15.org/perl/ now contains a port of Perl 5.8.6, including<br/>a working system() function. Please have a play with it and let me know<br/>of any problems.<br/><br/>Alex<br/><br/>-- <br/>Alex Waugh alex@alexwaugh.com<br/><br/>PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/<br/> http://www.nntp.perl.org/group/perl.riscos/2005/03/msg318.html Wed, 23 Mar 2005 16:02:33 +0000 Re: How do I get Perl to work correctly with WebJames by Alex Waugh In message &lt;ec889c264d.Alan.Adams@orchard-way.freeserve.co.uk&gt;<br/> Alan Adams &lt;alan.adams@orchard-way.freeserve.co.uk&gt; wrote:<br/><br/>&gt; There was a comment in the WebJames instructions to make sure Perl doesn&#39;t<br/>&gt; run in a task window. Does anyone know how to achieve that?<br/><br/>The default attributes file supplied with WebJames is setup to achieve<br/>that. The relevant lines are:<br/><br/>Action perl-script perl %f %u<br/>AddFiletypeHandler perl-script Perl<br/><br/>Which sets all files filetyped as Perl to use the perl-script action,<br/>which is defined as calling perl directly rather than relying on the<br/>contents of the alias$@runtype_102 system variable which may be using a<br/>taskwindow.<br/><br/>Alex<br/><br/>-- <br/>Alex Waugh alex@alexwaugh.com<br/><br/>PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/<br/> http://www.nntp.perl.org/group/perl.riscos/2005/01/msg317.html Sun, 02 Jan 2005 05:55:15 +0000 How do I get Perl to work correctly with WebJames by Alan Adams Having done most of the development work on a PC, using Active Perl and<br/>Apache, I&#39;m now trying to move the code to WebJames. Initial results were<br/>good, until I tried a CGI script written in Perl. I am using<br/><br/>#!perl -w<br/>#<br/>use CGI qw/:standard/;<br/>use CGI::Carp qw/fatalsToBrowser/;<br/>#<br/> <br/>which I expected to send errors to the browser. Instead it opens them in a<br/>task window.<br/><br/>(Before I made some changes to the !Boot and !Run files it opened in a fixed<br/>size window, which closed as soon as I clicked anywhere. At least the<br/>current window can be resized.)<br/><br/>There was a comment in the WebJames instructions to make sure Perl doesn&#39;t<br/>run in a task window. Does anyone know how to achieve that?<br/><br/>Alan Adams.<br/><br/>-- <br/>Alan Adams<br/>alan.adams@orchard-way.freeserve.co.uk<br/>http://www.nckc.org.uk/<br/> http://www.nntp.perl.org/group/perl.riscos/2005/01/msg316.html Sat, 01 Jan 2005 13:12:43 +0000 Re: Slightly nervous cough ... by Richard Proctor On Mon 20 Sep, Kris Adcock wrote:<br/>&gt; Anyone here? Or have I missed the party again?<br/><br/>Yes, but it is quiet...<br/><br/>Richard<br/><br/>&gt; <br/>&gt; Cheers,<br/>&gt; <br/>&gt; Kris.<br/>&gt; <br/>&gt; <br/><br/>-- <br/>Personal Richard@waveney.org http://www.waveney.org<br/>Telecoms Richard@WaveneyConsulting.com http://www.WaveneyConsulting.com<br/>Web services Richard@wavwebs.com http://www.wavwebs.com<br/>Independent Telecomms Specialist, ATM expert, Web Analyst &amp; Services<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2004/09/msg315.html Mon, 20 Sep 2004 14:36:43 +0000 Slightly nervous cough ... by Kris Adcock Anyone here? Or have I missed the party again?<br/><br/>Cheers,<br/><br/>Kris.<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2004/09/msg314.html Mon, 20 Sep 2004 13:49:37 +0000 Re: 32 bit perl? by Alex Waugh In message &lt;8eb081d44c.philip@philipnet.com&gt;<br/> Philip Ludlam &lt;philip@philipnet.com&gt; wrote:<br/><br/>&gt; On 25 Jul, in message &lt;992efed34c.tom@loxley.compton.nu&gt;<br/>&gt; Tom Hughes &lt;tom@compton.nu&gt; wrote:<br/>&gt; <br/>&gt; &gt;Can anybody point me at a 32 bit build of RISC OS perl?<br/>&gt; &gt;<br/>&gt; &gt;Or any build come to that - everything I find on google points to<br/>&gt; &gt;pages on plum.flirble.org that don&#39;t seem to exist.<br/>&gt; <br/>&gt; I&#39;m sure I remember Alex Waugh producing a minimal 32-bit port.<br/>&gt; http://www.cp15.org/<br/>&gt; (http://www.alexwaugh.com/ and<br/>&gt; http://www.branchthroughzero.uklinux.net/perl/ just rediect to the<br/>&gt; above).<br/>&gt; <br/>&gt; Unfortunately it doesn&#39;t seem to be available though :-( .<br/>&gt; Perhaps it you email him?<br/><br/>http://www.cp15.org/perl/<br/><br/>Alex<br/><br/>-- <br/>Alex Waugh alex@alexwaugh.com<br/><br/>PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2004/07/msg313.html Mon, 26 Jul 2004 13:57:41 +0000 Re: 32 bit perl? by Philip Ludlam On 25 Jul, in message &lt;992efed34c.tom@loxley.compton.nu&gt;<br/> Tom Hughes &lt;tom@compton.nu&gt; wrote:<br/><br/>&gt;Can anybody point me at a 32 bit build of RISC OS perl?<br/>&gt;<br/>&gt;Or any build come to that - everything I find on google points to<br/>&gt;pages on plum.flirble.org that don&#39;t seem to exist.<br/><br/>I&#39;m sure I remember Alex Waugh producing a minimal 32-bit port.<br/>http://www.cp15.org/<br/>(http://www.alexwaugh.com/ and<br/>http://www.branchthroughzero.uklinux.net/perl/ just rediect to the<br/>above).<br/><br/>Unfortunately it doesn&#39;t seem to be available though :-( .<br/>Perhaps it you email him?<br/><br/>Yours,<br/><br/>Phil L.<br/>-- <br/>http://www.philipnet.com | http://director.sourceforge.net<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2004/07/msg312.html Mon, 26 Jul 2004 03:54:15 +0000 Re: 32 bit perl? by Nicholas Clark On Sun, Jul 25, 2004 at 11:54:11AM +0100, Tom Hughes wrote:<br/>&gt; Can anybody point me at a 32 bit build of RISC OS perl?<br/><br/>I can&#39;t. Sorry.<br/><br/>&gt; Or any build come to that - everything I find on google points to<br/>&gt; pages on plum.flirble.org that don&#39;t seem to exist.<br/><br/>For some reason the web server seems to be down at the moment. I&#39;m not root,<br/>so I can&#39;t fix this. However, there&#39;s no 32 bit perl there, as I don&#39;t have<br/>a 32 bit RISC OS machine, and wouldn&#39;t have the time to work on a 32 bit<br/>version even if I had.<br/><br/>Nicholas Clark<br/> http://www.nntp.perl.org/group/perl.riscos/2004/07/msg311.html Sun, 25 Jul 2004 08:42:11 +0000 32 bit perl? by Tom Hughes Can anybody point me at a 32 bit build of RISC OS perl?<br/><br/>Or any build come to that - everything I find on google points to<br/>pages on plum.flirble.org that don&#39;t seem to exist.<br/><br/>Tom<br/><br/>-- <br/>Tom Hughes (tom@compton.nu)<br/>http://www.compton.nu/<br/> http://www.nntp.perl.org/group/perl.riscos/2004/07/msg310.html Sun, 25 Jul 2004 04:06:27 +0000 Re: Sorting by Derek.Moody On Thu 01 Jul, Colin Foster wrote:<br/><br/>&gt; I&#39;m sorting a list in numerical order using<br/>&gt; @new = sort {$b &lt;=&gt; $a} @old;<br/>&gt; <br/>&gt; Is it possible to restrict the sort so that it only sorts on the first<br/>&gt; 4 digits.<br/><br/>Presuming your data are well regulated try:<br/><br/>@new = sort {substr($b,0,4) &lt;=&gt; substr($a,0,4)} @old;<br/><br/>(Following your $b $a count-down order)<br/><br/>Cheerio,<br/><br/>-- <br/>&gt;&gt; derek.moody@clara.net<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2004/07/msg309.html Fri, 02 Jul 2004 19:58:57 +0000 Sorting by Colin Foster <br/>Hi All,<br/><br/>I&#39;m sorting a list in numerical order using<br/>@new = sort {$b &lt;=&gt; $a} @old;<br/><br/>Is it possible to restrict the sort so that it only sorts on the first<br/>4 digits.<br/><br/>Regards,<br/>Colin.<br/> http://www.nntp.perl.org/group/perl.riscos/2004/07/msg308.html Thu, 01 Jul 2004 05:38:02 +0000 Re: IYONIX by Alex Waugh In message &lt;826be19d4c.habett@Jesus.wanadoo.fr&gt;<br/> stephane HAbeTT roux &lt;habett@habett.org&gt; wrote:<br/><br/>&gt; Hello,<br/>&gt; <br/>&gt; Where is perl for the Iyonix ?<br/><br/>http://www.alexwaugh.com/perl/ contains a half finished port of 5.8.0<br/>which will run on the Iyonix.<br/><br/>Alex<br/><br/>-- <br/>Alex Waugh alex@alexwaugh.com<br/><br/>PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2004/04/msg307.html Mon, 12 Apr 2004 11:21:33 +0000 IYONIX by stephane HAbeTT roux Hello,<br/><br/>Where is perl for the Iyonix ?<br/><br/>-- <br/>|&quot;:._.:&quot;| http://habett.org/<br/>| (=) | habett@habett.org<br/>| .:. | New alternative world order<br/> http://www.nntp.perl.org/group/perl.riscos/2004/04/msg306.html Sun, 11 Apr 2004 02:06:08 +0000 Re: how to set up !Perl by Ben Kal Dear Alex,<br/><br/>In a message of 15 Sep 2003 you wrote:<br/><br/>&gt;Ben Kal wrote:<br/><br/>&gt;&gt; 2. Perl cannot find the packages that many, many scripts rely on<br/>&gt;&gt; Perl very often reports that it cannot find a certain package in a list<br/>&gt;&gt; of directories in @INC (yes I know what that is for) that in no way<br/>&gt;&gt; corresponds to the directory structure within !Perl. I cannot believe<br/>&gt;&gt; that I am supposed to rearrange all the packages into directories<br/>&gt;&gt; /home/riscos/cross/local/lib/perl5/5.8.0/riscos-aof<br/>&gt;&gt; /home/riscos/cross/local/lib/perl5/5.8.0<br/>&gt;&gt; /home/riscos/cross/local/lib/perl5/site_perl/5.8.0/riscos-aof<br/>&gt;&gt; /home/riscos/cross/local/lib/perl5/site_perl/5.8.0<br/>&gt;&gt; /home/riscos/cross/local/lib/perl5/site_perl<br/>&gt;&gt; It is equally hard to believe that I am supposed to edit the start of<br/>&gt;&gt; each and every supplied script to make it change @INC at compile time;<br/>&gt;&gt; apart from that, attempts to do it failed. Is there a way to do it<br/>&gt;&gt; globally?<br/>&gt;<br/>&gt;This is a known problem with my 5.8.0 port, which I do intend to fix but <br/>&gt;have not found the time to do so yet.<br/><br/>&gt;Unless you need a 32bit version or know what you are doing, I suggest <br/>&gt;you avoid my port for the time being. I do intend to make it a bit more <br/>&gt;user friendly when it is finished.<br/><br/>A somewhat disappointing but clear answer. Thank you very much.<br/><br/>Kind regards,<br/>Ben Kal<br/><br/>-- <br/><br/>B.F.M. Kal<br/>Anjelierstraat 1, 2014 TC Haarlem, Netherlands<br/>tel +31 23 5324909, benkal@euronet.nl<br/> http://www.nntp.perl.org/group/perl.riscos/2003/09/msg305.html Thu, 18 Sep 2003 15:52:12 +0000 Re: how to set up !Perl by Ben Kal Dear James,<br/><br/>In a message of 13 Sep 2003 you wrote:<br/><br/>&gt; On Sat 13 Sep, Ben Kal wrote:<br/><br/>&gt;&gt; I was glad to see that Perl is available for RISC OS, so I<br/>&gt;&gt; copied it from the latest Foundation RISC User cd (that was<br/>&gt;&gt; version 5.005) and even downloaded Alex Waugh&#39;s version 5.8.0.<br/><br/>&gt; I haven&#39;t tried Alex Waugh&#39;s 5.8.0 because it didn&#39;t sound like he was<br/>&gt; confident that it was finished. Stability and completeness have always<br/>&gt; been higher priority for me than new features. Perhaps Alex will let us<br/>&gt; know if things have changed since.<br/><br/>Alex Waugh himself advised me not to use his Perl 5.8.0 until he shall have<br/>solved the problem of the difference between his default @INC and the<br/>directory structure containing the modules. Big problem nr. 2 solved.<br/><br/>&gt;&gt; Then I wanted to set things up so that I would be able to<br/>&gt;&gt; really do Perl programming under RISC OS, but failed.<br/><br/>&gt; I wonder what you mean by &quot;really do&quot;.<br/><br/>Not more than: being able to work under RISC OS on Perl scripts that are<br/>either RISC OS specific or operating system neutral. It would be nice to<br/>have the freedom not only to edit but also to test under RISC OS a Perl<br/>script intended for use under Linux. Some limitations in RISC OS Perl are<br/>acceptable, if I know which those are and there are not too many of them.<br/>And I expect that all there is in a distribution of RISC OS Perl (not only<br/>the binary but also the packages and scripts) can somehow be made to work,<br/>otherwise why where these things included?<br/><br/>&gt; Perl on RISC OS is unfortunately not practical in all the places you may<br/>&gt; have used Basic. This is because Basic is a &quot;language module&quot; that stays<br/>&gt; resident in memory and can start Basic programs instantly and with only<br/>&gt; about 8K overhead per program. In contrast, when a Perl program runs, a<br/>&gt; massive 1Mb of application memory is required to load a *separate* copy of<br/>&gt; the perl executable each time.<br/><br/>No consideration to me. My Risc PC has 45 Mb memory and more could be<br/>added. Almost never use non-multitasking Basic programs, so no plans to<br/>replace them by Perl scripts. Also no plans to build a system that could<br/>overload my machine by calling too many Perl scripts.<br/><br/>&gt; So that I can have a *little* more flexibility over where to run Perl<br/>&gt; progs from, I made a few small alterations as follows:<br/><br/>&gt; Leave line 57 of the !Perl.!Boot file commented out.<br/><br/>&gt; Comment out line 46 of the !Perl.!Boot file which sets the runtype so that<br/>&gt; the perl executable is started directly.<br/><br/>&gt; Delete the last two lines of the !Perl.!Run file and replace them with the<br/>&gt; following three lines:<br/><br/>&gt; If &quot;&lt;Wimp$State&gt;&quot;=&quot;desktop&quot; then TaskWindow &quot;/&lt;Obey$Dir&gt;.Perl %*0&quot; 1024k<br/>&gt; Perl -quit<br/>&gt; If &quot;&lt;Wimp$State&gt;&quot;=&quot;commands&quot; then WimpSlot 1024k<br/>&gt; If &quot;&lt;Wimp$State&gt;&quot;=&quot;commands&quot; then /&lt;Obey$Dir&gt;.Perl %*0<br/><br/>&gt; The result of these alterations (after a reboot of course) is that you can<br/>&gt; run Perl progs from the command line, or double-click them to run them in<br/>&gt; a task window. However, when typing into a task window Wimp$State is<br/>&gt; &quot;desktop&quot; and this causes each command to launch into a new task window<br/>&gt; (rather like launching X applications from within an xterm).<br/><br/>I tried your alterations and they seem to result in an acceptable way of<br/>working. Big problem nr. 1 solved.<br/><br/>&gt; Of course, the !PerlRun application is designed to detect when you are<br/>&gt; within a task window and do the right thing accordingly. I don&#39;t use it<br/>&gt; myself, although I probably should. However, I&#39;m surprised you could not<br/>&gt; get it to work for you.<br/><br/>For the moment, I do not bother to look at !PerlRun again.<br/><br/>&gt;&gt; 1. I see no way to make the Risc PC gracefully handle running Perl scripts:<br/>&gt;&gt; - by double clicking a script file in the desktop (how to pass parameters<br/>&gt;&gt; then if needed?);<br/><br/>&gt; Parameters can never be passed to a double-clicked file. This is not a<br/>&gt; Perl limitation, it is a natural result of the fact you&#39;re double-clicking<br/>&gt; the file rather than typing a command line.<br/><br/>I knew, believe me. But somewhere in the documentation about RISC OS Perl I<br/>found that double clicking a Perl script by runs Perl, without any<br/>qualification about those scripts needing parameters passed to them or not.<br/>Always willing to believe that I have missed something (maybe RISC OS Perl<br/>would have been fitted with a mechanism to make double clicked scripts ask<br/>parameters they need before running?) I asked the stupid question.<br/><br/>&gt;&gt; I found !PerlRun which seems designed to solve this problem, but if I use<br/>&gt;&gt; that I invariably get a &#39;No writable memory at this address&#39; message.<br/><br/>&gt; I&#39;m sorry, I can&#39;t think what would have caused that. Does it make a<br/>&gt; difference when you set the Wimp&#39;s &quot;Next&quot; slot to more than 1024K?<br/><br/>I believe that what I saw happening was that I got this error message<br/>regardless of how big I made the &quot;Next&quot; Wimpslot.<br/><br/>&gt; One of my gripes about the RISC OS Perl situation is that so many modules<br/>&gt; require compilation via a &quot;make install&quot;. I have never managed to get that<br/>&gt; to work on RISC OS because it is too Unix specific and I don&#39;t know enough<br/>&gt; about porting Unix software.<br/><br/>I suppose you mean modules that are available from CPAN but are not present<br/>in the RISC OS Perl distribution? I can live with that, if only the modules<br/>that are in the RISC OS Perl distribution do work. Because of its origin<br/>Perl will forever only offer its full functionality under Unix, I think.<br/><br/>&gt;&gt; Perl very often reports that it cannot find a certain package in a list<br/>&gt;&gt; of directories in @INC (yes I know what that is for) that in no way<br/>&gt;&gt; corresponds to the directory structure within !Perl.<br/><br/>&gt; *perl -MWibble<br/>&gt; Can&#39;t locate Wibble.pm in @INC (@INC contains: /PerlPrivLib:zip /PerlArchLib:<br/>&gt; /PerlPrivLib: /PerlSiteArchLib: /PerlSiteLib: .).<br/>&gt; BEGIN failed--compilation aborted.<br/><br/>&gt; Hmmm, those are path variables which you can see like this:<br/><br/>&gt; *show Perl*$Path<br/>&gt; Perl$Path : ADFS::HD.$.!Boot.Resources.!Perl.<br/>&gt; PerlArchLib$Path : ADFS::HD.$.!Boot.Resources.!Perl.riscos.<br/>&gt; PerlP$Path : ADFS::HD.$.!BOOT.Resources.!Scrap.ScrapDirs.ScrapDir.<br/>&gt; PerlPrivLib$Path : ADFS::HD.$.!Boot.Resources.!Perl.lib.,ADFS::HD.$.!Boot.Resources.!Perl.more-lib.<br/>&gt; PerlScript$Path : ADFS::HD.$.!Boot.Resources.!Perl.scripts.<br/>&gt; PerlSiteLib$Path : ADFS::HD.$.!Boot.Resources.!Perl.lib.site_perl.<br/><br/>Ah! So the RISC OS Perl*$Path variables come out as @INC in Perl. Something<br/>like this was what I was looking for.<br/><br/>&gt;&gt; I cannot believe that I am supposed to rearrange all the packages<br/>&gt;&gt; into directories<br/>&gt;&gt; /home/riscos/cross/local/lib/perl5/5.8.0/riscos-aof<br/>&gt;&gt; /home/riscos/cross/local/lib/perl5/5.8.0<br/>&gt;&gt; /home/riscos/cross/local/lib/perl5/site_perl/5.8.0/riscos-aof<br/>&gt;&gt; /home/riscos/cross/local/lib/perl5/site_perl/5.8.0<br/>&gt;&gt; /home/riscos/cross/local/lib/perl5/site_perl<br/><br/>&gt; Where did you get those directories from?<br/><br/>This is what Alex Waugh&#39;s Perl 5.8.0 reports as the value of @INC when it<br/>cannot find a module.<br/><br/>&gt;&gt; Please, can someone enlighten me on how to solve these<br/>&gt;&gt; problems, so that I can *conveniently* use RISC OS Perl?<br/><br/>&gt; Well, I&#39;ve done my best, ....<br/><br/>Certainly, thank you very much!<br/><br/>&gt; .... but you may not find it as convenient as you were hoping.<br/><br/>After further experimenting I have come to the conclusion that probably most<br/>of the provided scripts work, but that this is often far from apparent at a<br/>first try, because you have to know what the script is supposed to do and<br/>what paramaters it needs in exactly which form (for instance, I now know<br/>that a full RISC OS pathname has to be really, really full: &#39;$.something&#39; or<br/>&#39;ADFS::$.something&#39; does not suffice, it has to be &#39;ADFS::4.$.something&#39;).<br/>Otherwise, the output often looks like Perl and/or the script is simply<br/>broken.<br/><br/>&gt;&gt; And of course, if someone is able and willing to write such instructions,<br/>&gt;&gt; publish them on the internet and make RISC OS Ltd add them to their next<br/>&gt;&gt; Foundation User cd.<br/><br/>&gt; I think the functionality of !PerlRun could be added to the !Perl<br/>&gt; application itself and then no such instructions would be necessary. I<br/>&gt; might have a go at that. I certainly wouldn&#39;t wish you to duplicate the<br/>&gt; waffle I wrote above. :-)<br/><br/>To do that *I* would first have to gain more experience with RISC OS Perl.<br/>And I think that people new to RISC OS Perl, even those with Perl experience<br/>on other platforms, will much appreciate more information on the<br/>peculiarities of RISC OS Perl.<br/><br/>Kind regards,<br/>Ben Kal<br/><br/>-- <br/><br/>B.F.M. Kal<br/>Anjelierstraat 1, 2014 TC Haarlem, Netherlands<br/>tel +31 23 5324909, benkal@euronet.nl<br/> http://www.nntp.perl.org/group/perl.riscos/2003/09/msg304.html Thu, 18 Sep 2003 15:52:03 +0000 Re: how to set up !Perl by Alex Waugh Ben Kal wrote:<br/>&gt; 2. Perl cannot find the packages that many, many scripts rely on<br/>&gt; Perl very often reports that it cannot find a certain package in a list<br/>&gt; of directories in @INC (yes I know what that is for) that in no way<br/>&gt; corresponds to the directory structure within !Perl. I cannot believe<br/>&gt; that I am supposed to rearrange all the packages into directories<br/>&gt; /home/riscos/cross/local/lib/perl5/5.8.0/riscos-aof<br/>&gt; /home/riscos/cross/local/lib/perl5/5.8.0<br/>&gt; /home/riscos/cross/local/lib/perl5/site_perl/5.8.0/riscos-aof<br/>&gt; /home/riscos/cross/local/lib/perl5/site_perl/5.8.0<br/>&gt; /home/riscos/cross/local/lib/perl5/site_perl<br/>&gt; It is equally hard to believe that I am supposed to edit the start of<br/>&gt; each and every supplied script to make it change @INC at compile time;<br/>&gt; apart from that, attempts to do it failed. Is there a way to do it<br/>&gt; globally?<br/><br/>This is a known problem with my 5.8.0 port, which I do intend to fix but <br/>have not found the time to do so yet.<br/><br/>&gt; Please, can someone enlighten me on how to solve these problems, so that I<br/>&gt; can *conveniently* use RISC OS Perl? I probably need some pretty detailed<br/>&gt; instructions on what files to put where and what startup scripts to tweak.<br/>&gt; And of course, if someone is able and willing to write such instructions,<br/>&gt; publish them on the internet and make RISC OS Ltd add them to their next<br/>&gt; Foundation User cd.<br/><br/>Unless you need a 32bit version or know what you are doing, I suggest <br/>you avoid my port for the time being. I do intend to make it a bit more <br/>user friendly when it is finished.<br/><br/>Alex<br/><br/><br/>-- <br/>Alex Waugh alex@alexwaugh.com<br/><br/>PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/<br/><br/><br/><br/> http://www.nntp.perl.org/group/perl.riscos/2003/09/msg303.html Mon, 15 Sep 2003 03:44:57 +0000 Re: how to set up !Perl by James Taylor On Sat 13 Sep, Ben Kal wrote:<br/>&gt; <br/>&gt; May I ask your help for setting up !Perl on my Risc PC with Select.<br/><br/>I don&#39;t have Select, but all this is probably the same there as<br/>it is here on RISC OS 3.7.<br/><br/>&gt; I was glad to see that Perl is available for RISC OS, so I<br/>&gt; copied it from the latest Foundation RISC User cd (that was<br/>&gt; version 5.005) and even downloaded Alex Waugh&#39;s version 5.8.0.<br/><br/>I haven&#39;t tried Alex Waugh&#39;s 5.8.0 because it didn&#39;t sound like<br/>he was confident that it was finished. Stability and completeness<br/>have always been higher priority for me than new features. Perhaps<br/>Alex will let us know if things have changed since.<br/><br/>For what follows assume Perl 5.005_03 as found here:<br/>http://plum.flirble.org/~nick/P/perl_113_riscpc.zip<br/><br/>&gt; Then I wanted to set things up so that I would be able to<br/>&gt; really do Perl programming under RISC OS, but failed.<br/><br/>I wonder what you mean by &quot;really do&quot;. Perl on RISC OS is<br/>unfortunately not practical in all the places you may have used<br/>Basic. This is because Basic is a &quot;language module&quot; that stays<br/>resident in memory and can start Basic programs instantly and<br/>with only about 8K overhead per program. In contrast, when a Perl<br/>program runs, a massive 1Mb of application memory is required to<br/>load a *separate* copy of the perl executable each time. Even if<br/>memory was not a constraint, the loading itself takes several<br/>seconds thus making it impractical to run periodic scripts, and<br/>the like, as you might have been used to on Linux.<br/><br/>I would dearly love to be able to use Perl instead of Basic for<br/>all my RISC OS programming, but until someone implements it as<br/>a language module, this isn&#39;t a realistic option. I hate to think<br/>what a RISC OS based web server&#39;s response time would be when a<br/>visitor requests a resource from a Perl CGI script. Having said<br/>all that, I&#39;m not skilled in the art of porting Unix software to<br/>RISC OS myself, and I&#39;m damn grateful to have Perl at all.<br/><br/>&gt; After a full day of trying I feel that it will take ages before<br/>&gt; I shall have figured out myself how Perl has to be set up.<br/><br/>If you simply place the !Perl application into your !Boot.Resources<br/>directory (and reboot) then Perl scripts will run in the same manner<br/>that Basic programs run by default, ie. in a non-multitasking<br/>command window if double-clicked, or from the command line.<br/><br/>Personally, I prefer to run Perl progs in task windows so that I<br/>can interact with them whilst still having access to the rest of<br/>the desktop. Line 57 of the !Perl.!Boot file can be uncommented<br/>to set the runtype for Perl programs so that they are launched in<br/>a task window with more than enough memory. This is fine if you<br/>*only* wish to run them in a task window. I don&#39;t use this myself.<br/><br/>So that I can have a *little* more flexibility over where to run<br/>Perl progs from, I made a few small alterations as follows:<br/><br/>Leave line 57 of the !Perl.!Boot file commented out.<br/><br/>Comment out line 46 of the !Perl.!Boot file which sets the<br/>runtype so that the perl executable is started directly.<br/><br/>Delete the last two lines of the !Perl.!Run file and replace them<br/>with the following three lines:<br/><br/>If &quot;&lt;Wimp$State&gt;&quot;=&quot;desktop&quot; then TaskWindow &quot;/&lt;Obey$Dir&gt;.Perl %*0&quot; 1024k Perl -quit<br/>If &quot;&lt;Wimp$State&gt;&quot;=&quot;commands&quot; then WimpSlot 1024k<br/>If &quot;&lt;Wimp$State&gt;&quot;=&quot;commands&quot; then /&lt;Obey$Dir&gt;.Perl %*0<br/><br/>The result of these alterations (after a reboot of course) is that<br/>you can run Perl progs from the command line, or double-click them<br/>to run them in a task window. However, when typing into a task window<br/>Wimp$State is &quot;desktop&quot; and this causes each command to launch into<br/>a new task window (rather like launching X applications from within<br/>an xterm).<br/><br/>Of course, the !PerlRun application is designed to detect when<br/>you are within a task window and do the right thing accordingly.<br/>I don&#39;t use it myself, although I probably should. However, I&#39;m<br/>surprised you could not get it to work for you.<br/><br/>&gt; 1. I see no way to make the Risc PC gracefully handle running Perl scripts:<br/>&gt; - by double clicking a script file in the desktop (how to pass parameters<br/>&gt; then if needed?);<br/><br/>Parameters can never be passed to a double-clicked file. This is<br/>not a Perl limitation, it is a natural result of the fact you&#39;re<br/>double-clicking the file rather than typing a command line.<br/><br/>&gt; I found !PerlRun which seems designed to solve this problem, but if I use<br/>&gt; that I invariably get a &#39;No writable memory at this address&#39; message.<br/><br/>I&#39;m sorry, I can&#39;t think what would have caused that. Does it make<br/>a difference when you set the Wimp&#39;s &quot;Next&quot; slot to more than 1024K?<br/><br/>&gt; 2. Perl cannot find the packages that many, many scripts rely on<br/><br/>One of my gripes about the RISC OS Perl situation is that so many<br/>modules require compilation via a &quot;make install&quot;. I have never<br/>managed to get that to work on RISC OS because it is too Unix<br/>specific and I don&#39;t know enough about porting Unix software.<br/>(If anyone else has had success in this area and can offer tips,<br/>I&#39;d love to know.) The bottom line is that many Perl modules cannot<br/>be installed on RISC OS and furthermore none of the modules that<br/>depend on those other modules can be installed either. Bummer eh?<br/><br/>&gt; Perl very often reports that it cannot find a certain package in a list<br/>&gt; of directories in @INC (yes I know what that is for) that in no way<br/>&gt; corresponds to the directory structure within !Perl.<br/><br/>*perl -MWibble<br/>Can&#39;t locate Wibble.pm in @INC (@INC contains: /PerlPrivLib:zip /PerlArchLib:<br/> /PerlPrivLib: /PerlSiteArchLib: /PerlSiteLib: .).<br/>BEGIN failed--compilation aborted.<br/><br/>Hmmm, those are path variables which you can see like this:<br/><br/>*show Perl*$Path<br/>Perl$Path : ADFS::HD.$.!Boot.Resources.!Perl.<br/>PerlArchLib$Path : ADFS::HD.$.!Boot.Resources.!Perl.riscos.<br/>PerlP$Path : ADFS::HD.$.!BOOT.Resources.!Scrap.ScrapDirs.ScrapDir.<br/>PerlPrivLib$Path : ADFS::HD.$.!Boot.Resources.!Perl.lib.,ADFS::HD.$.!Boot.Resources.!Perl.more-lib.<br/>PerlScript$Path : ADFS::HD.$.!Boot.Resources.!Perl.scripts.<br/>PerlSiteLib$Path : ADFS::HD.$.!Boot.Resources.!Perl.lib.site_perl.<br/><br/>The last line there is the directory into which you may install<br/>any modules you find which are Perl-only and are not dependent<br/>upon other modules that require compilation. Yes, there are a few.<br/><br/>&gt; I cannot believe that I am supposed to rearrange all the packages<br/>&gt; into directories<br/>&gt; /home/riscos/cross/local/lib/perl5/5.8.0/riscos-aof<br/>&gt; /home/riscos/cross/local/lib/perl5/5.8.0<br/>&gt; /home/riscos/cross/local/lib/perl5/site_perl/5.8.0/riscos-aof<br/>&gt; /home/riscos/cross/local/lib/perl5/site_perl/5.8.0<br/>&gt; /home/riscos/cross/local/lib/perl5/site_perl<br/><br/>Where did you get those directories from?<br/><br/>&gt; It is equally hard to believe that I am supposed to edit the start of<br/>&gt; each and every supplied script to make it change @INC at compile time;<br/><br/>I&#39;ve never found that necessary on my own machine. It tends to be<br/>necessary only on systems where you cannot update the central<br/>module repository but where you can install modules into your own<br/>home directory.<br/><br/>&gt; apart from that, attempts to do it failed. Is there a way to do it<br/>&gt; globally?<br/><br/>You shouldn&#39;t need to on RISC OS, but if you wanted to add<br/>specific directories to the setting of PerlSiteLib$Path in the<br/>!Perl.!Boot file then nobody would stop you.<br/><br/>&gt; Please, can someone enlighten me on how to solve these<br/>&gt; problems, so that I can *conveniently* use RISC OS Perl?<br/><br/>Well, I&#39;ve done my best, but you may not find it as convenient<br/>as you were hoping.<br/><br/>&gt; And of course, if someone is able and willing to write such instructions,<br/>&gt; publish them on the internet and make RISC OS Ltd add them to their next<br/>&gt; Foundation User cd.<br/><br/>I think the functionality of !PerlRun could be added to the !Perl<br/>application itself and then no such instructions would be necessary.<br/>I might have a go at that. I certainly wouldn&#39;t wish you to<br/>duplicate the waffle I wrote above. :-)<br/><br/>Good luck!<br/><br/>-- <br/>James Taylor, Cheltenham, Gloucestershire, UK. PGP key: 3FBE1BF9<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2003/09/msg302.html Sat, 13 Sep 2003 09:02:07 +0000 how to set up !Perl by Ben Kal Dear RISC OS Perl friends,<br/><br/>May I ask your help for setting up !Perl on my Risc PC with Select.<br/><br/>In the past few years I have done some Perl programming under Linux. I was<br/>glad to see that Perl is available for RISC OS, so I copied it from the<br/>latest Foundation RISC User cd (that was version 5.005) and even downloaded<br/>Alex Waugh&#39;s version 5.8.0. But I did not much with it until yesterday.<br/><br/>Then I wanted to set things up so that I would be able to really do Perl<br/>programming under RISC OS, but failed. After a full day of trying I feel<br/>that it will take ages before I shall have figured out myself how Perl has<br/>to be set up.<br/><br/>In essence, Perl works, that is, some scripts do run, but there are two big<br/>problems.<br/><br/>1. I see no way to make the Risc PC gracefully handle running Perl scripts:<br/> - by double clicking a script file in the desktop (how to pass parameters<br/> then if needed?);<br/> - in a task window;<br/> - from the bare command line.<br/> I found !PerlRun which seems designed to solve this problem, but if I use<br/> that I invariably get a &#39;No writable memory at this address&#39; message.<br/><br/>2. Perl cannot find the packages that many, many scripts rely on<br/> Perl very often reports that it cannot find a certain package in a list<br/> of directories in @INC (yes I know what that is for) that in no way<br/> corresponds to the directory structure within !Perl. I cannot believe<br/> that I am supposed to rearrange all the packages into directories<br/> /home/riscos/cross/local/lib/perl5/5.8.0/riscos-aof<br/> /home/riscos/cross/local/lib/perl5/5.8.0<br/> /home/riscos/cross/local/lib/perl5/site_perl/5.8.0/riscos-aof<br/> /home/riscos/cross/local/lib/perl5/site_perl/5.8.0<br/> /home/riscos/cross/local/lib/perl5/site_perl<br/> It is equally hard to believe that I am supposed to edit the start of<br/> each and every supplied script to make it change @INC at compile time;<br/> apart from that, attempts to do it failed. Is there a way to do it<br/> globally?<br/><br/>Please, can someone enlighten me on how to solve these problems, so that I<br/>can *conveniently* use RISC OS Perl? I probably need some pretty detailed<br/>instructions on what files to put where and what startup scripts to tweak.<br/>And of course, if someone is able and willing to write such instructions,<br/>publish them on the internet and make RISC OS Ltd add them to their next<br/>Foundation User cd.<br/><br/>Many thanks in advance and kind regards,<br/>Ben Kal<br/><br/>-- <br/><br/>B.F.M. Kal<br/>Anjelierstraat 1, 2014 TC Haarlem, Netherlands<br/>tel +31 23 5324909, benkal@euronet.nl<br/> http://www.nntp.perl.org/group/perl.riscos/2003/09/msg301.html Fri, 12 Sep 2003 15:38:51 +0000 Re: Where ...? by Jeremy C B Nicoll In article &lt;4c25f758c5Jeremy@omba.demon.co.uk&gt;,<br/> Jeremy C B Nicoll &lt;Jeremy@omba.demon.co.uk&gt; wrote:<br/>&gt; Where can I find a version of perl that will run on RO? Does it<br/>&gt; matter that I&#39;ve only got RO3.7 installed?<br/><br/>Thanks to those who have replied!<br/><br/>-- <br/>Jeremy C B Nicoll - my opinions are my own.<br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg300.html Fri, 22 Aug 2003 10:26:08 +0000 Where ...? by Jeremy C B Nicoll Where can I find a version of perl that will run on RO? Does it matter<br/>that I&#39;ve only got RO3.7 installed?<br/><br/>-- <br/>Jeremy C B Nicoll - my opinions are my own.<br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg299.html Fri, 22 Aug 2003 05:41:19 +0000 Re: trailing spaces by Nicholas Clark On Fri, Aug 22, 2003 at 10:17:28AM +0100, Jeremy C B Nicoll wrote:<br/>&gt; In article &lt;Marcel-1.53-0821234244-7a1fNdQ@nospam.demon.co.uk&gt;,<br/>&gt; James Taylor &lt;james@oakseed.demon.co.uk&gt; wrote:<br/>&gt; <br/>&gt; &gt; PS. There&#39;s rather too much netlag on this mailing list.<br/>&gt; <br/>&gt; Yeah, but you&#39;re a demon user and demon have had lots of problems this<br/>&gt; week (discussed at length in demon.service).<br/><br/>perl.org also had a backlog on mail processing, but they&#39;ve tweaked their<br/>mail architecture to remove the bottleneck.<br/><br/>I&#39;ve been averaging 7.5 SOBIG.Fs per minute over the past 48 hours<br/>That&#39;s just to me, ignoring bounces and &quot;virus alerts&quot;, so I expect that<br/>the rather more public perl.org address have been even harder hit.<br/>On the first evening I was getting about .8 Meg of mail per minute. I&#39;m not<br/>the only person on this machine, so it&#39;s coping quite well, all things<br/>considered.<br/><br/>Nicholas Clark<br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg298.html Fri, 22 Aug 2003 04:32:43 +0000 Re: trailing spaces by Richard Proctor On Fri 22 Aug, Jeremy C B Nicoll wrote:<br/>&gt; In article &lt;Marcel-1.53-0821234244-7a1fNdQ@nospam.demon.co.uk&gt;,<br/>&gt; James Taylor &lt;james@oakseed.demon.co.uk&gt; wrote:<br/>&gt; <br/>&gt; &gt; PS. There&#39;s rather too much netlag on this mailing list.<br/>&gt; <br/>&gt; Yeah, but you&#39;re a demon user and demon have had lots of problems this<br/>&gt; week (discussed at length in demon.service).<br/>&gt; <br/><br/>Its not just demon - the whole net is creaking due virus/worm activity.<br/><br/>Mail-scanner on my server is removing about 15-20 copies an hour.<br/><br/>A client who is just moving to me, had their current provider off the air<br/>for several hours yesterday due to the load.<br/><br/>Richard<br/><br/>-- <br/>Personal Richard@waveney.org http://www.waveney.org<br/>Telecoms Richard@WaveneyConsulting.com http://www.WaveneyConsulting.com<br/>Web services Richard@wavwebs.com http://www.wavwebs.com<br/>Independent Telecomms Specialist, ATM expert, Web Analyst &amp; Services<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg297.html Fri, 22 Aug 2003 03:39:37 +0000 Re: trailing spaces by Jeremy C B Nicoll In article &lt;Marcel-1.53-0821234244-7a1fNdQ@nospam.demon.co.uk&gt;,<br/> James Taylor &lt;james@oakseed.demon.co.uk&gt; wrote:<br/><br/>&gt; PS. There&#39;s rather too much netlag on this mailing list.<br/><br/>Yeah, but you&#39;re a demon user and demon have had lots of problems this<br/>week (discussed at length in demon.service).<br/><br/>-- <br/>Jeremy C B Nicoll - my opinions are my own.<br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg296.html Fri, 22 Aug 2003 03:15:04 +0000 Re: trailing spaces by James Taylor On Thu 21 Aug, Roger Horne wrote:<br/>&gt; <br/>&gt; On Wed 20 Aug, James Taylor wrote:<br/>&gt; &gt;<br/>&gt; &gt; But, more usefully, the fishing rod is:<br/>&gt; &gt; <br/>&gt; &gt; Learning Perl, 3rd edition<br/>&gt; &gt; http://www.oreilly.com/catalog/lperl3/<br/>&gt; <br/>&gt; That was the 1st (out of many) Perl book that I bought and<br/>&gt; I found it awful.<br/><br/>Really? I found it clear and easy. I enjoyed the humour too.<br/><br/>&gt; Horses for courses I suppose, but so far as I was<br/>&gt; concerned Programming Perl was immeasurably better. <br/><br/>Agreed, every serious Perl programmer is lost without<br/>Programming Perl: http://www.oreilly.com/catalog/pperl3/<br/><br/>&gt; The one I use most is, I think, the Perl Cookbook.<br/><br/>Strangely, although I have it, I tend to refer to it only when<br/>I&#39;m completely stumped (ie. rarely). However, I agree that it<br/>is a great book. http://www.oreilly.com/catalog/cookbook/<br/><br/>&gt; A point that I have never seen dealt with is why, in order to<br/>&gt; trim at both ends, the recipe uses<br/>&gt; $string =~s/^\s+//; <br/>&gt; $string =~s/\s+$//;<br/>&gt; rather than say <br/>&gt; $string =~s[^\s*(.*?)\s*$][$1];<br/><br/>There&#39;s a very good reason for that. The first pair do not require<br/>any backtracking and can execute very quickly. The latter technique<br/>can involve a great deal of backtracking and, in the worst case,<br/>could take a very long time indeed. As a contrived example, run this:<br/><br/> $string = &#39; a&#39; . &#39; &#39; x 100000 . &#39;z &#39;;<br/> print &quot;Starting first trim method\n&quot;;<br/> $string =~ s/^ +//;<br/> $string =~ s/ +$//;<br/> print &quot;Finished\n&quot;; # Instantly<br/><br/> $string = &#39; a&#39; . &#39; &#39; x 100000 . &#39;z &#39;;<br/> print &quot;Starting second trim method\n&quot;;<br/> $string =~ s/^ *(.*?) *$/$1/;<br/> print &quot;Finished\n&quot;; # Six minutes later... zzzzzzz...<br/><br/>I understand the natural desire to express the conceptually atomic<br/>trim operation as a single line. The idiom I sometimes use is:<br/><br/> s/^ +//, s/ +$// for $string;<br/><br/>Even better, this generalises neatly for more than one string:<br/><br/> s/^ +//, s/ +$// for $string1, $string2, $string3;<br/> s/^ +//, s/ +$// for @whole_file_of_lines;<br/><br/><br/>PS. There&#39;s rather too much netlag on this mailing list.<br/>When I posted my response to Colin I thought I was the first<br/>but in fact there were four other people ahead of me, and I may<br/>find that this post is redundant for the same reason. Sigh.<br/><br/>-- <br/>James Taylor, Cheltenham, Gloucestershire, UK. PGP key: 3FBE1BF9<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg295.html Thu, 21 Aug 2003 16:44:42 +0000 Re: trailing spaces by Roger Horne On Wed 20 Aug, James Taylor wrote:<br/> <br/>&gt; But, more usefully, the fishing rod is:<br/>&gt; <br/>&gt; Learning Perl, 3rd edition<br/>&gt; http://www.oreilly.com/catalog/lperl3/<br/><br/>That was the 1st (out of many) Perl book that I bought and I found it awful.<br/>Horses for courses I suppose, but so far as I was concerned Programming Perl<br/>was immeasurably better. <br/><br/>The one I use most is, I think, the Perl Cookbook. It gives a recipe (1.14)<br/>for trimming leading and trailing whitespace (which is basically what you<br/>have suggested).<br/><br/>A point that I have never seen dealt with is why, in order to trim at both<br/>ends, the recipe uses<br/> $string =~s/^\s+//; <br/> $string =~s/\s+$//;<br/>rather than say <br/> $string =~s[^\s*(.*?)\s*$][$1];<br/>(Typed without glasses on so I may have missed out a character or two ...)<br/><br/>Is the first version quicker (marginally)?<br/><br/>Roger<br/>-- <br/>Roger Horne, 11 New Square, Lincoln&#39;s Inn, London WC2A 3QB<br/>mailto:roger@number7.demon.co.uk<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg294.html Thu, 21 Aug 2003 01:00:16 +0000 Re: trailing spaces by Tom Hughes In message &lt;f3b4f7244c.Colin@cjfoster.iosun.co.uk&gt;<br/> Colin Foster &lt;colinj@torent.co.uk&gt; wrote:<br/><br/>&gt; Is there an easy way to remove the trailing<br/>&gt; spaces in the string &quot;TRAILING SPACES &quot;<br/><br/>$string =~ s/ *$//;<br/><br/>Tom<br/><br/>-- <br/>Tom Hughes (tom@compton.nu)<br/>http://www.compton.nu/<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg293.html Wed, 20 Aug 2003 17:36:29 +0000 Re: trailing spaces by James Taylor On Wed 20 Aug, Colin Foster wrote:<br/>&gt; <br/>&gt; Is there an easy way to remove the trailing<br/>&gt; spaces in the string &quot;TRAILING SPACES &quot;<br/><br/>Hmmm, I&#39;m not sure whether to give you a fish or a fishing rod.<br/>The fish is:<br/><br/> $string =~ s/ +$//;<br/><br/>But, more usefully, the fishing rod is:<br/><br/> Learning Perl, 3rd edition<br/> http://www.oreilly.com/catalog/lperl3/<br/><br/>or:<br/><br/> The site for people learning Perl<br/> http://learn.perl.org/<br/><br/>or even:<br/><br/> Online Perl documentation<br/> http://www.perldoc.com/<br/><br/>-- <br/>James Taylor, Cheltenham, Gloucestershire, UK. PGP key: 3FBE1BF9<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg292.html Wed, 20 Aug 2003 17:08:32 +0000 Re: trailing spaces by Andrew Green In article &lt;f3b4f7244c.Colin@cjfoster.iosun.co.uk&gt;,<br/> Colin Foster &lt;colinj@torent.co.uk&gt; wrote:<br/><br/>&gt; Is there an easy way to remove the trailing<br/>&gt; spaces in the string &quot;TRAILING SPACES &quot;<br/><br/>$string =~ s/ +\Z//;<br/><br/>Cheers,<br/>Andrew.<br/><br/>-- <br/> :: <br/> article seven Andrew Green<br/> automatic internet andrew@article7.co.uk | www.article7.co.uk<br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg291.html Wed, 20 Aug 2003 14:15:22 +0000 Re: trailing spaces by Richard Proctor On Wed 20 Aug, Colin Foster wrote:<br/>&gt; Hi, <br/>&gt; <br/>&gt; Is there an easy way to remove the trailing<br/>&gt; spaces in the string &quot;TRAILING SPACES &quot;<br/>&gt; <br/>&gt; Thanks,<br/>&gt; Colin. <br/>&gt; <br/><br/>$string = &quot;TRAILING SPACES &quot;;<br/>$string =~ s/\s*$//;<br/><br/>Richard<br/><br/>-- <br/>Personal Richard@waveney.org http://www.waveney.org<br/>Telecoms Richard@WaveneyConsulting.com http://www.WaveneyConsulting.com<br/>Web services Richard@wavwebs.com http://www.wavwebs.com<br/>Independent Telecomms Specialist, ATM expert, Web Analyst &amp; Services<br/><br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg290.html Wed, 20 Aug 2003 13:26:04 +0000 Re: trailing spaces by Nicholas Clark On Wed, Aug 20, 2003 at 02:07:59PM +0000, Colin Foster wrote:<br/>&gt; Hi, <br/>&gt; <br/>&gt; Is there an easy way to remove the trailing<br/>&gt; spaces in the string &quot;TRAILING SPACES &quot;<br/><br/>You seem to be missing a closing quote on that.<br/><br/>Probably the easiest way is with a regular expression. If your string is in<br/>$a, then<br/><br/> $a =~ s/ +$//;<br/><br/>will strip spaces from the end.<br/><br/>Nicholas Clark<br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg289.html Wed, 20 Aug 2003 12:08:56 +0000 trailing spaces by Colin Foster Hi, <br/><br/>Is there an easy way to remove the trailing<br/>spaces in the string &quot;TRAILING SPACES &quot;<br/><br/>Thanks,<br/>Colin. <br/> http://www.nntp.perl.org/group/perl.riscos/2003/08/msg288.html Wed, 20 Aug 2003 09:48:58 +0000