in reply to http interpolation

By $ARGV[0] I suppose you mean that you are passing this on the command line of the program - it is the shell that is doing the metachar substitution before it gets to the Perl program. You need to escape the tilde in the command line or put the argument in single quotes.

/J\

Replies are listed 'Best First'.
Re^2: http interpolation
by magnus (Pilgrim) on Jul 01, 2005 at 14:37 UTC
    yes, i would have to agree with gellyfish and escape the character on the command (or single quotes) as it looks like problem is before it gets to the script, not after...

    just some re-enforcement...

    magnus
      Gellyfish, Magnus and Duff,

      I think I saw the light.
      After these instructions I will work out your tips.
      Thank you.
      I will log when it works.

      Nice weekend,
      Perlboer
Re^2: http interpolation
by perlboer (Acolyte) on Jul 01, 2005 at 14:27 UTC
    Gellyfish,
    Examine this case, I think I need to parse the $ARGV[0] before the "print redirect"
    That's what you mean ?
    Perlboer

      No what I mean is that it is not perl that is doing the substitution of the '~' it is the shell, if you print $ARGV[0] as the first thing in your program you will see what is happening. You need to call your program like

      program.pl 'http://www.xs4all.nl/~werksman/webmees/index.html'
      or
      program.pl http://www.xs4all.nl/\~werksman/webmees/index.html
      to prevent the '~' from being substituted for the path to your home directory.

      /J\