Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Applications / Mac Applications / March 2005



Tip: Looking for answers? Try searching our database.

question about perl convention

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Stripling - 27 Mar 2005 23:49 GMT
I'd ask in the perl newsgroup, but it's full of humorless droids and
jerks. Unlike Mac newsgroups.

So I'm reading about the suits rejecting Fiona Apple's last album because
there weren't any singles in it and it wouldn't sell. (That's too kind, by
the way.)* It occurred to me that there must be a class called suits, who's
action was reject, right? I know perl when I see it, but I don't know
diddly about how to structure such an object. Any ideas, if you see what
I'm trying to do?

suit::rejector

Something I can print out in reverse and iron on a t-shirt that _some_
people will get.

*http://www.mp3newswire.net/stories/5002/fiona.html and see for yourself
Signature

Phil Stripling           | email to the replyto address is presumed
The Civilized Explorer   | spam and read later. email from this URL
http://www.cieux.com/    | http://www.civex.com/     is read daily.

Michael Vilain - 28 Mar 2005 04:54 GMT
> I'd ask in the perl newsgroup, but it's full of humorless droids and
> jerks. Unlike Mac newsgroups.
[quoted text clipped - 12 lines]
>
> *http://www.mp3newswire.net/stories/5002/fiona.html and see for yourself

now I know why the perl people spanked you.  Your post has absolutely
nothing to do with perl programming.  Nor does it have anything to do
with Macintosh.

At the very least you could have prefaced your post with "OT-".

Consider yourself wacked upside the head with a ClueByFour(tm) by this
humorless droid (at least in your case).

Signature

DeeDee, don't press that button!  DeeDee!  NO!  Dee...

Tom Harrington - 28 Mar 2005 18:58 GMT
> I'd ask in the perl newsgroup, but it's full of humorless droids and
> jerks. Unlike Mac newsgroups.
[quoted text clipped - 10 lines]
> Something I can print out in reverse and iron on a t-shirt that _some_
> people will get.

If "suits" is a class, then presumably you've got multiple instances of
suit objects.  Perl pseudo-code would look something like this, once per
suit that rejects:

my $suit = new Suits;
$suit->reject();

If you just figure that _all_ suits are rejecting, you could do it this
way instead:

Suits->reject();

If you wanted to make it specific to this example, it could be something
like this:

Suits->reject("Fiona Apple");

Or more precisely, maybe this:

Suits->reject({artist=>"Fiona Apple", album=>"Extraordinary Machine"});

Or more generally, rejection of albums where they don't "hear a single":

Suits->reject({hear_single => 0});

Technically you'd need something like this above any of these examples,
but you could probably delete it for t-shirt purposes:

use Suits;

or perhaps this would be more appropriate, given suits preference for
rules and bureaucracy:

require Suits;

Signature

Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0:  Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/

Phil Stripling - 28 Mar 2005 19:39 GMT
>SNIP<
> Or more precisely, maybe this:
[quoted text clipped - 5 lines]
>
> require Suits;

:->

So

require Suits;
Suits->reject({artist=>"Fiona Apple", album=>"Extraordinary Machine"});

would be correct?

That last line is kinda long, but it really nails it, so I'll have to play
with how to get it readable on a t-shirt.
Signature

Phil Stripling           | email to the replyto address is presumed
The Civilized Explorer   | spam and read later. email from this URL
http://www.cieux.com/    | http://www.civex.com/     is read daily.

Tom Harrington - 28 Mar 2005 22:04 GMT
> >SNIP<
> > Or more precisely, maybe this:
[quoted text clipped - 17 lines]
> That last line is kinda long, but it really nails it, so I'll have to play
> with how to get it readable on a t-shirt.

That's right.  The first line tells Perl to look up all the information
it needs about Suits, and make it available.  The second tells Suits to
do something.

Whitespace can be added in certain places without affecting syntactic
correctness.  You might format it this way:

require Suits;

Suits->reject({ artist => "Fiona Apple",
               album  => "Extraordinary Machine"
});

Signature

Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0:  Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.