On Wed, 2004-04-14 at 09:29, Gregor N. Purdy wrote:
> So, we are moving in a more verbose direction, which is a bummer for
> people who like to write one-liners and other tiny programs.

        perl6 -i.bak -ple 'rule octet {\d{1,2}|<[01]>\d{2}|2[<[1-4]>\d|5<[1-5]>]} 
s:g/\b<octet>\.<octet>\.<octet>\.<octet>\b/IP ADDR/;' *

No biggie.

> Assuming only Perl 6 is installed on your system, if your script
> started with:
> 
>   #!/usr/bin/perl
> 
> all the stuff about trying to figure out what version you are using
> would have to apply I suppose. But, if you used this, are we saying
> you still have to do something else to ensure its treated as Perl 6?

Yes, because Perl 6 *is* Perl 5, when it wants to be.

>   #!/usr/bin/perl6
> 
> And, if you did this, you might have to do something else to ensure
> it is treated as Perl 5?

Correct. If you *say* "perl6" and then want to *be* Perl 5, I'm not sure
if a) you could not or b) you would have to throw in something like "use
5".

>   #!/usr/bin/perl5
> 
> that seems wrong.

Not sure why. That is just short-hand for:

        #!/usr/bin/perl
        use 5;
        
I'm not sure, once again, what would happen if you said:

        use 5;
        use 6;

Either it would give you an error (you really deserve it) or it would
just switch back to Perl 6 mode... the problem arises when you ask,
"what about anything that got parsed in between the two?" Yech.

-- 
Aaron Sherman <[EMAIL PROTECTED]>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback


Reply via email to