in reply to Re^4: How to assign a variable its width/vector
in thread How to assign a variable its width/vector
First off, uncomment strictures and fix the errors reported. At the very least, as your code stands, $len_ofinstr and $len_inst are used before they are assigned a value which is likely to be wrong.
What do you expect length to do?
What do you expect 'use bytes' to do? (The module's documentation says "use of this module for anything other than debugging purposes is strongly discouraged".)
Writing a test script of the form:
#!user/bin/perl use warnings; use strict; my $inFile = <<FILE; FILE ... open my $fIn, '<', \$inFile; while (defined (my $line = <$fIn>)) { ... }
and telling use what you expect as output would go a long way to making your issue clear to us. The open ... \$inFile; bit opens a string as a file which is a nice way of including sample data in your script while retaining the structure of file I/O of the full script.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: How to assign a variable its width/vector
by samd (Novice) on Apr 15, 2014 at 07:50 UTC | |
by soonix (Chancellor) on Apr 15, 2014 at 09:29 UTC |