Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

print Delta symbol

by Anonymous Monk
on Feb 01, 2013 at 23:08 UTC ( #1016624=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

How to print out a Delta symbol, "Δ", in Perl?

Thanks!

Dicty

Comment on print Delta symbol
Re: print Delta symbol
by Anonymous Monk on Feb 01, 2013 at 23:21 UTC
Re: print Delta symbol
by zwon (Monsignor) on Feb 02, 2013 at 14:24 UTC

    As AM said, or:

    perl -Mutf8 -Mopen=:utf8,:std -E'say "Δ"'
    
Re: print Delta symbol
by shmem (Canon) on Feb 02, 2013 at 20:19 UTC

    TIMTOWTDI, as usual. From the "U+0370 – U+03FF Greek and Coptic" code block:

    # decimal 916 is hex 394 perl -le 'binmode STDOUT,":utf8"; print "\x{394}"'

    That's for UNIX/Linux systems, use with e.g. gnome-terminal. The binmode call is in there to defeat perl's "Wide character in print" warning.

    Porting to other random operating systems is left as an excercise to the reader.
    Of course, you must have the appropriate fonts installed on your system to display unicode characters at the terminal.
    Check out http://decodeunicode.org for other symbols.

Re: print Delta symbol
by Your Mother (Canon) on Feb 02, 2013 at 23:26 UTC

    One more for fun–

    perl -MHTML::Entities -CO -le 'print decode_entities("Δ")'

    Makes a nice alias with shift in place of the entity.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-07-23 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (131 votes), past polls