in reply to Why is const x const not a const?
Why is "a" x 3 not considered a constant string...?
As I see it, "a" is a const with x signifying a repeat of 3. With that in mind, I went for a walk:In other words, 'a' is the constant string, which seems like the right thing to me; however, 'a x 3' is a constant string. Use that instead.#!/usr/bin/perl use strict; use warnings; use Data::Dumper::Concise; use B::Concise qw/ walk_output set_style_standard /; my $walker = B::Concise::compile('-concise', 'newFunc'); walk_output( \*STDOUT ); print Dumper ( $walker->() ); set_style_standard( 'terse' ); print Dumper ( $walker->() ); sub newFunc { my $s = 'a x 3'; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why is const x const not a const?
by BrowserUk (Patriarch) on Jan 22, 2012 at 14:06 UTC |