Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rating: Thread Rating: 8 votes, 4.25 average. Display Modes
Old 03-05-2002, 02:18 PM   #41
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
paul, thanks for perl 101. yikes!

others, i don't know if it's my rig, or what, but even after the tedious line endings conversion, lines have a space at the end after a copy/paste. yish.

you may get the following error when you test this...

Can't find string terminator "EOM" anywhere before EOF at /Users/you/bin/bmu line 33.

what you have to do is delete the space after the standalone EOM around line 39, after the Usage: $0 message.

--
standards are great! everybody's got one!
mervTormel is offline   Reply With Quote
Old 03-05-2002, 10:02 PM   #42
pmccann
Major Leaguer
 
Join Date: Jan 2002
Location: Adelaide, South Australia
Posts: 470
Hi again,

nice catch mT: looks like the end of *every* line gets an extra space added when it appears in this forum. Seems to be the <br /> that's doing it. As you've determined, the "heredoc" wants to see *exactly* EOM and nothing more on a line. The thing is that "EOM " --with the extra space-- is also a perfectly legal delimiter for this sort of construction. So the script throws up its hands in horror, exactly as it should. Everything else is unfazed about the extra white space.

Sao: Perl (no "a"!!) is a good language to learn if you've already got a nodding familiarity with other aspects of unix, and the really nice thing is that it's almost completely platform agnostic. The script above is pretty hairy, but simple things are really easy to achieve. Feel free to start a thread if you want to do something fun: maybe data manipulation is a good place to start? Stuff like reading and writing tab-delimited files, summarising the output from the ps command, making a new sort of "ls" command that separates directories from files in its output. If you want to learn CGI scripting I've got a couple of ridiculously long tutorial-like threads on the OSX - UNIX section of the macnn forums. It would be nice is someone read these things: their construction is probably what started my wrist problems!!

First chunk is available from:

http://forums.macnn.com/cgi-bin/ulti...c&f=1&t=001563

Second installment (talking to myself!) can be found at

http://forums.macnn.com/cgi-bin/ulti...c&f=1&t=001619

Of course Perl is not equal to CGI (and vice versa), but it's one of the things that lots of people seem to want to do. There are also lots of really good perl tutorials available on the web: you can find a couple that Netizen --a training company-- created before they went under (no reflection on the quality of the materials!!) at my old workplace

http://www.maths.adelaide.edu.au/cmc/

Cheers,
Paul
pmccann is offline   Reply With Quote
Old 03-06-2002, 01:57 AM   #43
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
pmccann,

A big and very humble....Thanks!

Went to all the links you posted, and like a hungry dog started eating the morsels. Too much for one meal, I have food there for a long time to come.

I will be able to spend the whole winter (in singapore??) in my cave and every night will be a party, so much food on the table.

I think a perl beginners thread will be the right idea, will start one soon.
(And your guidance will be highly appreciated)

You are the second mathematician I have contact with in my life. The first one, a great human being, demontrated to me very easily, that 2+2 was not always 4, sometimes it was this other result, sometimes was another.

With my interest inclined to philosophy since childhood, this was the kind of teaching, that made mathematics bearable for me, during my school years.


Cheers...

Last edited by sao; 03-06-2002 at 03:56 AM.
sao is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 09:31 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.