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
"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
> "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
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
> "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
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;
[ 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
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
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,
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: $!";
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.
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;
>>
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
"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
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
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
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
17 matches
Mail list logo