http://qs321.pair.com?node_id=230331


in reply to Cleaning Data Between Specified Columns

You can use the fact that the return value from substr() is an lvalue and do something like:

{ local *tmp = \substr( $source, $start, $len ); $tmp =~ y/'//d; $tmp =~ y/a-zA-Z0-9\n\|-/ /c; }

Replies are listed 'Best First'.
Re^2: Cleaning Data Between Specified Columns
by Aristotle (Chancellor) on Jan 28, 2003 at 01:51 UTC
    Damn. That's great. :) And with a little change it's strict compliant and shorter too:
    { local *_ = \substr $source, $start, $len; y/a-zA-Z0-9\n\|-/ /c; y/'//d; }
    Update: changed order of transliterations to account for the deletion of characters causing extra characters to shift in.

    Makeshifts last the longest.