Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^5: Programming Language to generate Perl Scripts

by ikegami (Patriarch)
on May 14, 2010 at 16:50 UTC ( [id://840036]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Programming Language to generate Perl Scripts
in thread Programming Language to generate Perl Scripts

Wouldn't it be a mess of single quotes and double quotes?

No. For the reasons I already gave, it would be less of a mess in Perl.

Perl: print($fh q{for (keys(%h)) { print("$_: $h{$k}\n"); }}); C: fprintf(fh, "for (keys(%%h)) { print(\"$_: $h{$_}\\n\"); }"); fprintf(fh, "%s", "for (keys(%h)) { print(\"$_: $h{$_}\\n\"); }"); fputs("for (keys(%h)) { print(\"$_: $h{$_}\\n\"); }", fh);

3 or 4 extra escapes in C.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-25 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found