in reply to need advice: Perl code layout, long line lengths

I often do "all of the above" (except "leave long lines 'as is' for readability", since I find such longs lines anything but easy to read). As an example, here is an approach that you probably haven't considered, just going to an extreme that I usually wouldn't go to:

my $key= join '\\', 'Micr­osoft', 'Win­dows NT', 'Curren­tVersion', '­Terminal Server', 'In­stall', 'Sof­tware', 'Mic­rosoft', 'Wi­ndows', 'Cur­rentVersio­n', 'RunOnce­Ex';

- tye        

Replies are listed 'Best First'.
Re^2: need advice: Perl code layout, long line lengths (all!)
by resistance (Beadle) on Oct 04, 2008 at 06:51 UTC
    yes, your example could be extreme, but it is IMO more readable then this code from Win32::TieRegistry
    $Registry->Delimiter("/"); $tip18= $Registry->{"HKEY_LOCAL_MACHINE/Software/Microsoft/" . 'Windows/CurrentVersion/Explorer/Tips//18'};

    When I wrote "break the line" I mean this type of splitting. Break my eyes if I read 200 lines of such code :-)

    UPDATE: IMO your code is more readable because I read it in _one_ direction, from up to bottom, and not in Z-style.