C:\>ftype /?
ASSOC .pl=PerlScript
FTYPE PerlScript=perl.exe %1 %*
would allow you to invoke a Perl script as follows:
script.pl 1 2 3
If you want to eliminate the need to type the extensions, then do the following:
set PATHEXT=.pl;%PATHEXT%
and the script could be invoked as follows:
script 1 2 3
####
#!/your/perl/here
use strict;
use warnings;
my @precio;
open PR,'medicines.txt';
@precio=;
close PR;
chomp(@precio);
print("\n** MEDICINE PRICES BY DOSES PER MONTH **\n\n");
my $acumes;
foreach my $li (@precio)
{
next if ($li=~/^[_#\W]/);
my ($med,$uni,$pre)=split(/\t/,$li);
my $dos;
print('Daily dose of ',$med,'? =>');
$dos=<>;
$dos=~s/[^\d\.]//g;
my $tot=sprintf("%6.2f",$pre/$uni*$dos*31);
print(' Costs.................'," \t\t\t$tot \$\/month.\n");
$acumes+=$tot;
}
my $lit="\nTotal to spend with medicines every month: $acumes \$\n";
print('=' x length($lit),$lit, '=' x length($lit),"\n");
####
#!/your/perl/here
use strict;
use warnings;
while (<>)
{
print "one: $_";
}
print "\n\n: now reading from STDIN: \n\n";
print "Enter data: ";
while (<>)
{
print "two: $_";
print "Enter data: ";
}