Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

printing "$" to php file

by flieckster (Scribe)
on Jan 30, 2018 at 17:43 UTC ( #1208143=perlquestion: print w/replies, xml ) Need Help??

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

hi there. is there any way to print the "$" to a php file?
<?php $client_aero = 'Aeropostale'; $aero_total = '72'; $aero_average = '70'; ?>

Replies are listed 'Best First'.
Re: printing "$" to php file
by NetWallah (Canon) on Jan 30, 2018 at 18:54 UTC
    use strict; use warnings; print <<'_PHP1_'; <?php $client_aero = 'Aeropostale'; $aero_total = '72'; $aero_average = '70'; ?> _PHP1_ # Alternative using double quotes # Use this if you want to send perl variables to PHP my ($perl_client, $perl_total, $perl_avg) = ('Aeropostale',72,70); print <<"_PHP2_"; <?php \$client_aero = '$perl_client'; \$aero_total = '$perl_total'; \$aero_average = '$perl_avg'; ?> _PHP2_ exit 0;

                    Is a computer language with goto's totally Wirth-less?

      Hello NetWallah,

      I had no idea that he was referring for the actual character $ I though that he was referring to Perl Special Variables Quick Reference. It is nice that you where able to understand what he meant. :)

      BR / Thanos

      Seeking for Perl wisdom...on the process of learning...not there...yet!
        Oh boy, that was easy. the \ was backwards in my code! opps!
Re: printing "$" to php file
by thanos1983 (Parson) on Jan 30, 2018 at 17:50 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2022-05-25 17:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (90 votes). Check out past polls.

    Notices?