gpssana has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on How to remove the spaces after the directory name and before the .html extension from my code using perl?
  • Select or Download Code

Replies are listed 'Best First'.
Re: How to remove the spaces after the directory name and before the .html extension from my code using perl?
by poj (Abbot) on Apr 13, 2017 at 09:19 UTC

    Looks like you have created the .txt files and the folder they are in with a trailing space in the name so the problem is in code you have not shown.

    poj
Re: How to remove the spaces after the directory name and before the .html extension from my code using perl?
by Anonymous Monk on Apr 13, 2017 at 05:49 UTC

    Her %20 represents space.Why space is appended at the end of the folder and before the .html extension.Where should i change my code in my script?

    Use Basic debugging checklist its very powerful

Re: How to remove the spaces after the directory name and before the .html extension from my code using perl?
by Corion (Patriarch) on Apr 13, 2017 at 09:14 UTC

    Most likely, you read the space already in from your file into $line and then @data. Remove the spaces from the file.

      $word=~s/("\S+|\S+|")\s*/$1/g;
      I had used the above thing to remove the spaces .

        And did that remove all spaces from $word?

        How did you verify that that removed all spaces from $word?

        I suggest that, as an exercise, you write a short program that removes all whitespace from a list of "interesting" words in an array. This will teach you how to investigate and verify your assumptions about your data and your program.

Re: How to remove the spaces after the directory name and before the .html extension from my code using perl?
by huck (Prior) on Apr 13, 2017 at 09:11 UTC

    I see no error listed in your post, and that link is a perfectly valid uri.

    And i see no way your code could have produced a link like that, are you making things up out of thin air again?

      When do you get annoyed enough to ignore the OP? Chilax