in reply to Perl that moves.
in thread last character in string ?

@l=split(//,$date);pop(@l);foreach(@l){$r.=$_}print$r;

What fun :)

--
my @words = grep({ref} @clever);
sub version { print "I cuss your capitalist pig tendencies bad!\n" }

Replies are listed 'Best First'.
Re: Re: Perl that moves.
by demerphq (Chancellor) on Oct 01, 2001 at 19:55 UTC
    Hi Amoe

    Just thought that someone should mention that your code could be written as so:

    @l=split//,$date;pop @l;print join"",@l;
    The two points I want to make are first, if you are trying to make your code as small as possible then often the parentheses can be left out (as well as trailing semicolons in a scope). Second that the foreach(@l){$r.=$_} is better written as $r=join"",@l;.

    Anyway,

    :-)

    Yves
    --
    You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)