[EP-tech] Re: Random question: Eprint core fields
Sebastien Francois
sf2 at ecs.soton.ac.uk
Wed Jul 4 15:45:27 BST 2012
Single quotes won't extrapolate a variable (and characters such as \n,
\r) while double quotes will:
my $var1 = 'hello';
my $var2 = '$var1 world';
my $var3 = "$var1 world";
print $var2; # will print <$var1 world>
print $var3; # will print <hello world>
Seb.
On 04/07/12 15:36, Ian Stuart wrote:
> On 04/07/12 11:49, John Salter wrote:
>
>> Also (if I put my pedant hat on, so feel free to ignore!), there's inconsistent use of quotes in that file:
>> { name=>"contact_email", type=>"email", required=>0, can_clone=>0 },
>> VS.
>> { 'name' => 'sword_depositor', 'type' => 'itemref', datasetid=>"user" },
> Perl knows that hash keys must be scalars, therefore assumes quotes.
> Perl hash keys can be numeric scalars or string scalars, perl doesn't care.
>
> I also notice variation in the use of quotes within the same
> declaration, and with the use of single- verses double-quotes on values :)
>
> Just goes to show how rich and helpful Perl is.... by not falling over
> on the inconsequentials ;-)
More information about the Eprints-tech
mailing list