Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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 ( [id://1187830]=note: print w/replies, xml ) Need Help??


in reply to How to remove the spaces after the directory name and before the .html extension from my code using perl?

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

  • Comment on Re: 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^2: How to remove the spaces after the directory name and before the .html extension from my code using perl?
by gpssana (Initiate) on Apr 13, 2017 at 09:38 UTC
    $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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1187830]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-20 03:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found