Help me beef up my cruddy program

Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default Help me beef up my cruddy program

    Help me beef up my cruddy program. It should then even run on Microsoft,
    by the way.

    #!/usr/bin/perl -ws
    #use strict; #can't use due to -s.
    $, = "\t";
    $\ = "\n";
    my $A = 0.00001549;
    my $B = 0.000006521;
    my $C = 807.8;
    my $D = 248.6;
    if ( $I ) {
    foreach my $i ( $A, $B, $C, $D ) { $i = -$i }
    }
    while (<>) {
    my @F = split;
    print $F[0] - $C - $A * $F[0] - $B * $F[1],
    $F[1] + $D - $A * $F[1] - $B * $F[0], "@F";
    }
    Dan Jacobson Guest

  2. Similar Questions and Discussions

    1. htmlText Beef.
      Alright.. been working on this all day, so I thought I would consult the brains arround here. The Goal: To have STYLED dynamic text wrap...
    2. PDF and program won't open; "Error in Acrord32" "This program has performed an illegal operation and
      I recently had a browser hijacker. Fixed it with Norton and Lavasoft. Now, after downloading new Reader 6.0, I can't open anything. Only gives...
    3. No in-program Help
      Hi, I've just begun using InDesign CS 3.0.1. I didn't do anything unusual during setup. However, when I click Help > InDesign Help, or press F1,...
    4. I'm Willing to pay someone to program this
      Hi, I saw your post: http://www.programmingtalk.com/showthread.php?threadid=7136 I'm in the need of a programmer who can write a little script...
    5. PHP POS program
      Anyone know where I can download a demo point-of-sale program from? preferably written in php and preferably a point-of-sale designed for...
  3. #2

    Default Re: Help me beef up my cruddy program

    >>>>> "DJ" == Dan Jacobson <jidanni@jidanni.org> writes:

    DJ> Help me beef up my cruddy program. It should then even run on Microsoft,
    DJ> by the way.

    DJ> #!/usr/bin/perl -ws
    DJ> #use strict; #can't use due to -s.

    wrong. use vars or our can fix that.

    DJ> $, = "\t";
    DJ> $\ = "\n";
    DJ> my $A = 0.00001549;
    DJ> my $B = 0.000006521;
    DJ> my $C = 807.8;
    DJ> my $D = 248.6;
    DJ> if ( $I ) {
    DJ> foreach my $i ( $A, $B, $C, $D ) { $i = -$i }
    DJ> }
    DJ> while (<>) {
    DJ> my @F = split;
    DJ> print $F[0] - $C - $A * $F[0] - $B * $F[1],
    DJ> $F[1] + $D - $A * $F[1] - $B * $F[0], "@F";
    DJ> }

    if you picked better var names and decribed what this is supposed to do,
    someone might help. i won't waste my time on the above.

    uri

    --
    Uri Guttman ------ [email]uri@stemsystems.com[/email] -------- [url]http://www.stemsystems.com[/url]
    --Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
    Search or Offer Perl Jobs ---------------------------- [url]http://jobs.perl.org[/url]
    Damian Conway Class in Boston - Sept 2003 -- [url]http://www.stemsystems.com/class[/url]
    Uri Guttman Guest

  4. #3

    Default Re: Help me beef up my cruddy program

    >>>>> "DJ" == Dan Jacobson <jidanni@jidanni.org> writes:

    DJ> Help me beef up my cruddy program. It should then even run on Microsoft,
    DJ> by the way.

    DJ> #!/usr/bin/perl -ws
    DJ> #use strict; #can't use due to -s.

    wrong. use vars or our can fix that.

    DJ> $, = "\t";
    DJ> $\ = "\n";
    DJ> my $A = 0.00001549;
    DJ> my $B = 0.000006521;
    DJ> my $C = 807.8;
    DJ> my $D = 248.6;
    DJ> if ( $I ) {
    DJ> foreach my $i ( $A, $B, $C, $D ) { $i = -$i }
    DJ> }
    DJ> while (<>) {
    DJ> my @F = split;
    DJ> print $F[0] - $C - $A * $F[0] - $B * $F[1],
    DJ> $F[1] + $D - $A * $F[1] - $B * $F[0], "@F";
    DJ> }

    if you picked better var names and decribed what this is supposed to do,
    someone might help. i won't waste my time on the above.

    uri

    --
    Uri Guttman ------ [email]uri@stemsystems.com[/email] -------- [url]http://www.stemsystems.com[/url]
    --Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
    Search or Offer Perl Jobs ---------------------------- [url]http://jobs.perl.org[/url]
    Damian Conway Class in Boston - Sept 2003 -- [url]http://www.stemsystems.com/class[/url]
    Uri Guttman Guest

  5. #4

    Default Re: Help me beef up my cruddy program

    Dan Jacobson <jidanni@jidanni.org> wrote in
    news:8765k1qkti.fsf@jidanni.org:
    > Help me beef up my cruddy program. It should then even run on Microsoft,
    > by the way.
    What's wrong with it?

    --
    Eric
    $_ = reverse sort $ /. r , qw p ekca lre uJ reh
    ts p , map $ _. $ " , qw e p h tona e and print
    Eric J. Roode Guest

  6. #5

    Default Re: Help me beef up my cruddy program

    Eric J. Roode wrote:
    > Dan Jacobson <jidanni@jidanni.org> wrote in
    > news:8765k1qkti.fsf@jidanni.org:
    >
    >> Help me beef up my cruddy program. It should then even run on
    >> Microsoft, by the way.
    >
    > What's wrong with it?

    It's lacking in beef, according to the Subject.


    --
    Cheers,
    Bernard
    --
    echo 42|perl -pe '$#="Just another Perl hacker,"'

    Bernard El-Hagin Guest

  7. #6

    Default Re: Help me beef up my cruddy program

    On Wed, 10 Sep 2003 10:12:45 +0000 (UTC), "Bernard El-Hagin"
    <bernard.el-hagin@DODGE_THISlido-tech.net> wrote:
    >Eric J. Roode wrote:
    >
    >> Dan Jacobson <jidanni@jidanni.org> wrote in
    >> news:8765k1qkti.fsf@jidanni.org:
    >>
    >>> Help me beef up my cruddy program. It should then even run on
    >>> Microsoft, by the way.
    >>
    >> What's wrong with it?
    >
    >
    >It's lacking in beef, according to the Subject.
    $beef++;


    Helgi Briem Guest

  8. #7

    Default Re: Help me beef up my cruddy program

    "Helgi Briem" wrote...
    > "Bernard El-Hagin" wrote:
    > >Eric J. Roode wrote:
    > >> What's wrong with it?
    > >It's lacking in beef, according to the Subject.
    > $beef++;
    Chuckle... Thanks, I needed that!


    Bob Dover Guest

  9. #8

    Default Re: Help me beef up my cruddy program

    Dan Jacobson wrote:
    > Help me beef up my cruddy program. It should then even run on
    > Microsoft, by the way.
    >
    > #!/usr/bin/perl -ws
    > #use strict; #can't use due to -s.
    > $, = "\t";
    > $\ = "\n";
    What is this supposed to do?
    > my $A = 0.00001549;
    > my $B = 0.000006521;
    > my $C = 807.8;
    > my $D = 248.6;
    By convention people use upper case variables for file descriptions only.
    > if ( $I ) {
    > foreach my $i ( $A, $B, $C, $D ) { $i = -$i }
    > }
    Why the condition? The body will never be executed because $I will never be
    true.
    Didn't perl warn you about undefined value?
    > while (<>) {
    > my @F = split;
    > print $F[0] - $C - $A * $F[0] - $B * $F[1],
    > $F[1] + $D - $A * $F[1] - $B * $F[0], "@F";
    > }
    And what is this supposed to do versus what does it do?
    You naming convention is ---shall we say--- suboptimal?

    jue


    Jürgen Exner Guest

  10. #9

    Default Re: Help me beef up my cruddy program

    >>>>> "JE" == Jürgen Exner <jurgenex@hotmail.com> writes:
    >> #!/usr/bin/perl -ws
    >> #use strict; #can't use due to -s.
    >> if ( $I ) {
    >> foreach my $i ( $A, $B, $C, $D ) { $i = -$i }
    >> }
    JE> Why the condition? The body will never be executed because $I will
    JE> never be true. Didn't perl warn you about undefined value?

    conditional tests don't warn on undef. and his comment on strict and -s
    tells me he was passing -I on the command line and -s would then set $I
    which would negate the 4 values.
    >> while (<>) {
    >> my @F = split;
    >> print $F[0] - $C - $A * $F[0] - $B * $F[1],
    >> $F[1] + $D - $A * $F[1] - $B * $F[0], "@F";
    >> }
    JE> And what is this supposed to do versus what does it do?
    JE> You naming convention is ---shall we say--- suboptimal?

    and he still hasn't responded so i guess a hit and run troll. notice his
    other post which made some useless comment on sub locations.

    uri

    --
    Uri Guttman ------ [email]uri@stemsystems.com[/email] -------- [url]http://www.stemsystems.com[/url]
    --Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
    Search or Offer Perl Jobs ---------------------------- [url]http://jobs.perl.org[/url]
    Damian Conway Class in Boston - Sept 2003 -- [url]http://www.stemsystems.com/class[/url]
    Uri Guttman Guest

  11. #10

    Default Re: Help me beef up my cruddy program

    Also sprach Uri Guttman:
    >>>>>> "JE" == Jürgen Exner <jurgenex@hotmail.com> writes:
    > >> while (<>) {
    > >> my @F = split;
    > >> print $F[0] - $C - $A * $F[0] - $B * $F[1],
    > >> $F[1] + $D - $A * $F[1] - $B * $F[0], "@F";
    > >> }
    >
    > JE> And what is this supposed to do versus what does it do?
    > JE> You naming convention is ---shall we say--- suboptimal?
    >
    > and he still hasn't responded so i guess a hit and run troll. notice his
    > other post which made some useless comment on sub locations.
    It was a question about where to place subroutine-definitions. Looking
    at other languages (where the place of the definition could matter; for
    Perl it even does matter when using prototypes), it wasn't quite so
    useless.

    Tassilo
    --
    $_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
    pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus}) !JAPH!qq(rehtona{tsuJbus#;
    $_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexi ixesixeseg;y~\n~~dddd;eval
    Tassilo v. Parseval Guest

  12. #11

    Default Re: Help me beef up my cruddy program

    I have added beef kindly provided here to
    [url]http://jidanni.org/geo/taiwan_datums/programs/twd6797thl[/url] , thanks.
    The only worry left is will
    #!/usr/bin/perl -ws
    work for my Microsoft pals? If not, how do I make a portable version?
    perldoc perlrun shows what -n, -p are equivalent to, but not -s.
    Do I just do $^W=1 for -w too?
    Dan Jacobson Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139