Help for this page

Select Code to Download


  1. or download this
    >cat medicines.txt
    
    ...
    Liquid-A D20           30      33.83
    Atomizer 25 mg         56      12.60
    Apples                 50      63.65
    
  2. or download this
    >perl -e"my @precio;open PR,'medicines.txt';@precio=<PR>;close PR;chom
    +p(@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*$do
    +s*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\");"
    
  3. or download this
    
    ** MEDICINE PRICES BY DOSES PER MONTH **
    ...
    ==========================================================
    Total to spend with medicines every month:      175.91 $
    ==========================================================
    
  4. or download this
    ** MEDICINE PRICES BY DOSES PER MONTH (21-January-2006)**
    
    ...
     ============================================
    |Medicine Monthly Total 2 spend :   579.00$  |
     ============================================
    
  5. or download this
    cat <<EOF >medicines.txt
    ## PRODUCT      |NUM.DOSES|PRICE
    ...
    Atomizer 25 mg|56|12.60
    Apples|50|63.65
    EOF
    
  6. or download this
    perl -MPOSIX -e'
    my ($tnow,$gday)=(time,int(60*60*24)); ## MANUAL WAY OF FINDING FUTURE
    + DATES
    ...
    my $lit=sprintf("\n\|Medicine Monthly Total 2 spend :%9.2f\$\  |$/", $
    +acumes);
    print(" ","=" x (length($lit)-4),$lit," ", "=" x (length($lit)-4),"\n"
    +);## PRINTING TOTAL
    '