For Windows Users:
perl -e "$x='file.dat';print $1 if($x=~/(.*).(.*)/)"
For Unix/Linux/etc Users.:
perl -e '$x="file.dat";print $1 if($x=~/(.*).(.*)/)'
perl -e "$x='file.dat';print $1 if($x=~/(.*).(.*)/)"
perl -e '$x="file.dat";print $1 if($x=~/(.*).(.*)/)'
{ a => 1, b => 2 }
is being passed through Data::Dumper and then eval'ed back into a hash. This works fine, until strict comes into the picture. When strictness is enabled, the code fails with the error: "Can't use an undefined value as a HASH reference". How can you make this work and still keep strictness for all of the code.
perl -Mstrict -MData::Dumper -e 'my %x = %{eval Dumper({ a => 1, b => 2 })}';