If you are reading a simple file, you can use the diamond <> operator for simplicity.
use strict; use warnings; my $protein = <>; print "Essa é a sequência da proteína:\n"; print "$protein\n";
And use the script like this:
perl script.pl NM_021964fragment.pep
This will force you to use the correct paths, assuming you use tab autocomplete when running the script.
Using the command line argument in this way is somewhat unsafe, as you can execute arbitrary code through insecure open commands. You can use the ARGV::readonly module to prevent such things. Or just use the code itself, it's pretty simple:
for (@ARGV){ s/^(\s+)/.\/$1/;
source share