Hello, I'm new to perlmonks and this is my first post! I've only coded in matlab, so I will reference matlab functions to see if you guys can help me find the equivalent in perl.
I"m trying to read binary data from a file. The structure of the file contains data that has information in 158 byte increments, meaning every new 158 bytes is independent from the rest. so it goes like this:
$file = $ARGV_[0]
open(fileFID,$file);
for (my $ii = 1; $ii<=10;$ii++){
read(fileFID,my $data,158);
#now everytime I loop I want to put the new information of
#the file into a new row. In matlab you would simply say:
# $new_data(ii,:)=$data; and the info from read would go
#into a new row. I want to keep the $new_data variable for
#later use because I will be calling it more than once and
#I dont' want to read the information from the file
#everytime. Please help!
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.