Beefy Boxes and Bandwidth Generously Provided by pair Networks Russ
Just another Perl shrine
 
PerlMonks  

Re: How to use 2 files for calculating charges

by jwkrahn (Monsignor)
on Aug 14, 2013 at 04:45 UTC ( #1049379=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $cnt = 0;
    ...
      $cnt++;
    ...
    print $cnt, "\n";
    
  2. or download this
    print "$.\n";
    
  3. or download this
    my $filename = '$mainDir\test.txt';
    
  4. or download this
    my $filename = "$mainDir\test.txt";
    
  5. or download this
    my $mth_end = sprintf "%04d,%02d,%02d",$y,$m,Days_in_Month($y,$m);
    
  6. or download this
    printf OUT "                                  Placement    Release    
    +  Tot    Chg\n";
    printf OUT "                                  Date         Date       
    +  Days   Days   Cost\n";
    
  7. or download this
    print OUT "                                  Placement    Release     
    + Tot    Chg\n";
    print OUT "                                  Date         Date        
    + Days   Days   Cost\n";
    
  8. or download this
      my @dates = split '\s+', $_;
    
  9. or download this
      my @dates = split;
    
  10. or download this
      if ($free >= 0) {
         my $amt = $free;
    ...
        my $pfmt = "%-14s %-5s %-8s %-3s %-12s %-12s %-6s %-6s %-6s\n"; 
        printf OUT $pfmt, $dates[0], $dates[1], $dates[2], $dates[3], fmt_
    +mdy($dates[4]), fmt_mdy($dates[5]), $diff, $amt, fmt_curr($cost);
       }
    
  11. or download this
      my $amt = $free < 0 ? 0 : $free;
      my $cost = $amt * 100;
      my $pfmt = "%-14s %-5s %-8s %-3s %-12s %-12s %-6s %-6s %-6s\n";
      printf OUT $pfmt, @dates[ 0, 1, 2, 3 ], fmt_mdy( $dates[ 4 ] ), fmt_
    +mdy( $dates[ 5 ] ), $diff, $amt, fmt_curr( $cost );
    
  12. or download this
      $ymd =~ s/ //g;
    #  return ' 'x10 if $ymd eq $NULL_DATE;
      my ($y,$m,$d) = split /\D/,$ymd;
    
  13. or download this
      my ( $y, $m, $d ) = split /\D+/, $ymd;
    
  14. or download this
      my ( $y, $m, $d ) = $ymd =~ /\d+/g;
    
  15. or download this
    while (<$file>) {
    ...
    ...
    sub fmt_mdy {
    ...
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1049379]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-04-18 11:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (466 votes), past polls