Hey all,
Please don't stree to much over this one but, is there an easier way of
writing this?
while(1){
if ($status == 1) {
#Do this sub...
sub();
elsif ($status == 1) {
#Do this other sub...
sub2();
} else {
#Continue while loop...
}
}
Can I make it smaller. I wan
Dan, does sub() changes the value of $status? Also, do sub() and sub2()
break the loop?
Daniel Falkenberg wrote:
> Hey all,
>
> Please don't stree to much over this one but, is there an easier way of
> writing this?
>
> while(1){
> if ($status == 1) {
> #Do this sub...
> sub();
>
t;Sent: Wednesday, 5 December 2001 3:27 PM
>To: Daniel Falkenberg
>Cc: [EMAIL PROTECTED]
>Subject: Re: Simpler
>
>
>Dan, does sub() changes the value of $status? Also, do sub() and sub2()
>break the loop?
>
>Daniel Falkenberg wrote:
>
>>Hey all,
>>
>&
On Wed, 5 Dec 2001, Daniel Falkenberg <[EMAIL PROTECTED]> wrote,
> Hey all,
>
> Please don't stree to much over this one but, is there an easier way of
> writing this?
>
> while(1){
> if ($status == 1) {
> #Do this sub...
> sub();
> elsif ($status == 1) {
> #Do this other sub...
At 15:22 12.05.2001 +1030, Daniel Falkenberg wrote:
>Hey all,
>
>Please don't stree to much over this one but, is there an easier way of
>writing this?
Ok. I haven't read the thread yet because I want to take a fresh shot at
this...
so here goes...
>while(1){
> if ($status == 1) {
> #D
Hello Daniel,
Wednesday, December 05, 2001, Daniel Falkenberg <[EMAIL PROTECTED]> wrote:
DF> Please don't stree to much over this one but, is there an easier way of
DF> writing this?
DF> while(1){
DF> if ($status == 1) {
DF> #Do this sub...
DF> sub();
DF> elsif ($status == 1) {
DF>
December 2001 11:38
To: [EMAIL PROTECTED]
Subject: Re: Simpler
Hello Daniel,
Wednesday, December 05, 2001, Daniel Falkenberg
<[EMAIL PROTECTED]> wrote:
DF> Please don't stree to much over this one but, is there an easier way of
DF> writing this?
DF> while(1){
DF>
On Wed, 5 Dec 2001, Daniel Falkenberg wrote:
> Please don't stree to much over this one but, is there an easier way of
> writing this?
>
> while(1){
> if ($status == 1) {
> #Do this sub...
> sub();
> elsif ($status == 1) {
> #Do this other sub...
> sub2();
> } else {
> #
Hello Sandeep,
Wednesday, December 05, 2001, Shinagare, Sandeep <[EMAIL PROTECTED]>
wrote:
SS> Hi All,
SS> I am trying to learn Perl and want to begin with getting an interpreter for
SS> the Windows OS (NT).
SS> Which are the good ones around for download?
http://www.perl.com/pub/a/language/inf
Hi all, I am now making a bookshelf program with perl.
At this very beginning, I do wonder if the below script
can be simpler or not...
sub getQuery
{my $queryStr = @_; my %ret;
if (! $queryStr) { $ret{user} = 'system' ; $ret{book} = 'index' ;
$ret{page}
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') ||
> 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
on Thu, 20 Jun 2002 17:27:35 GMT, Connie Chan wrote:
> Hi all, I am now making a bookshelf program with perl.
> At this very beginning, I do wonder if the below script
> can be simpler or not...
>
> [code snipped]
Please don't do this: use CGI.pm instead:
#! pe
t;handle like /?user=who&book=what&page=num, so I can deal with it by
>hash. But does anyway can make the above script simpler if I really got
>to deal on query string as this way ? ( Actually I am interested to
>learn what I can do to deal with this matching =) )
If you want
Thanks a lot Japhy, that's exactly the key I want =)
Assign the value at first, replace it when match...
That's very great !!!
Smiley Connie =)
>
> sub getQuery {
> my %ret = (
> user => 'system',
> book => 'index',
> page => 0,
> );
>
> my $query = shift or ret
Why CGI.pm ? What difference ? =)
- Original Message -
From: "Felix Geerinckx" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 21, 2002 1:54 AM
Subject: Re: Would it be simpler ?
> on Thu, 20 Jun 2002 17:27:35 GMT, Connie Chan wrote:
>
&g
on Thu, 20 Jun 2002 20:37:32 GMT, Connie Chan wrote:
> Why CGI.pm ? What difference ? =)
Because it already contains all logic to parse *all* standards conforming
query-strings, not only your special case.
Soon you may want to work with an html-form instead of appending the query
string to a U
On Jun 21, Connie Chan said:
>Why CGI.pm ? What difference ? =)
Because CGI does it right. It's easy to do it wrong. Very wrong, very
easily.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.
Hello, I'm new to perl.
I'm trying a regular expression that accepts register
format for assembly. (r0 - r31)
I have this regexp
$in =~ /\b[rR] ( ([0-9]) | ( [12][0-9] ) | ( 3[01]
))\b/x;
it works fine but I'm not satisfied with it.. (too
long!)
I have something in mind but I dont know th
pablo wablo [pw], on Saturday, December 4, 2004 at 21:07 (-0800 (PST))
has on mind:
pw> $in =~ /\b[rR] ( ([0-9]) | ( [12][0-9] ) | ( 3[01]
pw> ))\b/x;
pw> it works fine but I'm not satisfied with it.. (too
pw> long!)
it's nothing bad on your regexp, just you could use \d instead [0-9].
Defining
20 matches
Mail list logo