in reply to Re: obtaining the three leftmost characters of a string
in thread obtaining the three leftmost characters of a string

Please do not use arrow as a synonym for comma except in the privacy of your own cubicle. Otherwise, in the most general case, it can lead to breakage. Witness:
@things = split /,/ => $input; # works use constant DELIMITER => ','; @things = split DELIMITER => $input; # BREAKS (treats DELIMITER as a q +uoted word) @things = split DELIMITER, $input; # works
Fat arrow should be used only when the quoting powers are wanted, and possibly to set up hash key/value pairs, paying special care to in-scope "use constants".

-- Randal L. Schwartz, Perl hacker

  • Comment on •Fat Arrow abuse (was Re: Re: obtaining the three leftmost characters of a string)
  • Download Code