Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Interpret a string that contains strings

by choroba (Cardinal)
on Nov 21, 2015 at 22:41 UTC ( [id://1148323]=note: print w/replies, xml ) Need Help??


in reply to Interpret a string that contains strings

Single quotes don't interpolate variables. '$format ' (see line 9) contains a dollar sign, and letters f, o, r, m, a, t, and a space.
$formatString = "$formatString$format ";

Similarly, use "\n" instead of '\n' on line 13.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Interpret a string that contains strings
by bArriaM (Novice) on Nov 21, 2015 at 23:00 UTC

    I shouldn't drink wine and code at the same time... Thank you Sir, it works like a charm after the changes, I wanted to make it too complicated!

    sub printfToFile { my $file = shift; my $format = shift; my $arrayCount = @_; my $formatString; for (my $r = 1;$r <= $arrayCount; $r++) { $formatString = $formatString."$format "; } $formatString = trim( $formatString ); $formatString = $formatString."\n"; open IO, ">>$file" or die "Cannot open $file for output: $!\n+"; printf IO "$formatString", @_; close IO; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-23 07:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found