<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://luminoussheep.net/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Perl_Notes</id>
	<title>Perl Notes - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://luminoussheep.net/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Perl_Notes"/>
	<link rel="alternate" type="text/html" href="https://luminoussheep.net/mediawiki/index.php?title=Perl_Notes&amp;action=history"/>
	<updated>2026-05-11T19:20:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://luminoussheep.net/mediawiki/index.php?title=Perl_Notes&amp;diff=89&amp;oldid=prev</id>
		<title>Martin: Created page with &quot;== find and capture in one line ==   my ($found) = ($text =~ /pre (capture stuff in brackets) post/)  Note the brackets around $found - match list is converted to a number for...&quot;</title>
		<link rel="alternate" type="text/html" href="https://luminoussheep.net/mediawiki/index.php?title=Perl_Notes&amp;diff=89&amp;oldid=prev"/>
		<updated>2021-09-14T21:42:14Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== find and capture in one line ==   my ($found) = ($text =~ /pre (capture stuff in brackets) post/)  Note the brackets around $found - match list is converted to a number for...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== find and capture in one line ==&lt;br /&gt;
&lt;br /&gt;
 my ($found) = ($text =~ /pre (capture stuff in brackets) post/)&lt;br /&gt;
&lt;br /&gt;
Note the brackets around $found - match list is converted to a number for a scalar&lt;br /&gt;
&lt;br /&gt;
== sort ==&lt;br /&gt;
&lt;br /&gt;
 @sorted = sort @array;&lt;br /&gt;
 Numerical:&lt;br /&gt;
 @sorted = sort { $a &amp;lt;=&amp;gt; $b } @notsorted;&lt;br /&gt;
 Alphabetical sort:&lt;br /&gt;
 @sorted = sort { lc($a) cmp lc($b) } @notsorted;&lt;br /&gt;
 Alphabetical sort, reversed:&lt;br /&gt;
 @sorted = sort { lc($b) cmp lc($a) } @notsorted;&lt;br /&gt;
&lt;br /&gt;
== join log lines so we can grep ==&lt;br /&gt;
e.g. log4j where each line starts with 2014-12-01 but stack traces/multi line buffers don&amp;#039;t&lt;br /&gt;
&lt;br /&gt;
 perl -ne &amp;#039;$_ =~ s/\n//; if ($_ =~ /^\d{4}-\d{2}-\d{2}/) { print &amp;quot;\n$_&amp;quot;; } else { print &amp;quot;|$_&amp;quot;; }&amp;#039;&lt;br /&gt;
== join exceptions in java logs ==&lt;br /&gt;
&lt;br /&gt;
  perl -e &amp;#039;my $l = &amp;quot;&amp;quot;; while (&amp;lt;&amp;gt;) { if ($_ !~ /^\d+/) {chop($l); $l.=$_;} else { print $l; $l=$_;}}&amp;#039;&lt;/div&gt;</summary>
		<author><name>Martin</name></author>
	</entry>
</feed>