in reply to Testing for one of three conditions
What about pushing them onto an array and then joining it. Join already has this logic for needing the | or not, and then you could put pages in the middle easily.
my @links = (); push @links, $firstlink if $. != 1; # push @links, pagelink($page) foreach my $page (@pages); push @links, $lastlink if $. != $total_number_of_lines; print join("|",@links);
Easy to ready and you can have some added functions (maybe, dunno how your code works.) (:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Testing for one of three conditions
by Cody Pendant (Prior) on Apr 27, 2004 at 01:32 UTC | |
|
Re: Re: Testing for one of three conditions
by halley (Prior) on Apr 27, 2004 at 13:10 UTC |