in reply to <> diamond Operator

I wouldn't use:

$lc_str = $str | ("\x20" x (length $str)); push @index, $-[0] while $lc_str =~ /xxx/g; substr($str, $_, 3) = 'ggg' foreach @index;

I also wouldn't use the diamond operator.

Replies are listed 'Best First'.
Re: <> diamond Operator
by jonadab (Parson) on Apr 06, 2005 at 21:38 UTC

    yeah, also don't turn in something like this:

    undef$/;for my$f{open IN,$f xor<IN>;s/(x)\1{2}/'g'x3/iegm;s/alpha/uc$1 +/egm;open OUT =>'>',($f eq'file1')?'sysbacks/file1':(($f eq'file2')?'alpha/file2':(( +$f eq 'file3' )?'gamma/blue':(($f=~/^file[45]$/)?'gamma/green':'/dev/null')))or die; +print OUT $_; }@ARGV;

    Even if it works (which I didn't test), your prof will not give you a good grade for it.