#! /usr/bin/env perl use v5.36; use utf8; # get all the files in the current directory my @files = glob("*"); my ($file) = grep { /Screenshot-2024-02-23-at-1.05.14\s/ } @files; my $ss = $files[0]; my $hex = unpack("H*", $ss); say $hex; say $file; # ERROR! my $blah = "Screenshot-2024-02-23-at-1.05.14 AM.png"; my $hex2 = unpack("H*", $blah); say $hex2; say $hex eq $hex2 ? "hexes equal" : "hexes not equal"; say $blah =~ /Screenshot-2024-02-23-at-1.05.14\s/; # WORKS! #### 53637265656e73686f742d323032342d30322d32332d61742d312e30352e3134e280af414d2e706e67 Use of uninitialized value $file in say at ./test.pl line 14. Character in 'H' format wrapped in unpack at ./test.pl line 17. 53637265656e73686f742d323032342d30322d32332d61742d312e30352e31342f414d2e706e67 hexes not equal 1