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

Re^2: Code Shortening (golf)

by Young Monk (Novice)
on Oct 18, 2010 at 19:22 UTC ( #866029=note: print w/replies, xml ) Need Help??


in reply to Re: Code Shortening (golf)
in thread Code Shortening (golf) [RESOLVED]

But for using "say", we must include a line before the script like "use 5.10" rite? (not quite sure about the version)

Replies are listed 'Best First'.
Re^3: Code Shortening (golf)
by moritz (Cardinal) on Oct 18, 2010 at 19:33 UTC
    If you write a one-liner, using -E instead of -e enables the new features like say.
    Perl 6 - links to (nearly) everything that is Perl 6.
      Unfortunately, in spoj, one-liners are not allowed!

      So, the only way to use those options are
      #!perl -nE #program goes here

      So, using those actually increases the size of the program for small tasks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://866029]
help
Chatterbox?
[Corion]: My Perl output hasn't recovered, but as $work is still somewhat stressful, I don't think this would be different with a five day workdweek
[Lady_Aleena]: Corion, that is a good thing (TM) 8)
[Corion]: And this evening, I'm actually dusting off some old module of mine and bringing it up to the last version of the library I'm wrapping
[Lady_Aleena]: Updating things can be fun, if there is a better way to do it.
[Corion]: Lady_Aleena: Mostly, it's just housekeeping, but it inspires me about things I could do with it, so that's good ;)
[Lady_Aleena]: By the way, I stopped by to let someone know I'm still alive, though I haven't found anything to write in perl for a while now.
[Lady_Aleena]: I need inspiration.

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2017-09-24 18:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (274 votes). Check out past polls.

    Notices?