Re: Urgent - Getting the left most 3 characters from a string...

2002-02-15 Thread Chris
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

Re: Urgent - Getting the left most 3 characters from a string...

2002-02-15 Thread Andrea Holstein
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

Re: Urgent - Getting the left most 3 characters from a string...

2002-02-14 Thread Chris
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

Re: Urgent - Getting the left most 3 characters from a string...

2002-02-14 Thread Tanton Gibbs
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

Re: Urgent - Getting the left most 3 characters from a string...

2002-02-14 Thread Chris
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

Re: Urgent - Getting the left most 3 characters from a string...

2002-02-14 Thread Chris Ball
> "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

Re: Urgent - Getting the left most 3 characters from a string...

2002-02-14 Thread Brett W. McCoy
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

Urgent - Getting the left most 3 characters from a string...

2002-02-14 Thread Chris
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