<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.explainxkcd.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Brightonsimon</id>
		<title>explain xkcd - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://www.explainxkcd.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Brightonsimon"/>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php/Special:Contributions/Brightonsimon"/>
		<updated>2026-04-09T17:22:17Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://www.explainxkcd.com/wiki/index.php?title=1171:_Perl_Problems&amp;diff=27570</id>
		<title>1171: Perl Problems</title>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php?title=1171:_Perl_Problems&amp;diff=27570"/>
				<updated>2013-02-10T04:54:38Z</updated>
		
		<summary type="html">&lt;p&gt;Brightonsimon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{comic&lt;br /&gt;
| number    = 1171&lt;br /&gt;
| date      = February 8, 2013&lt;br /&gt;
| title     = Perl Problems&lt;br /&gt;
| image     = perl problems.png&lt;br /&gt;
| titletext = To generate #1 albums, 'jay --help' recommends the -z flag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Explanation==&lt;br /&gt;
{{w|Perl}} is a scripting language that makes heavy use of {{w|Regular expression|regular expressions}}, which are good for dealing with large amounts of text quickly. In the comic, the man wearing sunglasses parodies the song &amp;quot;{{w|99 Problems}}&amp;quot; in which the rapper {{w|Jay-Z}} says:&lt;br /&gt;
&lt;br /&gt;
:If you're havin' girl problems&lt;br /&gt;
:I feel bad for you, son-&lt;br /&gt;
:I got 99 problems,&lt;br /&gt;
:But a bitch ain't one.&lt;br /&gt;
&lt;br /&gt;
In the comic however, the rapper tries to solve his problems with Perl’s regular expressions, and ends up only creating another problem for himself, which is a reference to a [http://regex.info/blog/2006-09-15/247 famous quote by Jamie Zawinski] (whose name could also be shortened to &amp;quot;Jay-Z&amp;quot;): “Some people, when confronted with a problem, think ‘I know, I'll use regular expressions.’ Now they have two problems.”&lt;br /&gt;
&lt;br /&gt;
In perl (and php), using a command like preg_match(exp,str) will generate an extra match:  the first match contains the entire string, while the remaining will contain every instance in which it matched.&lt;br /&gt;
&lt;br /&gt;
Novice users are often surprised when they perform a preg_match and set the values to an array, like&lt;br /&gt;
&lt;br /&gt;
$matches = preg_match('/[A-Za-z]/i',$str);&lt;br /&gt;
&lt;br /&gt;
and then try to use the first result in that array, like:&lt;br /&gt;
&lt;br /&gt;
$firstMatch = $matches[0];&lt;br /&gt;
&lt;br /&gt;
...only to get the whole original string back, leaving them where they started.&lt;br /&gt;
&lt;br /&gt;
“program --help” is a common way, originating with the GNU project, to ask a program to show documentation on its usage and supported parameters; which, for some program, could include a “-z” command-line argument (“flag”), so the command would read &amp;quot;jay -z&amp;quot;. In this case, it is just an obvious play on the rapper’s name. [http://www.cs.rit.edu/~ats/projects/lp/doc/jay/package-summary.html '''jay'''] is also an actual C program that is a compiler-compiler for java.&lt;br /&gt;
&lt;br /&gt;
==Transcript==&lt;br /&gt;
:[Man with sunglasses and Cueball talking.]&lt;br /&gt;
:Sunglasses: If you're havin' perl problems I feel bad for you, son-&lt;br /&gt;
&lt;br /&gt;
:Sunglasses: I got 99 problems,&lt;br /&gt;
&lt;br /&gt;
:Sunglasses: So I used regular expressions.&lt;br /&gt;
&lt;br /&gt;
:Sunglasses: Now I have 100 problems.&lt;br /&gt;
&lt;br /&gt;
{{comic discussion}}&lt;br /&gt;
[[Category:Perl]]&lt;br /&gt;
[[Category:Music]]&lt;br /&gt;
[[Category:Comics featuring Cueball]]&lt;/div&gt;</summary>
		<author><name>Brightonsimon</name></author>	</entry>

	</feed>