#!/usr/bin/perl use strict; use warnings; # sequentialBytes # This script takes one command-line parameter specifying the number of bytes # desired in the output. # The script outputs (to STDOUT) the specified number of bytes. # The bytes cycle through the values 0..255 # Cameron Hayne (macdev@hayne.net) May 2005 die "usage: sequentialBytes desired_num_bytes\n" if $#ARGV < 0; my $desired_num_bytes = $ARGV[0]; shift; my $num_bytes_output = 0; my $num = 0; while ($num_bytes_output < $desired_num_bytes) { my $byte = pack("C", $num++); print $byte; ++$num_bytes_output; $num = 0 if $num > 255; }