in reply to The Behavior of 'do'

now here's an interesting ditty. When I ran case 4

$_ = 1; do (print); print "\n"; print $!, "\n" if $!;

output:

Perl v49.0.0 required--this is only v5.6.1, stopped at t4.pl line 2.

'Holy Oyster Farts'

mitd-Made in the Dark
'My favourite colour appears to be grey.'

Replies are listed 'Best First'.
Re: Re: The Behavior of 'do'
by wine (Scribe) on Jul 26, 2001 at 23:45 UTC
    On http://archive.develooper.com two bug reports (1, 2) show some other cool perl versions I cannot find anywhere on the web. ;) For instance the super cool version 123.0.0:

    # from msg53551.html jeffp@hut [1:00am] ~ #102> perl -w sub foo { print "ok\n"; 123 } do &foo; ok Perl v123.0.0 required--this is only v5.6.0, stopped (did you mean v123.0.0?) at - line 2.
Re: Re: The Behavior of 'do'
by dsb (Chaplain) on Jul 26, 2001 at 23:52 UTC
    That is strange indeed. I kept experimenting and it seems when the argument to do is higher than the version of Perl running on the machine(even by fractions), that same type of error is thrown, where the 'required' version number is the same as the argument to do.
    do 5.00504; print "\n"; print $!, "\n" if $!; # output: Perl 5.00504 required--this is only version 5.00503, stopped + at do.pl line 6.
    Update: While using a number the same as the version of Perl, the only error thrown is:
    No such file or directory
    do 5.00503; print "\n"; print $!, "\n" if $!; # output: No such file or directory
    But it's good to see that a bug has been reported on that.

    Amel - f.k.a. - kel