Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use strict; if ($line =~ /TC/g) { my $lookfor = "TC"; } else { my $lookfor = "26 "; } print $lookfor;
janitored by ybiC: Balanced <code> tags around codeblock, wee tiny format cleanups, strike extraneous leading "use strict; " from title
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Use variable outside if statement
by davido (Cardinal) on Dec 17, 2003 at 22:52 UTC | |
|
Re: Use variable outside if statement
by pg (Canon) on Dec 18, 2003 at 04:05 UTC | |
by davido (Cardinal) on Dec 18, 2003 at 04:22 UTC | |
by skyknight (Hermit) on Dec 18, 2003 at 16:33 UTC | |
|
Re: Use variable outside if statement (use ? : or do {...})
by grinder (Bishop) on Dec 18, 2003 at 09:01 UTC | |
|
Re: Use variable outside if statement
by ysth (Canon) on Dec 18, 2003 at 21:35 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |