Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Passing strings without quotes

by jerryhone (Sexton)
on Jan 28, 2006 at 00:13 UTC ( [id://526112]=perlquestion: print w/replies, xml ) Need Help??

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

Amyone ever used SQR?
I have a job to do to convert a stack of SQR scripts to Perl.
I guess the first question is, has anyone done this before - had a Google and couldn't find anything!
So I'm probably down to doing it myself...SQR passes parameters into its print statement that are either absolute or relative row/column positions in the output report so
print 'fred' (1,2) - absolute line 1 column 2
print 'barnie' (+2,+3) - relative 2 lines on 3 columns right
I'd like to be able to pass the +2 to my own print format routine, but that'll usually pass as 2 and therefore lose the '+' sign. Can I force +2 to be passed as +2 without quoting it?

Replies are listed 'Best First'.
Re: Passing strings without quotes
by samtregar (Abbot) on Jan 28, 2006 at 04:07 UTC
    No, but it should be easy to mass-convert the unquoted form into the quoted one:

       $ perl -pi -e 's/(\+\d+)/"$1"/g' file.pl

    -sam

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-03-29 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found