Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: pearl script working but is changing to attachment

by johngg (Abbot)
on Feb 16, 2018 at 15:24 UTC ( #1209309=note: print w/replies, xml ) Need Help??

in reply to pearl script working but is changing to attachment

To expand on AnomalousMonk's reply, which should save you a heap of typing in the future, HEREDOCs interpolate by default and double quotes do not need to be escaped. Neither do you need explicit line terminators. Note also that, unless you have used select to nominate a different filehandle, STDOUT is the default handle for output and does not need to be supplied to print. To stop interpolation do print <<'EOT'; instead, look at the documentation for more.

This script

use strict; use warnings; my $your_email_address = q{}; my $your_name = q{Fred Bloggs}; print <<EOT; <input type="hidden" name="your_email_address" value="$your_email_addr +ess"> <input type="hidden" name="your_name" value="$your_name"> EOT

Produces this output

<input type="hidden" name="your_email_address" value="fred.bloggs@wort"> <input type="hidden" name="your_name" value="Fred Bloggs">

I hope this is helpful.



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1209309]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2018-07-20 01:37 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (422 votes). Check out past polls.