Andrea Holstein wrote:
> In article <[EMAIL PROTECTED]> wrote "Chris" <[EMAIL PROTECTED]>:
>
>
>>>...
>>>
>>Thanks!
>>
>>...
>> my $newresult = $result;
>> print "New Results - $$newresult\n";
>> my $resultcode;
>> print "Result Code - $$resultcode;\n";
>> if ($newresult = 20
In article <[EMAIL PROTECTED]> wrote "Chris" <[EMAIL PROTECTED]>:
>> ...
> Thanks!
>
> ...
> my $newresult = $result;
> print "New Results - $$newresult\n";
> my $resultcode;
> print "Result Code - $$resultcode;\n";
> if ($newresult = 200) {
Take Care: You surely meant
ot;Chris" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, February 14, 2002 12:11 PM
> Subject: Re: Urgent - Getting the left most 3 characters from a string...
>
>
>
>>Brett W. McCoy wrote:
>>
>>>On Thu, 14 Feb 2002, Chris
lue\n";
}
will print out
value = 100
value = 200
because an assignment to a non zero value is true.
HTH,
Tanton
- Original Message -
From: "Chris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 14, 2002 12:11 PM
Subject: Re: Urgent - Getting the
Brett W. McCoy wrote:
> On Thu, 14 Feb 2002, Chris wrote:
>
>
>>if left($result,3) = "500" Then
>>Do whatever
>>Else
>> Blah Blah Blah
>>End If
>>
>>In Perl I want to do:
>>
>>if (left($result), 3) = 500 {
>>Do whatever;
>>} else {
>> Blah Blah Blah;
>>}
>>
>>How can I do the lef
> "chris" == chris <[EMAIL PROTECTED]> writes:
chris> if left($result,3) = "500" Then Do whatever Else Blah Blah
chris> Blah End If
if (substr($result,0,3) == 500) { do(stuff); } else { do(more_stuff); }
Note the arguments to substr are the start position (0 - the first
digit) and
On Thu, 14 Feb 2002, Chris wrote:
> if left($result,3) = "500" Then
> Do whatever
> Else
> Blah Blah Blah
> End If
>
> In Perl I want to do:
>
> if (left($result), 3) = 500 {
> Do whatever;
> } else {
> Blah Blah Blah;
> }
>
> How can I do the left in Perl
if(substr($result
I am getting the HTTP result codes and trying to parse just the left
most 3 characters:
500 Can't connect to www.1k2k3k4j.com:80 (Bad hostname 'www.1k2k3k4j.com')
I only want 500
In VB I could use:
if left($result,3) = "500" Then
Do whatever
Else
Blah Blah Blah
End If
In Perl I