Re: Briskets (perl)
Re: Briskets (perl)
- Subject: Re: Briskets (perl)
- From: Matthew Stuckwisch <email@hidden>
- Date: Mon, 13 May 2002 18:40:33 -0500
Look out perl, here we come.
I'm all for Perl, but is that a _good_ thing?
--
#!/usr/bin/perl
# Michael Kelly
$s="-oMmi\ncThhaee lW eKbe:l lhyt".
"\ntEpm:a/i/lw:w wj.ejdeidmiimkie".
"k\@em.ance.tc\n";for$i (0..length(
$s)/2-1){$a.=substr($s,$i*2,1);$b.=
substr($s,($i*2)+1,1);}print"$a$b";
Oh jeez, go and make such a simple script look so ugly. For those of you
who prefer "cleaner" perl:
---
$s="-oMmi\ncThhaee lW eKbe:l lhyt"."\ntEpm:a/i/lw:w wj.ejdeidmiimkie"."k\@
em.ance.tc\n";
for$i(0..length($s)/2-1)
{
$a.=substr($s,$i*2,1);
$b.=substr($s,($i*2)+1,1);
}
print"$a$b";
---
and for those of you who want a rough AppleScript conversion:
---
set s to "-oMmi
cThhaee lW eKbe:l lhyt
tEpm:a/i/lw:w email@hidden
"
set a to ""
set b to ""
repeat with i from 0 to round (length of s) / 2 - 1
set a to a & text (2 * i + 1) thru (2 * i + 1) in s
set b to b & text (2 * i + 2) thru (2 * i + 2) in s
end repeat
return a & b
---
Trying to go and make perl all bad....humbug :P
Matthew Stuckwisch
[AIM/MSN]{GuifaSwimmer} | [Yahoo!]{SapphireTree} | [ICQ]{137477701}
[IRC]{guifa / G}(esperNET / irc.massinova.com)
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: | |
| >Re: Briskets (From: Michael Kelly <email@hidden>) |