assigning back to an array
rxl124_at_hehe.com
Date: 02/25/04
- Next message: Gunnar Hjalmarsson: "Re: assigning back to an array"
- Previous message: Hon Seng Phuah: "Substract numeric from a string."
- Next in thread: Gunnar Hjalmarsson: "Re: assigning back to an array"
- Reply: Gunnar Hjalmarsson: "Re: assigning back to an array"
- Reply: Jürgen Exner: "Re: assigning back to an array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 Feb 2004 01:20:54 -0800
I have files that I only need one field that I need to grep it out and
I am trying to assign that to another file.
(It happens that one field that I am looking for has some other character
that I dont need so I am pulling it out w/ substr commands).
However --> @real_num = substr($num, 91,10) is only pulling the last line
of the file(not the 100 other lines).
Can someone please tell me what I am doing wrong here?
Please Please help as I am driving myself mad on this one.
#!/usr/bin/perl -w
open(FH, "files.txt") || die;
@yahoo = <FH>;
foreach $num (@yahoo){
@real_num = substr($num ,91, 10);
}
open(NF, ">hanabbs2.log") || die;
foreach $num (@real_num){
print NF "$num\n";
}
close(NF);
- Next message: Gunnar Hjalmarsson: "Re: assigning back to an array"
- Previous message: Hon Seng Phuah: "Substract numeric from a string."
- Next in thread: Gunnar Hjalmarsson: "Re: assigning back to an array"
- Reply: Gunnar Hjalmarsson: "Re: assigning back to an array"
- Reply: Jürgen Exner: "Re: assigning back to an array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|