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

Re^2: Help:getting parts of the strings from a file into managable variables

by my_perl (Initiate)
on Nov 11, 2004 at 22:41 UTC ( [id://407206]=note: print w/replies, xml ) Need Help??


in reply to Re: Help:getting parts of the strings from a file into managable variables
in thread Help:getting parts of the strings from a file into managable variables

Hi, THank you so much for a prompt response :) I cut and pasted your response, and it does not work for me. It gives result that every line is bad. and VAR1{} any idea why? Thanks one more time.
  • Comment on Re^2: Help:getting parts of the strings from a file into managable variables

Replies are listed 'Best First'.
Re^3: Help:getting parts of the strings from a file into managable variables
by tmoertel (Chaplain) on Nov 11, 2004 at 23:27 UTC
    To make my code easier to read, I indent it by four spaces when I quote it. (That way, it doesn't get lost in the surrounding flow of text.) As a result, you'll need to unindent it (or at least the __DATA__ portion) before running it.

    Try processing the script through this one liner to remove the leading four spaces:

    perl -i.bak -pe's/^ //' the-script.pl # unindent the-script.pl
    That ought to do it.

    Cheers,
    Tom

      Hi, thanks again:) what would i need to change if i had spaces before these strings,number of spaces is not constant. Thanks Aida

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-19 06:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found