Paul Lalli schreef:
> If you have to change existing code
> in order to add new code, that's the definition of not scalable.
"scalable" is about "doing more of the same", along one or more
axes.
For example: having a webpage full of numbers, that is doing a
separate database query for every nu
On Jun 1, 3:47 pm, [EMAIL PROTECTED] (Chas Owens) wrote:
> On 6/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
>
> > Thank you for proving my point for me. :-P
> Umm, no, I didn't. I agreed with part of what you said. You should
> never use an else with an unless, but unless by itself is better, in
Chas Owens wrote:
> On 6/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
>> On Jun 1, 1:49 pm, [EMAIL PROTECTED] (Chas Owens) wrote:
>> > On 6/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote:> On Jun 1, 11:21 am,
>>
>> > > and unscalable. (As soon as you add an 'else' clause,
>> > > people have to read it
On 6/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
On Jun 1, 1:49 pm, [EMAIL PROTECTED] (Chas Owens) wrote:
> On 6/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote:> On Jun 1, 11:21 am,
> > and unscalable. (As soon as you add an 'else' clause,
> > people have to read it two or three times to understand
On Jun 1, 1:49 pm, [EMAIL PROTECTED] (Chas Owens) wrote:
> On 6/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote:> On Jun 1, 11:21 am,
> > and unscalable. (As soon as you add an 'else' clause,
> > people have to read it two or three times to understand what's being
> > done). Avoid at all costs.
>
> W
On 6/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
On Jun 1, 11:21 am, [EMAIL PROTECTED] (Chas Owens) wrote:
> On 6/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
> snip> if (! $ftp ) {
>
> snip
>
> Ugh, use unless () {} rather than if (! ) {}.
Ugh. Never. The only time unless should ever be used
On Jun 1, 11:21 am, [EMAIL PROTECTED] (Chas Owens) wrote:
> On 6/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
> snip> if (! $ftp ) {
>
> snip
>
> Ugh, use unless () {} rather than if (! ) {}.
Ugh. Never. The only time unless should ever be used is in postfix
notation, as in:
die "No arguments p
On 6/1/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
snip
if (! $ftp ) {
snip
Ugh, use unless () {} rather than if (! ) {}.
snip
Even more preferred would be to throw an exception, and let the
calling code deal with it:
my $ftp = Net::FTP->new($remote_host) or
die "failed to connect to $remot
You may want to change this line:
> print LOGFILE "failed to connect to $remote_host\n"
to the following:
print LOGFILE "failed to connect to $remote_host: [EMAIL PROTECTED]"
...and it will print the reason why it could not connect as well.
Steve
--
To unsubscribe, e-mail: [EMAIL PROTEC
On Jun 1, 10:48 am, [EMAIL PROTECTED] (Ben Edwards) wrote:
> I have a perl script that uses FTP. If the ftp server can not be
> conected to I want to write to a log file and exit with a return code
> of 1.
>
> Something like
>
> my $ftp = Net::FTP->new( $remote_host ) or {
> print LOGFIL
On 6/1/07, Ben Edwards <[EMAIL PROTECTED]> wrote:
snip
my $ftp = Net::FTP->new( $remote_host ) or {
print LOGFILE "failed to connect to $remote_host\n"
return(1);
};
But this does not work. So how do I do 2 statements for an or?
snip
my $ftp = Net::FTP->new( $remote_host )
Ben Edwards wrote:
> I have a perl script that uses FTP. If the ftp server can not be
> conected to I want to write to a log file and exit with a return code
> of 1.
>
> Something like
>
>my $ftp = Net::FTP->new( $remote_host ) or {
> print LOGFILE "failed to connect to $remote_host\n"
I have a perl script that uses FTP. If the ftp server can not be
conected to I want to write to a log file and exit with a return code
of 1.
Something like
my $ftp = Net::FTP->new( $remote_host ) or {
print LOGFILE "failed to connect to $remote_host\n"
return(1);
};
But this do
13 matches
Mail list logo