----- Original Message -----
From: David Gilden <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 23, 2001 6:33 PM
Subject: print with => ??
> Hello,
> Sorry to ask this, as I am quite new at this.
> And the online class that I am just now finishing has
> lots of bad code for examples!
>
> >From this list:
>
> print "'$file' => '$newfile'\n";
> ^^^^^^^^^
>
In general single quotes will not be interpolated, this means no variable
substition will take place unless they are within double quotes.
Single quotes inside double quotes indicate you want to print a single
quote.
The => will not be interpolated inside double quotes where variables will.
I think they want to demonstrate that you need to quote properly.
assume that $file contains the value "readme.txt" and $newfile contains the
value "liesmich.txt". (both without the quotes).
Then the output will look like:
'readme.txt' => 'liesmich.txt'
try running this:
my $file = 'readme.txt';
print '$file' . "\n";
print "$file\n";
print "'$file'\n";