in reply to Re^2: spliting a lengthy text
in thread splitting and coloring

I habitually run perl with -l enabled (see perlrun), which has the effect of setting $/ =  "\n" (and $\ = "\n"), so print adds a newline automatically. Hence the output I posted is unmodifed.

This makes print (roughly?) equivalent to say in Perl 6.

I also seem to recall seeing a news item that suggested that this keyword would also be available in Perl 5 as of v5.10?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^4: spliting a lengthy text
by grinder (Bishop) on Nov 27, 2006 at 14:17 UTC
    I also seem to recall seeing a news item that suggested that this keyword would also be available in Perl 5 as of v5.10?

    Indeed it will. It is implemented as a weak keyword, thus you do have to write

    use feature 'say';

    ... to activate it. A search revealed that there were a number of modules on CPAN (predating the existence of Perl 6) that already define a routine named 'say'. Adding it as a regular keyword would have broken them, as well as unknowable amounts of code living behind firewalls that the porters could never know about.

    The Perl development team places a lot of importance in not breaking existing code (even if it means you have to resort to the above gymnastics in new code). If I remember correctly, a sitecustomize.pl program (run at the start of every incovation implicitly) will allow you to set this once and for all, for all code run on a given host.

    • another intruder with the mooring in the heart of the Perl