in reply to scalar slice assignment doubt

I see that there are some great posts that talk about 1E0 AND the not so well understood fine points about ".." and ..."!
Great!

I've never encountered 1E0. But I would like to point out that there is very common usage of 0E0!

0E0 is used within the DBI I/F to return a "True" string value with a numeric zero value! Example:

my $query = $db->prepare(" Update $WeatherDB Set precip=$precip, high=$high, low=$low Where state='$state' AND city='$city' "); my $rows_changed = $update->execute() || die "execute failed..blah"; # if the execute method on the $update query "succeeds", ie # the DB exists and this whole thing "makes sense", but just # didn't change any rows, you get the "TRUE" string and # Zero numeric reponse...(0E0); if ($rows_changed == 0) { print "could not update record with $state,$city! Not Found!\n"; } elsif ($rows_changed >1) { print "DB corruption! $rows_changed entries for $state,$city combo\ +n"; }

So although this exponential string representation of a simple int looks weird (and it is), there are some uses for this within Perl. This allows essentially two parms to be passed back as one value...Did it work or not? And if it did work what is the value? "no rows changed" here is a legal thing, otherwise you would have to have two vars, one for sucess or failure and one for number of results.

Perl vars are strings until used in a numeric context. Maybe this is not obvious, but when a string is used in a numeric context, it becomes a number. In the above code, $rows_changed is still in string context. See what happens to $b below.

Anyway, you will see 0E0 if you write DBI code.
You might code for a decade without seeing 1E0 again

#!/usr/bin/perl -w use strict; my $a="0E0"; my $b ="00000035"; print "A as string=$a\n"; $a +=0; print "A as numeric=$a\n"; $b +=0; print "B=$b leading zeroes deleted\n"; # prints # A as string=0E0 # A as numeric=0 # B=35 leading zeroes deleted