in reply to Re^2: open(), go away with bad way, or fail with the right way?
in thread open(), go away with bad way, or fail with the right way?
"...This allows things like..."
Yes and no:
#!/usr/bin/env perl use strict; use warnings; use feature qw(say);; my $foo = 'Bar': my $foo = $foo x 2; say $foo; __END__
Perl allows it generously but then it complains about "my" variable $foo masks earlier declaration in same scope at ./foo.pl line 8..
Iznogoud. But in a block it works flawless - no surprise:
KARL : { my $foo = $foo x 2; say $foo; }
But why the effort? You could say $foo x= 2; which results in BarBar. If this is what you wanted. What i assume.
Best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: open(), go away with bad way, or fail with the right way?
by Anonymous Monk on Jun 01, 2019 at 18:00 UTC | |
by karlgoethebier (Abbot) on Jun 01, 2019 at 18:15 UTC | |
by Anonymous Monk on Jun 01, 2019 at 20:16 UTC | |
by karlgoethebier (Abbot) on Jun 01, 2019 at 23:11 UTC | |
by Anonymous Monk on Jun 02, 2019 at 02:31 UTC | |
|