To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
The technical storage or access that is used exclusively for statistical purposes.
The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
And now I’ve learned something new about reverse. Hooray for DWIM.
Huh.
I don’t think that’s a sane behaviour for reverse in scalar context (only ever used it with a single argument in scalar context), but I’ll be damned if I can come up with a better alternative.
Why not just:
$reversed = scalar reverse $string;
?Well, quite.
Although your call to
scalar
is unnecessary.Why does reverse $string return the original string, but an assignment e.g. : $reversed = reverse $string store the reversed string in the lvalue?
As the title implies, read the documentation.
late joining the party. SOme of these ‘dwimminess’ features make me a bit uncomfortable. I feel that if c gives me ‘fred’ then maybe it’s not very /useful/, but at least it’s consistent with my simple user model of the language. When convenience measures like making that result be ‘derf’ are mixed into the language, then it seems to me kind of like encountering an irregular verb in a natural language: it may make life easier on this one occasion for somebody but the whole edifice gets just a bit more complicated … adding to the meme that Perl is ‘too hard’.