Scott wrote:
I am learning perl and my code is using strict. I thought it would help me learn better then being sloppy.

I am trying to connect to a sql database and my password contains a @ in the middle of the word
so
my $pass = "p...@word";

its killing my script and i cant seem to find anything on the internet on how to just use p...@word as pure text. I've tried /p...@word/ but that didn't help and im sorta out of ideas, im going to go get a perl book from my college library maybe it has an answer.

Anyone know what to do?

In Perl, double quoted strings are interpolated, which means, among other things, that anything that looks like a $scalar variable or an @array variable is replaced with the contents of that variable.

You have to either use a single quoted string:

my $pass = 'p...@word';

Or escape that character so it won't be interpolated:

my $pass = "pa...@word";



John
--
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to