Hello Camillo

It seems you're not too well versed with Perl?

Giarrocco, Camillo wrote:
> Rob,
>
> Thank You for your replay.
>
> Let's say I want check if a file is not less then 10000 bytes
> I would do then:
>
> $size = "10000";

This will work, but "10000" is a string, whereas you really mean
a number. The two are interchangeable in Perl. Might as well say

    $size = 10000;

if that's what you mean.

> If (-s "file" <= $size) {do something...}

This is 'doing something' if the file size is less than or equal
to $size. If you want to do it only "if a file is not less then
10000 bytes" you want:

    If (-s "file" >= $size) {do something...}

but you may as well hard-code the value here unless you
have a reason not to.

    If (-s "file" >= 10000) {do something...}

> else{next;}

Finally, if the else is a 'next' you can reduce this to:

    next If -s "file" < 10000;
    do something...;

How does that fit?

Rob

And by the way, please post to the perl.beginners group,
rather than directly to me. Thanks.
/R




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to