in reply to Re: Simple problem with @ in string.
in thread Simple problem with @ in string.

I agree but this is what is happening. Once I read to get the email address I store the email in the string. I write the string in a few other places and its ok. But when I pass the variable like this:

system("/blat/blat.exe message.txt -t $emailaddress");

Blat gripes at me because it says it does not like the email address. So I pipe it out to see whats up and if the string contained $emailadress = "me@there.com"; perl is passing it as methere.com.

Ahhhhhhh .. hold on a second.. Would my system command being called with "" instead of '' cause perl to do that to the string? I guess I need to try that and see?

Replies are listed 'Best First'.
Re^3: Simple problem with @ in string.
by chromatic (Archbishop) on Feb 06, 2010 at 04:45 UTC
    Would my system command being called with "" instead of '' cause perl to do that to the string?

    No; that would require Perl 5 to interpolate variables and then interpolate the interpolated values.

    I suspect instead that the error comes from blat.exe or at least system. If you use the list form of system(), you may have better results:

    system( '/blat/blat.exe', 'message.txt', '-t', $emailaddress );

    This avoids any shell interpolation.

Re^3: Simple problem with @ in string.
by jethro (Monsignor) on Feb 06, 2010 at 15:49 UTC

    You might also try to substitute 'blat.exe' with 'echo' (if that command exists in the windows shell, someone told me at least msdos had it) to just see what the program gets as parameter. If the @ is still there with echo, then perl and system are not to blame.