Re: Warning: Use of uninitialized value

2010-02-01 Thread Rob Dixon
Bob Williams wrote: "Uri Guttman" wrote: "BW" == Bob Williams writes: BW> Hi Rob, Many thanks. That does what I want :) Now I need to study BW> your code to learn why. and you need to learn to bottom post. you wrote one line and quoted 80 lines which have already been seen by others. goo

Re: Warning: Use of uninitialized value

2010-02-01 Thread Bob Williams
"Uri Guttman" wrote: >> "BW" == Bob Williams writes: > > BW> Hi Rob, Many thanks. That does what I want :) Now I need to study > BW> your code to learn why. > > and you need to learn to bottom post. you wrote one line and quoted 80 > lines which have already been seen by others. google

Re: Warning: Use of uninitialized value

2010-01-31 Thread Uri Guttman
> "7" == 7 <7stud.7s...@gmail.com> writes: 7> On Sat, Jan 30, 2010 at 4:27 PM, Rob Dixon wrote: >> Why are you replying to me? My post did use the three-argument form of >> open(). Also: >> >> - It is bad form to use upper case letters for lexical variables >> 7> "Perl Best

Re: Warning: Use of uninitialized value

2010-01-30 Thread 7
On Sat, Jan 30, 2010 at 4:27 PM, Rob Dixon wrote: > Why are you replying to me? My post did use the three-argument form of > open(). Also: > > - It is bad form to use upper case letters for lexical variables > "Perl Best Practices" disagrees with you. > - Passing / / as the first parameter of

Re: Warning: Use of uninitialized value

2010-01-30 Thread Uri Guttman
> "BW" == Bob Williams writes: BW> Hi Rob, Many thanks. That does what I want :) Now I need to study BW> your code to learn why. and you need to learn to bottom post. you wrote one line and quoted 80 lines which have already been seen by others. google for bottom posting and learn why it

Re: Warning: Use of uninitialized value

2010-01-30 Thread Bob Williams
Hi Rob, Many thanks. That does what I want :) Now I need to study your code to learn why. Bob Rob Dixon wrote: > Hi Bob > > I suggest you forget about regular expressions and use the library > function split() instead. Take a look at the code below. > > HTH, > > Rob > > > > use warnings;

Re: Warning: Use of uninitialized value

2010-01-30 Thread John W. Krahn
[ Please do not top post. ] 7 wrote: a) open (BHF_FILE, " The modern way to open a file is to: 1) Use the three argument form of open(). 2) Create a variable for the file handle. open (my $BHF_FILE, '<', '/home/bob/tmp/md4music'); You should *always* verify that the file was opened correct

Re: Warning: Use of uninitialized value

2010-01-30 Thread Rob Dixon
Why are you replying to me? My post did use the three-argument form of open(). Also: - It is bad form to use upper case letters for lexical variables - Passing / / as the first parameter of split() will split on the first single space in the string. It is better to use ' ' instead which dis

Re: Warning: Use of uninitialized value

2010-01-30 Thread 7
a) > open (BHF_FILE, ") { #do something with $line } close $BHF_FILE; b) Take a look at this code: use strict; use warnings; use 5.010; my $line = 'hello world goodbye'; my @pieces = split / /, $line, 2; for (@pieces) { say; } --output:-- hello world goodbye At the command line,

Re: Warning: Use of uninitialized value

2010-01-30 Thread Rob Dixon
Hi Bob I suggest you forget about regular expressions and use the library function split() instead. Take a look at the code below. HTH, Rob use warnings; use strict; my (@ukchecksum, @uktrackname); open my $bhf_file, '<', '/home/bob/tmp/md5music' or die "Could not open md5music: $!";

Re: AW: Warning: Use of uninitialized value

2010-01-30 Thread Jim Gibson
At 7:29 PM + 1/29/10, Bob Williams wrote: Thanks. There's a lot in your version for a newbie to learn, but unfortunately, it still gives the same error :( It helps if you post the actual code generating the error. You should also trim the accumulated text to remove non-relevant portions.

Re: AW: Warning: Use of uninitialized value

2010-01-30 Thread Bob Williams
Steve Bertrand wrote: > Thomas Bätzler wrote: >> Bob Williams asked: >>> I am trying to split the lines in a file into two halves (at the first >>> space) each half going into an array. The code I have written is below. >> >>> ---Code--- >>> #!/usr/bin/perl >>> use warnings; >>> #use strict; >>

Re: AW: Warning: Use of uninitialized value

2010-01-29 Thread Steve Bertrand
Thomas Bätzler wrote: > Bob Williams asked: >> I am trying to split the lines in a file into two halves (at the first >> space) each half going into an array. The code I have written is below. > >> ---Code--- >> #!/usr/bin/perl >> use warnings; >> #use strict; > > use strict; # unless you know w

Re: Warning: Use of uninitialized value

2010-01-28 Thread Bob Williams
"John W. Krahn" wrote: > Bob Williams wrote: >> Hi, > > Hello, > >> I am trying to split the lines in a file into two halves (at the first >> space) each half going into an array. The code I have written is below. >> The print command is there to test that things worked correctly, but it >> only

Re: Warning: Use of uninitialized value

2010-01-28 Thread John W. Krahn
Bob Williams wrote: Hi, Hello, I am trying to split the lines in a file into two halves (at the first space) each half going into an array. The code I have written is below. The print command is there to test that things worked correctly, but it only gives an error for each instance of the

AW: Warning: Use of uninitialized value

2010-01-28 Thread Thomas Bätzler
Bob Williams asked: > I am trying to split the lines in a file into two halves (at the first > space) each half going into an array. The code I have written is below. > ---Code--- > #!/usr/bin/perl > use warnings; > #use strict; use strict; # unless you know what you're doing. > #use diagnostic

Warning: Use of uninitialized value

2010-01-28 Thread Bob Williams
Hi, I am trying to split the lines in a file into two halves (at the first space) each half going into an array. The code I have written is below. The print command is there to test that things worked correctly, but it only gives an error for each instance of the print command... Use of uninit