in reply to Re: Cleaner code to build hierarchical display of page names
in thread Cleaner code to build hierarchical display of page names

Yeah, I apologize for my print routine, which I just threw together to test my results. I did wonder how to use the tab value to avoid the if's. Didn't realize you could multiply a print statement! Ahhhhh, Perl!


—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot

Replies are listed 'Best First'.
Re^3: Cleaner code to build hierarchical display of page names
by holli (Abbot) on May 17, 2005 at 11:54 UTC
    That's no multiplication. It's a repition.

    From perlop:
    Binary ``x'' is the repetition operator. In scalar context or if the left operand is not enclosed in parentheses, it returns a string consisting of the left operand repeated the number of times specified by the right operand. In list context, if the left operand is enclosed in parentheses, it repeats the list.
    # print row of dashes print '-' x 80; #tab over print "\t" x ($tab/8), ' ' x ($tab%8); # a list of 80 1's @ones = (1) x 80; # set all elements to 5 @ones = (5) x @ones;
    Update: Fixed formatting


    holli, /regexed monk/