have to change it :). i have just given you a hint.
> >
> > Ashok
> >
> > On 8/31/06, Owen <[EMAIL PROTECTED]> wrote:
> > >
> > > On Wed, 30 Aug 2006 15:44:53 -0700 (PDT)
> > > "Mary Anderson" <[EMAIL PROTECTED]> wrote:
> >
On 9/1/06, Lou Hernsen <[EMAIL PROTECTED]> wrote:
Well... he's right
Right is a matter of opinion. Trolling is a matter of fact. And he's a
troll. At this point, it doesn't really matter if he's right or wrong.
Its confusing and overly complicated, in its multiple syntaxes, for a
compiled lan
a cgi
> > application. I have a loop which reads certain fields, hashed on names.
> > Some of my fields hold character strings, some hold numbers. Sometimes
> > the number field is a blank. I need a test on the field value
> $fieldValue
> > which will tell me if my fie
e the time
right now to learn a new language.
Rev. Lou Hernsen
self employed
- Original Message -
From: "Paul Archer" <[EMAIL PROTECTED]>
To: "Derek Ash" <[EMAIL PROTECTED]>
Cc:
Sent: Friday, September 01, 2006 10:07 AM
Subject: Re: figuring out if a numbe
Derek, it was nice of you to include your title and all. That way when a
future (potential) employer Googles you, they'll know for sure that it was
you that was this childish and immature.
8:13am, Derek Ash wrote:
Perl Sucks!
Derek Ash
Application Programmer II
University of Illinois Colleg
;
> > Hi All,
> >I know this isn't strictly a cgi problem, but it is arising in a
cgi
> > application. I have a loop which reads certain fields, hashed on
names.
> > Some of my fields hold character strings, some hold numbers.
Sometimes
> > the number field is
ECTED]> wrote:
>
> Hi All,
>I know this isn't strictly a cgi problem, but it is arising in a cgi
> application. I have a loop which reads certain fields, hashed on names.
> Some of my fields hold character strings, some hold numbers. Sometimes
> the number field is a
fields hold character strings, some hold numbers. Sometimes
> the number field is a blank. I need a test on the field value $fieldValue
> which will tell me if my field was blank regardless of whether it holds a
> character string or a number.
>
> I would like to say som
Mary Anderson wrote:
> Hi All,
>I know this isn't strictly a cgi problem, but it is arising in a cgi
> application. I have a loop which reads certain fields, hashed on names.
> Some of my fields hold character strings, some hold numbers. Sometimes
> the number field i
Hi All,
I know this isn't strictly a cgi problem, but it is arising in a cgi
application. I have a loop which reads certain fields, hashed on names.
Some of my fields hold character strings, some hold numbers. Sometimes
the number field is a blank. I need a test on the field
The following statement is causing the warning in the
subject line. Am I doing something wrong or is there a
flaw in the cgi module I'm using?
line 172: foreach ($q->param) {
I am also getting this same error (or is it a
warning?) when I call a function:
$Case = $factory->mfr(name => $Data{"Ca
On Wed, 26 Feb 2003 19:47:35 -0500, Casey West wrote:
> Here's a nice trick. Use the int() function. It's documented in
> perlfunc, a short to the documentation is 'perldoc -f int'.
>
> When passed a string, int() will return 0. When passed a number, it
>
On Wed, 26 Feb 2003 16:30:56 -0800, T. Murlidharan Nair wrote:
> Is there a quick and easy way to check this. I was trying using a reg exp
> if(/^[-0-9][\.0-9]*/) {
> do something
> }
In CPAN there's also a module
Regexp::Common
that has a lot of commonly requested regexps.
E.g. also
$RE{num}{re
t; : >> Is there a quick and easy way to check this. I was trying using a reg
exp
> : >> if(/^[-0-9][\.0-9]*/) {
> : >> do something
> : >> }
> : >>
> : >> but this breaks when the number is say --75.4 It still accepts if it
> : >> has tw
. I was trying using a reg exp
if(/^[-0-9][\.0-9]*/) {
do something
}
but this breaks when the number is say --75.4 It still accepts if it
has two - signs.
$_ = 4.01;
if (/\D/){ print "has nondigits\n" }
if (/^\d+$/) { print "is a whole number\
on Thu, 27 Feb 2003 13:34:40 GMT, [EMAIL PROTECTED] (Zentara)
wrote:
> if (/\D/){ print "has nondigits\n" }
> if (/^\d+$/) { print "is a whole number\n" }
> if (/^-?\d+$/) { print "is an integer\n" }
> if (/^[+-]?\d+$/){
thing
>}
>
>but this breaks when the number is say --75.4 It still accepts if it
>has two - signs.
$_ = 4.01;
if (/\D/){ print "has nondigits\n" }
if (/^\d+$/) { print "is a whole number\n" }
if (/^-?\d+$/) { print "is an integer\n
quick and easy way to check this. I was trying using a reg exp
> : if(/^[-0-9][\.0-9]*/) {
> : do something
> : }
> :
> : but this breaks when the number is say --75.4 It still accepts if it
> : has two - signs.
>
> Here's a nice trick. Use the int() function. It'
-9][\.0-9]*/) {
: >> do something
: >> }
: >>
: >> but this breaks when the number is say --75.4 It still accepts if it
: >> has two - signs.
:
: I just created a script for testing on the CLI for requiring 5 digit zip
: code, for which i have imported 50,000 zip cod
: }
:
: but this breaks when the number is say --75.4 It still accepts if it
: has two - signs.
Here's a nice trick. Use the int() function. It's documented in
perlfunc, a short to the documentation is 'perldoc -f int'.
When passed a string, int() will return 0. When pass
on Thu, 27 Feb 2003 00:30:56 GMT, [EMAIL PROTECTED] (T. Murlidharan
Nair) wrote:
> I have a cgi that need to accept only numeric values. ie +ve or
> -ve real numbers.
> Is there a quick and easy way to check this.
This is a FAQ. See
perldoc -q float
--
feliex
--
To unsubscribe, e
>> I have a cgi that need to accept only numeric values. ie +ve or -ve
>> real numbers.
>> Is there a quick and easy way to check this. I was trying using a reg exp
>> if(/^[-0-9][\.0-9]*/) {
>> do something
>> }
>>
>> but this breaks when the num
I have a cgi that need to accept only numeric values. ie +ve or -ve
real numbers.
Is there a quick and easy way to check this. I was trying using a reg exp
if(/^[-0-9][\.0-9]*/) {
do something
}
but this breaks when the number is say --75.4 It still accepts if it
has two - signs.
Thanks for
Use the same syntax and only change the command: sprintf insted of printf.
//fluff
- Original Message -
From: "Jattie van der Linde" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 29, 2003 3:02 PM
Subject: Number format control
c syntax equi
rl command outputting a floating point number without
>decimals. I read telephone from the database and they print as 6704046.0 I want to
>get rid of the .0
>
Should work the same, perldoc -f printf , perldoc -f sprintf. Assuming you don't
care, you could always turn it into
On Wed, 29 Jan 2003 14:02:47 +, Jattie Van Der Linde wrote:
> c syntax equivalent: printf ("%3.0f",Value); /*if value = 123.456 result would be
>123*/
>
> What is the equivalent perl command ...
printf "%3.0f", $Value;
Cheerio,
Janek
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For add
c syntax equivalent: printf ("%3.0f",Value); /*if value = 123.456 result would be 123*/
What is the equivalent perl command outputting a floating point number without
decimals. I read telephone from the database and they print as 6704046.0 I want to get
rid of the .0
--
To unsu
Hi,
To represent line number in error file we will use $.
To represent column number in error file what is the prompt?
Help will be appreciated.
Regards,
Ganesh
--
N. Ganesh Babu
Asst. Production Manager
Apex Logical Dataconversion Pvt. Ltd.
303 & 304 M.G.R. Estate
Dwarakapuri Co
--- Ramon Hildreth <[EMAIL PROTECTED]> wrote:
> Hi,
> When the sub (listed below) is called, it generates a "1" within
> tags as the first table cell in the table.
> I am mystified to as why this is happening. I just have td's with labels
> and form elements.
> ??
> Any ideas, is this a bug?
Yo
-value => "",
-maxlength=>'40',
-size=>'40',
)]),
td([
"phone number: ",
> -Original Message-
> From: Mike Craig [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 10:02 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Rounding a number
>
>
> Hi,
>
> Unless I have missed exactly what you need, this should work
>
D]
Subject: RE: Rounding a number
> -Original Message-
> From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 4:54 AM
> To: [EMAIL PROTECTED]
> Subject: Rounding a number
>
>
> Hi all,
>
> I would like to round a number but
woops that won't work :-(
does perl have a ceil function?
> -Original Message-
> From: Kipp, James [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 11:58 AM
> To: 'Octavian Rasnita'; [EMAIL PROTECTED]
> Subject: RE: Rounding a number
>
&g
Yet another example of how to do rounding; this time using sprintf (I
think I grabbed this from a TechRepublic Perl Tip email)
ROUNDING NUMBERS USING SPRINTF
Perl doesn't have a function specifically for rounding numbers to a
specified number of decimal places. However, yo
do you mean ro round up to the next num, if so:
$num = 1.2;
$roundup = int($num) +1;
> -Original Message-
> From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 4:54 AM
> To: [EMAIL PROTECTED]
> Subject: Rounding a number
>
>
&
> -Original Message-
> From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 4:54 AM
> To: [EMAIL PROTECTED]
> Subject: Rounding a number
>
>
> Hi all,
>
> I would like to round a number but to the next integer not
How about:
my $nu = 1.543
$num =~ s/\..*$//;
$num++;
it's not exactly pretty, but it does work...
R
At 11:53 12/09/2002 +0300, Octavian Rasnita wrote:
>Hi all,
>
>I would like to round a number but to the next integer not like the int
>function does.
>
>I've tri
Octavian Rasnita wrote:
> Hi all,
>
> I would like to round a number but to the next integer not like the int
> function does.
>
> I've tried:
>
> my $num = 1.33;
> $num = $num + 0.49;
> $num = sprintf "%.0f", $num;
>
> This works but I am
Hi all,
I would like to round a number but to the next integer not like the int
function does.
I've tried:
my $num = 1.33;
$num = $num + 0.49;
$num = sprintf "%.0f", $num;
This works but I am wondering if there is a cleaner and better solution
because there is a small cha
lse {} (or elsif). The ^ character means
"starts with" in a regex.
Scot R.
inSite
-Original Message-
From: Bo Mangor [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 20, 2002 1:49 PM
To: [EMAIL PROTECTED]
Subject: SV: number
Hi again
Great thanks to all the quickly answers!
I tr
Bo Mangor wrote:
>
> But how does it work? "if(string =~/^[0-9]/)"
>
> The part string =~/^[0-9]/ - does it split the string into single
> numbers and check if each of them is a part of the list [0-9] ??
> I want to be scour that I have understood the Principe correct.
i would suggest
0-9] ??
I want to be scour that I have understood the Principe correct.
Best regards
Bo
-Oprindelig meddelelse-
Fra: Christopher G Tantalo [mailto:[EMAIL PROTECTED]]
Sendt: 20. juni 2002 20:25
Til: Bo Mangor
Emne: Re: number
Bo Mangor wrote:
> Hi there
>
> I'm a new bir
ursday, June 20, 2002 1:17 PM
To: [EMAIL PROTECTED]
Subject: number
Hi there
I'm a new bird to Perl - and I have a little problem.
I have a file input where I split the file into an array and that works
fine, but there is some "spam" in the beginning of the file I want to
get rid
s
> with this "spam"!
>
> Therefore I want to make a check that excludes all lines there doesn't
> start with a number
> [...]
> How do I make this check In Perl?
#! perl -w
use strict;
while () {
last if /^\d+/;
}
do {
print; # or do s
my $file = '/path/to/file';
if ($file !~ /^\d/) {
.
}
-Original Message-
From: Bo Mangor [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 20, 2002 1:17 PM
To: [EMAIL PROTECTED]
Subject: number
Hi there
I'm a new bird to Perl - and I have a little problem.
I have a f
with this "spam"!
Therefore I want to make a check that excludes all lines there doesn't
start with a number in other languages I would make a check like
If (! isNaN(string)) {
}
How do I make this check In Perl?
I haven't been able to find something similar in Perl, bu
Octavian Rasnita wrote at Sun, 09 Jun 2002 08:42:34 +0200:
> Hi all,
>
> I want to check if in a string there are more than 3 capital letters. I've tried
>using:
>
> if ($string=~ /[A-Z]{3,}/) {
>
> }
> }
> This match at least 3 capitals only if they are one after another. I want to check
Teddy --
...and then Octavian Rasnita said...
%
% Hi all,
Hello!
%
% I want to check if in a string there are more than 3 capital letters.
% I've tried using:
%
% if ($string=~ /[A-Z]{3,}/) {
...
%
% For example, I want to match this string: "AxxxBxxxCxxx".
That's not so bad:
[zero] [9
Hi all,
I want to check if in a string there are more than 3 capital letters.
I've tried using:
if ($string=~ /[A-Z]{3,}/) {
}
This match at least 3 capitals only if they are one after another.
I want to check if the string contains at least 3 capitals, doesn't matter
how are they position
165AGKB and it would still pass the reg exp because the proper
formatted serial number is embedded somewhere in that string. With the ^ and
$, it will only pass if these are the only characters in a string.
Best Regards,
JOSHUA D. HAYDEN
- Original Message -
From: "Tim Doty"
L PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: pattern matching for serial number
>
>
> Sorry, while typing I missed the slash, it is there in my code as -
> if ($serial !~ m/[0-9]{3}[A-Z]{2}[0-9]{3} /)
> Is there any thing wrong with this ?
> Kamali
> >>
Sorry, while typing I missed the slash, it is there in my code as -
if ($serial !~ m/[0-9]{3}[A-Z]{2}[0-9]{3} /)
Is there any thing wrong with this ?
Kamali
>>> fliptop <[EMAIL PROTECTED]> 04/26/02 08:54AM >>>
Kamali Muthukrishnan wrote:
> Hi guys :
> I have serial numbers with a pattern : 3 nu
> -Original Message-
> From: Kamali Muthukrishnan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 26, 2002 9:39 AM
> To: [EMAIL PROTECTED]
> Subject: pattern matching for serial number
>
>
> Hi guys :
> I have serial numbers with a pattern : 3 numbers follo
Kamali Muthukrishnan wrote:
> Hi guys :
> I have serial numbers with a pattern : 3 numbers followed by 2 capital letters
>followed by 3 numbers.
> To validate this -
> if ($serial !~ m/[0-9]{3}[A-Z]{2}[0-9]{3} )
> { # display error ; }
> I get a syntax error.
i think you're missing a
Hi guys :
I have serial numbers with a pattern : 3 numbers followed by 2 capital letters
followed by 3 numbers.
To validate this -
if ($serial !~ m/[0-9]{3}[A-Z]{2}[0-9]{3} )
{ # display error ; }
I get a syntax error.
Can you help me , please ?
Kamali
--
To unsubscribe, e-mail: [EMAI
#no checkboxes#
my %params = $q->Vars;
foreach my $i (keys %params)
{if ($params{$i} eq "" || $params{$i} eq " ")
{print <<"PrintTag";
Error!
Alert!
I'm sorry but all fields need to be filled out except the check boxes.
Please push the back button on your browser and try again.
PrintT
[EMAIL PROTECTED] wrote:
> On Wed, 17 Apr 2002 [EMAIL PROTECTED] wrote:
>
> sub missing_params {
> foreach (keys %form_fields) {
> next if defined param($_);
> push @missing,$form_fields{$_};
> }
> return scalar(@missing);
> }
what if a value is the null string? you need to ch
On Wed, 17 Apr 2002 [EMAIL PROTECTED] wrote:
> What's the simplest way to make sure that all 10 fields have been
> selected? I was hoping that...
A slightly shorter, more elegant solution:
#! /usr/bin/perl -w
use CGI qw(:standard);
use vars qw(%form_fields @missing);
%form_fields = (
On Wed, 17 Apr 2002 [EMAIL PROTECTED] wrote:
> What's the simplest way to make sure that all 10 fields have been
> selected?
This seems pretty straight-forward: param() returns a list of all form
elements - even the form elements without values. To check that each field
contains a value.
#! /
Hello, All:
What's the simplest way to make sure that all 10 fields have been
selected? I was hoping that...
display_error_message() if param() < 10;
would work, but it doesn't seem to work correctly.
--
Eric P.
Los Gatos, CA
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addition
Hi from Ýstanbul,
I don't know if my problem is related with
Number::Format module. The problem is like below:
I want to convert a number to comma seperetad with
Number::Format module ( 42345765 --> 42,345,765 )
I got 2 cgi files that one of them is wokin' but
Hello:
Been following the discussions for some time. The help has been
invaluable, but I have a regexp that I am having trouble with.
I am working on a search engine for my sites FAQs. The user can enter
any text they choose. The subroutine replaces all char that are not
A-Za-z0-9 " \s with
page 75 of the Camel book ..
$cnt = tr/0-9//; count the digits in $_
hope this gets you started ...
-Original Message-
From: Rene Verharen [mailto:[EMAIL PROTECTED]]
Sent: October 11, 2001 15:59
To: Beginners-CGI List
Subject: Determine number or word
Hi,
Is there a simple way to
Hi,
Is there a simple way to determine if a variable contains a number or (one
or more) alpha-nummeric characters ?
Vriendelijke groet,
Rene Verharen
[EMAIL PROTECTED]
http://www.verharen.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
On 8/5/01 10:12 AM, Brian wrote:
> Okay guys, can we PLEASE not post messages to both the beginners and the
> beginners-cgi lists? I'm on both, and I know that lots of the people
> out there are on both. So, we end up with 2 copies of each message.
> Plus, if you have your filters set up stupid
Okay guys, can we PLEASE not post messages to both the beginners and the
beginners-cgi lists? I'm on both, and I know that lots of the people
out there are on both. So, we end up with 2 copies of each message.
Plus, if you have your filters set up stupid like some of us (yeah, me)
you end up wit
66 matches
Mail list logo