Stud_Perl has asked for the wisdom of the Perl Monks concerning the following question:
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Pattern matching
by Joost (Canon) on Jun 30, 2005 at 23:24 UTC | |
And please don't put your whole post in a <code> block. Writeup Formatting Tips should help. | [reply] [d/l] |
Re: Pattern matching
by Adrade (Pilgrim) on Jun 30, 2005 at 23:49 UTC | |
Good luck! -Adam P.S. As another hint: look in the man page for what represents a word boundry, and what it means for characters to be placed within square brackets. -- | [reply] |
Re: Pattern matching
by thundergnat (Deacon) on Jul 01, 2005 at 01:45 UTC | |
Ah. I think I see your problem. Excessive use of white space. In fact, total lack of code whatsoever. In case you didn't realize it from the replies to your previous questions, Perlmonks is not a homework service. While we are more than happy to help with any questions you may have, in general, we take a dim view of you asking us to do your homework for you, especially when you don't seem to have made any attempt to solve it on your own first. | [reply] |
Re: Pattern matching
by GrandFather (Saint) on Jun 30, 2005 at 23:31 UTC | |
Show us the code you have written so far and ask for help with the area that you are having difficulty with. Perl is Huffman encoded by design. | [reply] |
Re: Pattern matching
by holli (Abbot) on Jul 04, 2005 at 09:56 UTC | |
holli, /regexed monk/ | [reply] [d/l] |
by xorl (Deacon) on Jul 06, 2005 at 12:52 UTC | |
| [reply] |
by holli (Abbot) on Jul 06, 2005 at 13:39 UTC | |
The OP won't understand it (heck even I don't)Want a spoiler?
+($\=\1)-$\ evaluates to zero, so we can take those out.
+($/=\1)-$/ evaluates to zero too, just we need one of them to set the input separator $/ to 1 (bytewise reading). We can also take out the subsequent commas from the join (since they do nothing), so the first line becomes: The numbers are the ordinals of the single chars of the filename "part3.txt". Now for the while loop. If we write it clearer it looks like $\="$\$_"; simply concatenates the read char with $\. $_=$\; has no effect. $\ = substr((push @w,$\),0,0) if $\=~ /\s$/msg; pushes $\ to an array if the last char of $\ is a whitespace or newline, thus a "word". In the same statement $\ is cleared because the return value of substr(something, 0,0) is empty. The last part is a simple grep of the array we built. We can safely leave out the eval so it becomes: Alter the regex here to your liking. holli, /regexed monk/ | [reply] [d/l] [select] |
Re: Pattern matching
by CountZero (Bishop) on Jul 01, 2005 at 06:00 UTC | |
CountZero "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law | [reply] |
Re: Pattern matching
by holli (Abbot) on Jul 01, 2005 at 06:52 UTC | |
holli, /regexed monk/ | [reply] |
Re: Pattern matching
by ysth (Canon) on Jul 01, 2005 at 01:38 UTC | |
| [reply] |
Re: Pattern matching
by ambrus (Abbot) on Aug 12, 2005 at 11:01 UTC | |
Update: This would have been better written as
| [reply] [d/l] [select] |
by ambrus (Abbot) on Mar 28, 2007 at 21:09 UTC | |
Here's the code I used to generate this obfu. First, I've written the algorithm in perl:
Then I transcoded that to an assembly language for the virtual machine the obfu interprets. This code, when ran with ruby, will assemble the obfu and write it to the file named "pie".
| [reply] [d/l] [select] |
Re: Pattern matching
by holli (Abbot) on Jun 30, 2005 at 23:55 UTC | |
Update: I'm as sorry as possible, but he who asks for homework despite beeing warned, deserves no better.
Considered (davido) Reap: Inflamatory and insulting, lacking redeeming value. holli, /regexed monk/ | [reply] |