Re: default value from match

2005-04-20 Thread Chris Devers
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

Re: default value for input

2004-02-24 Thread Tim
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

Re: default value for input

2004-02-24 Thread Kenton Brede
\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

Re: default value for input

2004-02-24 Thread James Edward Gray II
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

Re: default value for input

2004-02-24 Thread Anthony Vanelverdinghe
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,

Re: default value for input

2004-02-24 Thread James Edward Gray II
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 = <>

Re: default value for input

2004-02-24 Thread Anthony Vanelverdinghe
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:

Re: default value for input

2004-02-24 Thread Kenton Brede
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

RE: default value

2002-04-10 Thread Jeff 'japhy' Pinyan
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

RE: default value

2002-04-10 Thread David Gray
> $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

Re: default value -simpler method?

2002-04-10 Thread Elias Assmann
> 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

Re: default value -simpler method?

2002-04-10 Thread p
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') ||

RE: default value

2002-04-09 Thread Michael Gargiullo
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 = ); $

RE: default value

2002-04-09 Thread Wagner-David
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

Re: default value

2002-04-09 Thread Jeff 'japhy' Pinyan
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