The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

C++ to Perl by dennismv2007-05-18 12:19:08
  Simple. by Pic2007-05-18 12:22:49
    Last line could be print "@$tuple\n" by hobbs 2007-05-18 15:27:37
When interpolating arrays, perl joins on $", which by default is a space.

Also (for dennismv's edification, not yours), Perl allows you to return a list, so you might even do away with the struct entirely.


sub increment_some_things {
  return map { $_ + 1 } @_;
}

my @things = (3, 4);
my @incrd = increment_some_things @things;
print "@incrd\n"; # 4 5
Not always appropriate, just pointing out that it's possible.

[ Reply ]

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)