in reply to Re: syntax error at labmonkey.pl line 1, at EOF
in thread syntax error at labmonkey.pl line 1, at EOF

Cool. I have downloaded the TextMate text editor and now it runs, must have been an AdobeGoLive problem. I have searched for the OS units program, but don't seem to have it installed. Could you kindly provide a link? I have searched online but have not found a place to download it.
  • Comment on Re^2: syntax error at labmonkey.pl line 1, at EOF

Replies are listed 'Best First'.
Re^3: syntax error at labmonkey.pl line 1, at EOF
by Fletch (Bishop) on Mar 04, 2008 at 18:47 UTC

    Eeww. Consider getting a real code editor (or learn a *NIX standard such as vim or emacs). XCode's builtin editor also would be a step up (presuming you have the OS X development tools installed).

    And as a comment to your original program, you might consider using the OS' units program which already has a fairly good knowledge of conversions rather than reinventing the wheel piecemeal yourself.

    $ units kilograms grams * 1000 / 0.001 $ units feet kilometers * 0.0003048 / 3280.8399

    (Those two lines are what you multiply the later by to get the former and what you divide the former by to get the later)

    Update: Duuur. Strike that, reverse it; as is noted below. Been so long since I've used it I forgot how it works. (At least I remembered it was there . . . :)

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

      Your parenthetical statement is backwards, methinks. ;-)

      If you have 1 kilogram, you "* 1000" to get grams. Similarly, you can "/ 0.001" to get grams (same as "* 1000")

      The exact nature of the two outputs is a bit convoluted - the man page goes in to a LOT more detail.

Re^3: syntax error at labmonkey.pl line 1, at EOF
by apl (Monsignor) on Mar 04, 2008 at 18:43 UTC
    I can run your script once I've added #!/usr/local/bin/perl as the first line (because I'm using Solaris).

    What exactly is the error you're getting?