Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the PPI CPAN distribution.

Report information
The Basics
Id: 45015
Status: open
Priority: 0/
Queue: PPI

People
Owner: Nobody in particular
Requestors: shmuelfomberg [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.204_01
Fixed in: (no value)



Subject: Duplicate code
Hi. In the Token::Magic, there are two conditions: if ( $c eq '$#$' or $c eq '$#{' ) { if ( $c =~ /^\$\#\{/ ) { If I understand correctly, the first condition will handle the second condition as well, so the second condition is dead code. Thanks, Shmuel.
Subject: Re: [rt.cpan.org #45015] Duplicate code
Date: Tue, 14 Apr 2009 11:19:15 +1000
To: bug-PPI [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
Strictly speaking, not true. The first cases handle when this code is reached with EXACTLY three characters. The latter deals with cases where the code is reached with more than three characters. Adam K 2009/4/14 Shmuel Fomberg via RT <bug-PPI@rt.cpan.org>: Show quoted text
> Mon Apr 13 17:43:07 2009: Request 45015 was acted upon. > Transaction: Ticket created by SEMUELF >       Queue: PPI >     Subject: Duplicate code >   Broken in: 1.204_01 >    Severity: Unimportant >       Owner: Nobody >  Requestors: owner@semuel.co.il >      Status: new >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=45015 > > > > Hi. > > In the Token::Magic, there are two conditions: >                if ( $c eq '$#$' or $c eq '$#{' ) { >                if ( $c =~ /^\$\#\{/ ) { > If I understand correctly, the first condition will handle the second > condition as well, so the second condition is dead code. > > Thanks, > Shmuel. >
Show quoted text
> The first cases handle when this code is reached with EXACTLY three > characters. > The latter deals with cases where the code is reached with more than > three characters.
So the first case is redundant, because the second include it. But how would it have more then exactly three charecters? I looked at all the references for Magic, and could not find any case like that. And I think that in this case the code might fail, because when it reaches the second case, it builds a cast token with "$#" and a structure with "{". if it have anything after the '{', then it is lost.