On Wed, 20 Apr 2005, Keith Worthington wrote:
> Having written the following code I am now troubled by v_feet_str or
> v_inch_str being undefined. If there is no match can I return a
> default value? In my case if there is no dimension then I want to
> move ahead using a zero in that position
ECTED]>
To: [EMAIL PROTECTED]
Subject: Re: default value for input
Date: Tue, 24 Feb 2004 13:05:09 -0600
On Tue, Feb 24, 2004 at 07:41:46PM +0100, Anthony Vanelverdinghe
([EMAIL PROTECTED]) wrote:
> Hi
>
> is it possible to give a default value to the input you're asking? I tried
&g
\n";
} else {
print "$prefix$url\n";
}
>
> >From: Kenton Brede <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: default value for input
> >Date: Tue, 24 Feb 2004 13:05:09 -0600
> >
> >On Tue, Feb 24, 2004 at 07:41:46PM +0
On Feb 24, 2004, at 1:35 PM, Anthony Vanelverdinghe wrote:
It works fine!
So it isn't possible to show this on the screen so that the user can
see it's already there and just has to complete the url??
print "Enter URL: http://";;
chomp( my $input = <> );
$input = 'http://' . $input unless m!^htt
It works fine!
So it isn't possible to show this on the screen so that the user can see
it's already there and just has to complete the url??
Thanks
Anthony
_
Je horoscoop al gelezen? http://www.msn.be/horoscoop
--
To unsubscribe,
On Feb 24, 2004, at 1:19 PM, Anthony Vanelverdinghe wrote:
Thanks!
But the problem is the following:
the user has to enter an url and now i want to put "http://"; always in
front (and show it on the screen) so that the user doesn't have to
enter this everytime.
How about:
chomp( my $input = <>
Thanks!
But the problem is the following:
the user has to enter an url and now i want to put "http://"; always in front
(and show it on the screen) so that the user doesn't have to enter this
everytime.
From: Kenton Brede <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject:
On Tue, Feb 24, 2004 at 07:41:46PM +0100, Anthony Vanelverdinghe ([EMAIL PROTECTED])
wrote:
> Hi
>
> is it possible to give a default value to the input you're asking? I tried
> the code below but this didn't work.
>
> $URL = "http://";;
> chomp ($URL = $URL.<>);
I've set up a default variable
On Apr 10, David Gray said:
>> $question = $default if $question eq '';
>
>You could possibly shorten this last line to:
>
>$question ||= $default;
>
>This will set $question to $default if $question logically evaluates to
>false (which includes the case where $question is the empty string). If
> $question = $default if $question eq '';
You could possibly shorten this last line to:
$question ||= $default;
This will set $question to $default if $question logically evaluates to
false (which includes the case where $question is the empty string). If
you only want to reset $question whe
> my $age = param('age') || 12;
>
> Is that an acceptable way of doing things, or is there some
> glaringly obvious mistake? It seems to pick up null and undefined
> values okay, without any errors (i.e. no age param, or age= will
> get 12). Only problem is that it treats 0 as null/undefined, bu
Hi,
Just out of interest, could you do it this way:
my $default = "/foo/bar/blat";
print "File to use? [$default] ";
chomp(my $question = || $default);
I've just started using this sort of approach to assign default values to
undefined/null parameters, eg:
my $age = param('age') ||
On Apr 9, Michael Gargiullo said:
>While asking a few questions to run a script. How can I give a default
>answer?
>
>print "File to use:";
>chomp(my $question = );
Most programs do it like so:
my $default = "/foo/bar/blat";
print "File to use? [$default] ";
chomp(my $question = );
$
I usually display what the defaults are at first and then use a carriage
return to signify that is what I want.
You can test like:
if ( $question eq '' ) {
# place the default value into $question
}
I usually use a infinite loop and when values
On Apr 9, Michael Gargiullo said:
>While asking a few questions to run a script. How can I give a default
>answer?
>
>print "File to use:";
>chomp(my $question = );
Most programs do it like so:
my $default = "/foo/bar/blat";
print "File to use? [$default] ";
chomp(my $question = );
$q
15 matches
Mail list logo