Gavin Henry wrote:

By the way, my program now works great thanks to your sub advice. I still have some cleaning to do, like my resize sub abd incorporating file tests etc.

You can see how bad my program is at:

http://www.perl.me.uk

It's called ebaypics

Advice from you in a new thread, would be very appreciated.

Don't put quotes around variables.

Found in /usr/lib/perl5/5.8.2/pod/perlfaq4.pod
       What's wrong with always quoting "$vars"?

perldoc perldata


Don't use '&' with subroutine calls.

Found in /usr/lib/perl5/5.8.2/pod/perlfaq7.pod
       What's the difference between calling a function as &foo and foo()?

perldoc perlsub


# Generate weblinks
sub links {
    my ($url, @list) = @_;
    my @return;
    foreach (@list) {
         push @return, "$url/$_\n";
    }
    return @return;
}

# Put the generated weblinks from the subroutine links into an array
my @email_links = links($website, @thumbs);

This is what map() was invented for:

my @email_links = map "$website/$_\n", @thumbs;



John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to