Could be that someone would be interested in this thread
from fwp:
http:[EMAIL PROTECTED]/msg02488.html
Friday, June 14, 2002, 9:23:43 PM, Chas Owens wrote:
> On Fri, 2002-06-14 at 15:50, todd r wade wrote:
>>
>>
>> Chas Owens wrote:
>>
>>
>> >
>> >> Alternately, you could say:
>> >>
>> >
> This is one of the reasons I gave up on "-w" a long time ago. You had
> to program around the $^%&@ "use of undefined value" warning constantly.
>
> Of course, Perl 5.6 introduced the "no warnings qw(uninitialized);"
> construct, which helps that problem, at the expense of some typing...
I o
On Fri, 2002-06-14 at 15:50, todd r wade wrote:
>
>
> Chas Owens wrote:
>
>
> >
> >> Alternately, you could say:
> >>
> >> $track ||= '';
> >>
> >> right before the next time you use foo after the split. I dont know
> why this
> >> works offhand, I just remember reading in the docs somewher
> -Original Message-
> From: todd r wade [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 14, 2002 3:51 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: "lazy" variable declaration
>
> ...
> Your examples are neither equivalent no
Chas Owens wrote:
>
>> Alternately, you could say:
>>
>> $track ||= '';
>>
>> right before the next time you use foo after the split. I dont know
why this
>> works offhand, I just remember reading in the docs somewhere that
its exempt
>> from warnings. But for me, that is crossing over int
> Alternately, you could say:
>
> $track ||= '';
>
> right before the next time you use foo after the split. I dont know why this
> works offhand, I just remember reading in the docs somewhere that its exempt
> from warnings. But for me, that is crossing over into the land of ugly =0).
$track
"David T-G" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hmmm... Well, I'll grant you that, but what about the example above? It
> would only be undef for the first N lines that are short, and once it
> gets loaded then it will get reset instead. It seems
"Janek Schleicher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> use strict; use warnings; wasn't made only to make the Perl Community
luckier.
> It can help to avoid typical mistakes like
> (a) mispelling of a variable
> (b) using of an undefined variab
On Wednesday, June 12, 2002, at 06:39 , David T-G wrote:
[..]
> my # vars we will use
> (
> $m3u, # file name
> $mp3, # disk label
> $source,$host,
Janek, et al --
...and then Janek Schleicher said...
%
% David T-G wrote at Wed, 12 Jun 2002 21:50:12 +0200:
%
% > % I would try to write it as
% > % while (<>) {
% > %my ($artist, $album, $track) = split m:/:;
% > %if ($track eq $foo) { # $foo eq "$foo" :-)
% > % ...
% > %}
David,
Could you turn off your MUA's option for sending your email
messages out as "quoted-printable"? Reading your posts has
been difficult at best on an xterm where there is no MIME.
(see included text, below)
It seems you're using mutt as an MUA - I think you should be
able to configure it
David T-G wrote at Wed, 12 Jun 2002 21:50:12 +0200:
> % I would try to write it as
> % while (<>) {
> %my ($artist, $album, $track) = split m:/:;
> %if ($track eq $foo) { # $foo eq "$foo" :-)
> % ...
> %}
> % }
>
> I don't see a difference here except that you're using a vari
Janek, et al --
...and then Janek Schleicher said...
%
% David T-G wrote at Wed, 12 Jun 2002 19:42:46 +0200:
%
...
% >
% > In this limited context, yes. I wouldn't usually declare them all up front.
%
% Well, I thought you never do (as I know you're not a beginner any more)
Oh, I'm still a
David T-G wrote at Wed, 12 Jun 2002 19:42:46 +0200:
> ...
> % - Now Perl's complaining about many no declared variables. % - You declare
>them all at the
> beginning.
>
> In this limited context, yes. I wouldn't usually declare them all up front.
>
Well, I thought you never do (as I know
Janek, et al --
...and then Janek Schleicher said...
%
% David T-G wrote at Wed, 12 Jun 2002 15:39:41 +0200:
%
% > I'm trying to be good and so I use "my $variable" rather than making them global,
and I prefer to
...
%
% Wait a moment.
% It seems like that:
% - You want to write Perl script
David T-G wrote at Wed, 12 Jun 2002 15:39:41 +0200:
> I'm trying to be good and so I use "my $variable" rather than making them global,
>and I prefer to
> not stick little [potentially-confusing] "my" declarations around through the code
>so I declare my
> vars up front. While some of them migh
Hi again --
...and then David T-G said...
%
% I'm trying to be good and so I use "my $variable" rather than making them
% global, and I prefer to not stick little [potentially-confusing] "my"
% declarations around through the code so I declare my vars up front.
I wasn't terribly clear here...
> -Original Message-
> From: David T-G [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 9:40 AM
> To: perl beginners
> Subject: "lazy" variable declaration
>
>
> Hi, all --
>
> I'm trying to be good and so I use "my $va
> I'm trying to be good and so I use "my $variable" rather than making
> them global, and I prefer to not stick little [potentially-confusing]
> "my" declarations around through the code so I declare my vars up
> front.
This is a matter of personal taste, but they should not be too far
"up fron
on Wed, 12 Jun 2002 13:39:41 GMT,
[EMAIL PROTECTED] (David T-G) wrote:
> Hi, all --
>
> I'm trying to be good and so I use "my $variable" rather than
> making them global, and I prefer to not stick little
> [potentially-confusing] "my" declarations around through the code
> so I declare my vars
Hi, all --
I'm trying to be good and so I use "my $variable" rather than making them
global, and I prefer to not stick little [potentially-confusing] "my"
declarations around through the code so I declare my vars up front.
While some of them might usefully be pre-filled, many of them can happily
21 matches
Mail list logo