Updated: 24.11.2002; 12:00:02 Uhr.
disLEXia
lies, laws, legal research, crime and the internet
        

Wednesday, March 14, 2001

Mistaking list for scalar context brings cops

A high-school sophomore last week was called to his private school's office and asked to explain some suspicious text on his Web site. What was intended to be a quote from /usr/games/fortune was instead the *first line* from its output. The school staff was very alarmed because the full output would have been:

I put the shotgun in an Adidas bag and padded it out with four pairs of tennis socks, not my style at all, but that was what I was aiming for: If they think you're crude, go technical; if they think you're technical, go crude. I'm a very technical boy. So I decided to get as crude as possible. These days, though, you have to be pretty technical before you can even aspire to crudeness. - Johnny Mnemonic, by William Gibson

Using a variable in list context on the left side of a perl expression puts the right side into the same context, and many operators behave differently in different contexts. These two statements are not equivalent:

my $f = `fortune`; # returns fortune as scalar, stores in $f my($f) = `fortune`; # returns each line of fortune as one element # in a list, stores first line in $f

Only the line about the shotgun in the Adidas bag made it to this kid's Web page, and the school went into crisis mode. They called the police just to be on the safe side.

http://slashdot.org/article.pl?sid=01/03/13/208259

Everything was eventually explained to their satisfaction, but the cops still talked to this sophomore and his father for a couple of hours and they're keeping his name on file... again, "just in case."

The risk is, I think, being a private high-school student a week after a high-profile school shooting, and having a Web site.

Jamie McCarthy jamie@mccarthy.vg http://jamie.mccarthy.vg/ [Jamie McCarthy via risks-digest Volume 21, Issue 27]
0:00 # G!


Maximillian Dornseif, 2002.
 
March 2001
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Feb   Apr

Search


Subsections of this WebLog


Subscribe to "disLEXia" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.