Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Longest repeated string...

by japhy (Canon)
on Feb 03, 2006 at 17:37 UTC ( #527741=note: print w/ replies, xml ) Need Help??


in reply to Re: Longest repeated string...
in thread Longest repeated string...

A list in scalar context returns the number of items in the list. Not quite.

A list assignment in scalar context returns the number of items in the right-hand list.


Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart


Comment on Re^2: Longest repeated string...
Re^3: Longest repeated string...
by Limbic~Region (Chancellor) on Feb 03, 2006 at 17:42 UTC
    japhy,
    Thanks - which is why I said this deserved an entry in "Perl Idioms Explained". I could argue that there is no assignment going on in:
    while ( @array ) { ... } # or print "Array is empty\n" if ! @array;
    but then we could discuss the difference between lists and arrays and it wouldn't be worth it. I think I was able to get the OP to understand even if I wasn't completely accurate. I do think it would make for a good entry in "Perl Idioms Explained".

    Cheers - L~R

      If you don't, I will. (Make the PIE node for this idiom, I mean.)

      Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
      How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
        japhy,
        I am sure you understand it better than I do. I often understand things well enough to use them but not well enough to explain them to others. Be my guest.

        Cheers - L~R

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://527741]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2014-09-17 10:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (72 votes), past polls