#!/usr/bin/perl use IO::File; my $charcode = 0x2600; my $out_string = ""; for ( ; $charcode < 0x26FF; $charcode++ ){ $out_string .= chr( $charcode ); } $out_string .= "\n"; undef $charcode; open( my $ofile, ">:encoding(UTF-8)", "unicodechars.txt" ) or die "Failed to open file for writing";; print( $ofile $out_string ); undef $ofile; undef $out_string; print( "Finished writing to file\n" ); exit( 0 );