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

Re^2: "Safe" print?

by sundialsvc4 (Abbot)
on May 14, 2013 at 13:45 UTC ( #1033464=note: print w/replies, xml ) Need Help??


in reply to Re: "Safe" print?
in thread "Safe" print?

... noting that the "//" operator is, IIRC, a relatively recent addition to the language.   You should have it, but you (or some backwater web-hosting companies who need not be named ...) conceivably might not.   See perldoc perlop on your system; look for the heading “C-style Logical Defined-Or.”

Replies are listed 'Best First'.
Re^3: "Safe" print?
by ambrus (Abbot) on May 14, 2013 at 14:41 UTC

    See that first line in my the code? It says use 5.010;. The // operator was new in perl 5.10. It's not new anymore now.

      And that's right where I am (CENTOS 6 packaged Perl).

      I know and heartily approve the "//" operator (except when I somehow get confused and use backslashes), but don't want to have to write special code each time I print something that I can't prove is defined quickly. However, the Dumper suggestion (and related) is useful, I'm just embarrassed I didn't think of it myself (that's for complex structures! In debugging!).

        don't want to have to write special code each time I print something

        Then write a subroutine and call that every time.

Re^3: "Safe" print? (perldelta)
by LanX (Chancellor) on May 14, 2013 at 15:20 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1033464]
help
Chatterbox?
[cbeckley]: I have several questions about it's future development. But it seems like a lot of code to put in a sopw.
[cbeckley]: Should I put the module and example calling code in cufp, and then ask questions in sopw?
[haukex]: You can put it in SOPW, but use <readmore> tags
[haukex]: Also you might want to label it "code review"
[haukex]: Unless you have specific questions, in which case SSCCE's are much better

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-03-24 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (304 votes). Check out past polls.