> "7" == 7 <7stud.7s...@gmail.com> writes:
7> On Mon, Feb 8, 2010 at 9:33 PM, Uri Guttman wrote:
>> > "7" == 7 <7stud.7s...@gmail.com> writes:
>>
7> they both read fine in english which is why they we included by
>> larry.
7> They don't both read fine. To many people, u
On Mon, Feb 8, 2010 at 9:33 PM, Uri Guttman wrote:
> > "7" == 7 <7stud.7s...@gmail.com> writes:
>
they both read fine in english which is why they we included by
> larry.
They don't both read fine. To many people, unless is a confusing construct.
Larry has made plenty of mistakes design
> "7" == 7 <7stud.7s...@gmail.com> writes:
7> Because unless and until statements are harder to maintain, NO ONE
should
7> use them--least of all beginners.
7> Because unless and until statements are harder to *read and maintain*, NO
ONE
7> should use them--least of all be
> "7" == 7 <7stud.7s...@gmail.com> writes:
7> On Mon, Feb 8, 2010 at 6:19 PM, Uri Guttman wrote:
>> "7" == 7 <7stud.7s...@gmail.com> writes:
7> 7> if (defined $var && ($var eq '' || $var eq '0')) {
7> 7> #code
7> 7> }
7> 7> to handle c
On Mon, Feb 8, 2010 at 6:45 PM, Chris Coggins wrote:
> Thanks Jim. I used
>
> exit(0) unless $varA;
>
That form of unless is especially poor style.
On Mon, Feb 8, 2010 at 9:00 PM, 7 <7stud.7s...@gmail.com> wrote:
> On Mon, Feb 8, 2010 at 6:19 PM, Uri Guttman wrote:
>
>> > "7" == 7 <7stud.7s...@gmail.com> writes:
>>
>> 7> if (defined $var && ($var eq '' || $var eq '0')) {
>>
>> 7> #code
>>
>> 7> }
>>
>> 7> to handle cases where $
On Mon, Feb 8, 2010 at 6:19 PM, Uri Guttman wrote:
> > "7" == 7 <7stud.7s...@gmail.com> writes:
>
> 7> if (defined $var && ($var eq '' || $var eq '0')) {
>
> 7> #code
>
> 7> }
>
> 7> to handle cases where $var = undef. undef acts like it is a blank
> 7> string when used as a string
Jim Gibson wrote:
On 2/8/10 Mon Feb 8, 2010 6:07 PM, "Chris Coggins"
scribbled:
Chris Coggins wrote:
I'm adding this exit step into the script to keep people from trying
to execute it outside of the normal web interface. The script and
browser communicate normally if the script is
On 2/8/10 Mon Feb 8, 2010 6:07 PM, "Chris Coggins"
scribbled:
>
>
> Chris Coggins wrote:
>> I'm adding this exit step into the script to keep people from trying
>> to execute it outside of the normal web interface. The script and
>> browser communicate normally if the script is executed throu
Chris Coggins wrote:
I'm adding this exit step into the script to keep people from trying
to execute it outside of the normal web interface. The script and
browser communicate normally if the script is executed through its
original form. What I'm trying to prevent is someone trying to execute
On 2/8/10 Mon Feb 8, 2010 5:45 PM, "Chris Coggins"
scribbled:
> Thanks Jim. I used
>
> exit(0) unless $varA;
>
> and it worked good from command line. When I try the script through a
> browser pointing to the file like so
> http://domain.com/cgi-bin/script.pl?varA=10
> the script executes
Thanks Jim. I used
exit(0) unless $varA;
and it worked good from command line. When I try the script through a
browser pointing to the file like so
http://domain.com/cgi-bin/script.pl?varA=10
the script executes as it should.
But when I try to send 0 as the value (?varA=0), I get a code 500
> "7" == 7 <7stud.7s...@gmail.com> writes:
7> if (defined $var && ($var eq '' || $var eq '0')) {
7> #code
7> }
7> to handle cases where $var = undef. undef acts like it is a blank
7> string when used as a string.
blah..
unless( $var ) {
is all you need for that si
On 2/8/10, 7 <7stud.7s...@gmail.com> wrote:
> On 2/8/10, 7 <7stud.7s...@gmail.com> wrote:
>> On 2/8/10, Chris Coggins wrote:
>>> What is the proper syntax for a comparison at the end of a subroutine to
>>> stop the script if a certain variable is "0" or ''?
>>>
>>> sub routine{
>>> (get data and p
On 2/8/10, 7 <7stud.7s...@gmail.com> wrote:
> On 2/8/10, Chris Coggins wrote:
>> What is the proper syntax for a comparison at the end of a subroutine to
>> stop the script if a certain variable is "0" or ''?
>>
>> sub routine{
>> (get data and process it)
>> if $varA = '' || $varA = "0" {
>> (sto
On 2/8/10, Chris Coggins wrote:
> What is the proper syntax for a comparison at the end of a subroutine to
> stop the script if a certain variable is "0" or ''?
>
> sub routine{
> (get data and process it)
> if $varA = '' || $varA = "0" {
> (stop script, print error message to user)
> }
> else{
>
On 2/8/10 Mon Feb 8, 2010 4:56 PM, "Chris Coggins"
scribbled:
> What is the proper syntax for a comparison at the end of a subroutine to
> stop the script if a certain variable is "0" or ''?
>
> sub routine{
> (get data and process it)
> if $varA = '' || $varA = "0" {
> (stop script, print err
What is the proper syntax for a comparison at the end of a subroutine to
stop the script if a certain variable is "0" or ''?
sub routine{
(get data and process it)
if $varA = '' || $varA = "0" {
(stop script, print error message to user)
}
else{
(continue with script)
}
--
To unsubscribe, e-mai
18 matches
Mail list logo