Hacking JAPH 
Author Message
 Hacking JAPH

Hey, i'm trying to understand this junk.

'0 511e3h7.8i564t3a6P1r7p8c8e6e3c3k7e3e533r7r286r6l4 6 1 8,7l7 3,');
srand; $_=3*int(rand(2))+2; /^$_/;
foreach (split(//,&g)) {/^$_/;print &g;} print "\n";

what's the meaning of  """    /^$_/;     """    !?

Regards,
theArray : Just another newbie.



Wed, 18 Jun 1902 08:00:00 GMT  
 Hacking JAPH


Quote:
> Hey, i'm trying to understand this junk.


> '0 511e3h7.8i564t3a6P1r7p8c8e6e3c3k7e3e533r7r286r6l4 6 1 8,7l7 3,');
> srand; $_=3*int(rand(2))+2; /^$_/;
> foreach (split(//,&g)) {/^$_/;print &g;} print "\n";

> what's the meaning of  """    /^$_/;     """    !?

perlop states in the "m/PATTERN/cgimosx" section:
If the PATTERN evaluates to the empty string, the last successfully matched
regular expression is used instead.


Thus, the last successful regular expression is used instead.  The last
successful regexp is that /^$_/;  all by itself.

I hope this clears up any confusion.  Feel free to contact me if it still
isn't quite clear.

Tim Bornholtz



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. A real perl5 japh hack 8-)

2. JAPH hack--can you shrink this code?

3. another JAPH for JAPH's sake

4. JAPH T-Day

5. Perl 5 JAPH!

6. FAQ 1.14 What is a JAPH?

7. FAQ 1.14 What is a JAPH?

8. FAQ 1.14 What is a JAPH?

9. FAQ 1.14 What is a JAPH?

10. JAPH at large

11. FAQ 1.14 What is a JAPH?

12. FAQ 1.14 What is a JAPH?

 

 
Powered by phpBB® Forum Software