in reply to Re: system function not handling string properly
in thread system function not handling string properly

The script includes a print statement for this purpose. The print statement prints the contents of $link correctly, but system("echo", $link) only prints w. If you download the sample file I included and put it in the same directory of the script you can see the result yourself.
  • Comment on Re^2: system function not handling string properly

Replies are listed 'Best First'.
Re^3: system function not handling string properly
by McA (Priest) on Sep 06, 2013 at 21:36 UTC

    Excuse me, I've overlooked that line.

    What is your OS? What shows 'which echo' on your system?

    This code works pretty well on my system:

    #!/usr/bin/env perl use strict; use warnings; use 5.010; my $url = '"www.youtube.com/watch?v=mark"'; system('echo', $url); $url = "www.youtube.com/watch?v=mark"; system('echo', $url);

    McA