CARVIEW |
O'Reilly Answers is a community site for sharing knowledge, asking questions, and providing answers that brings together our customers, authors, editors, conference speakers, and Foo (Friends of O'Reilly).
Learn more »
Send us feedback »
Top Contributors
-
86 Answers
-
32 Answers
-
32 Answers
-
26 Answers
-
23 Answers
Topics: Perl
-
0VOTES0ALTERNATES
How do I know if my Perl script is running interactively?
By brian_d_foytaken from perlfaq8 This is a difficult question to answer, and the best answer is only a guess. What do you really want to know? If you merely want to know if one of your filehandles is connected to...
05 November 2009 - 09:23 AM | 0 Comments
Tags:
-
1INTERESTED0ANSWERS
-
2VOTES0ALTERNATES
Performance of $& vs $1 in a Perl substitution
By brian_d_foyHere's a benchmark with Perl 5.010. Note that 5.010 has a new /p flag that supplies a ${^MATCH} variable that acts like $& but for only one instance of the match or substitution oper...
04 November 2009 - 08:02 AM | 0 Comments
Tags:
-
0VOTES0ALTERNATES
How to remove duplicate lines with regular expressions
By StevenLevithanThere is a variety of software (including the Unix command-line utility uniq and Windows PowerShell cmdlet Get-Unique) that can help you remove duplicate lines in a file or ...
30 October 2009 - 08:35 AM | 0 Comments
Tags:
-
4VOTES0ALTERNATES
-
2VOTES0ALTERNATES
How to Multiply Matrices in Perl
By gnatIf you want to multiply a pair of two-dimensional arrays, use the PDL modules, available from CPAN. PDL is the Perl Data Language—modules that give fast access to compact matrix and mathematical fun...
20 October 2009 - 04:53 PM | 0 Comments
Tags:
-
2VOTES0ALTERNATES
How to Generate Random Numbers in Perl
By gnatIf you want to make random numbers in a given range, inclusive, such as when you randomly pick an array index, simulate rolling a die in a game of chance, or generate a random password, use Perl's...
20 October 2009 - 04:01 PM | 0 Comments
Tags:
-
3VOTES0ALTERNATES
-
4VOTES0ALTERNATES
How to Work with Roman Numerals in Perl
By gnatIf you want to convert between regular numbers and Roman numerals, use the Roman module from CPAN: use Roman; $roman = roman($arabic); # convert to roman numerals &#...
20 October 2009 - 03:30 PM | 0 Comments
Tags:
-
3VOTES0ALTERNATES
How to Properly Capitalize a Title or Headline in Perl
By gnatIf you have a string representing a headline, the title of book, or some other work that needs proper capitalization, use a variant of this tc( ) titlecasing function: INIT { our %nocap;...
20 October 2009 - 03:11 PM | 0 Comments
Tags:
![]() ©2009, O'Reilly Media, Inc. (707) 827-7000 / (800) 998-9938 All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. |
About O'Reilly Academic Solutions Authors Contacts Customer Service Jobs Newsletters O'Reilly Labs Press Room Privacy Policy RSS Feeds Terms of Service User Groups Writing for O'Reilly |
Content Archive Business Technology Computer Technology Microsoft Mobile Network Operating System Digital Photography Programming Software Web Web Design |
More O'Reilly Sites O'Reilly Radar Ignite Tools of Change for Publishing Digital Media Inside iPhone O'Reilly FYI makezine.com craftzine.com hackszine.com perl.com xml.com Partner Sites InsideRIA java.net O'Reilly Insights on Forbes.com |