#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11123425 use warnings; open FILNAM, '<', \<<END or die $!; 1234567890 abcdefghijkl END my $val = unpack 'H32', do { local $/ = \16; <FILNAM> }; print "$val\n";
UPDATED: changed input to an in memory file to make program completely self contained.
In reply to Re: Reading and unpacking on one line
by tybalt89
in thread Reading and unpacking on one line
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |