[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] any practical eg.s for macperl day2day usage?



Some time around 8/19/97 8:19 PM CDT, Joseph "ALVIS" Alexander Snow wrote something about

>what might one use macperl for in day to day tasks?
>what might one use it for in any sort of production environment?
>I need to envision examples...

Some time around 8/20/97 1:05 AM CDT, Neil Kandalgaonkar wrote something about

>I think the question is more like "what can you NOT do with (Mac)Perl?"
>
>For any manipulation of text files, searching through text files with
>complicated criteria, extraction and formatting of results, simple database
>management, web cgis, and so on and so on, Perl (& MacPerl) is
>devastatingly powerful. Some people even like MacPerl better than
>AppleScript for scripting Mac applications.
>
[snip]
>
>There are other ways to do this; for instance, AppleScript, buffed up with
>3rd-party scripting extensions, could do SOME of this in about 1 minute. (I
>know because that's the way we used to do it.) MacPerl does it all in less
>than a second, on a puny 6100/60.


Can I get a witness??  The question truly is what _can't_ be done with MacPerl (and Perl).

Among my many slave-like duties, I have to convert hundreds of PageMaker files to HTML and post them every week...

I export the text from PM [although I'm nearing a solution to extracting the text directly from the files with MacPerl  :- ) ], then leave the rest to MacPerl.  With one script, I can mark up either of two different newspapers' files, with each section's stories cross-linked with the other stories of that section in that edition, with headlines, bylines, bulleted lists -- everything -- properly marked up, in a few seconds.  Nine little lines of code tell MacPerl how to figure the publication date (it's not always the date that I'm working on it) and insert it automatically, without me telling it what it is. Then MacPerl waits for a <CR>, while I quickly check for any small mistakes that might have slipped by, then MacPerl ftps the files to the remote site and deletes or archives other files on the site as appropriate.

Oh yeah... while this is going on, an index of the words on each page is being put into a hash (actually, a hash of arrays, keyed by the words with arrays of filenames).  When all files have been marked up, the index is merged with the existing site index, which stores every word on every page (over 1500 files on the site at present) with link info for the pages on which each word appears.  Try that with AppleScript (if you've got a few hours to waste)!

The server is a Sparc, but I test all my CGIs locally in MacPerl before they go public.  Thus have I learned to write portable code (and always to check $^O).  ;- )

I'm also involved in an email Civil War game, in which I am responsible for generating reports from all the Confederate players' game responses.  MacPerl grabs their incoming emails and generates status reports for each brigade and the army as a whole, location of friendly and enemy units, and battle outcomes -- then it emails these reports out, and also exports an html version to my personal website.  The script is less than a hundred lines, and I can run it manually, or have Frontier "wake it up" whenever new email arrives.  It takes less than 3 seconds from start to email/html being sent.

I'm even developing my own Civil War email game, more detailed and realistic than the one I'm in now, and entirely implemented in MacPerl.

Oy vŽ, I could go on and on...  I could not imagine life on my Mac without MacPerl.  If you have any experience with programming/scripting, (Mac)Perl will come to you _very_ easily.  If not, it will just come to you easily.  I've been hacking for over 15 years, and a Perl programmer for maybe 3 years.  With a few hundred lines of MacPerl code, I can often achieve the same results that would require thousands of lines and an application framework in C++ or Object Pascal.  I call that POWER.

And all this on a 7600/132, which until recently was a 7200/75.

Dave Beverly
webmaster@thecitizennews.com -- http://www.thecitizennews.com/
webmaster@henrynews.com -- http://www.henrynews.com/
Mac Manipulator
"I don't do windows!"

**
MacOS is an operating system; OS/2 is half an operating system; windoze 
is a shell; DOS is a boot partition virus... where do you want to go today?


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch