Giter VIP home page Giter VIP logo

syntax-feature-ql's Introduction

NAME

Syntax::Feature::Ql - Turns a quoted string into a single line

VERSION

version 0.001000

SYNOPSIS

use syntax qw( ql );

# prints on one line
say ql{
    Do you know the feeling when you want to generate a long
    string for a message without having to concatenate or end
    up with newlines and indentation?
};

DESCRIPTION

This is a syntax extension feature suitable for the syntax extension dispatcher.

It provides two new quote-like operators named ql and qql. These work in the same way as q and qq (including the ability to change the delimiters), except they put the returned string on a single line.

The following all output foo bar baz:

# simple
say ql{foo bar baz};

# multiline
say ql{
    foo
    bar
    baz
};

# different delimiters and interpolation
my $qux = q{ # <- this is a normal quote!
    bar
    baz
};
say qql!
    foo
    $qux
!;

As you can see with the last example, interpolated values are also normalized to fit on the single line.

METHODS

install

Syntax::Feature::Ql->install( into => $target );

Installs the ql and qql operators into the $target.

SEE ALSO

BUGS

Please report any bugs or feature requests to [email protected] or through the web interface at: http://rt.cpan.org/Public/Dist/Display.html?Name=Syntax-Feature-Ql

AUTHOR

Robert 'phaylon' Sedlacek <[email protected]>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Robert 'phaylon' Sedlacek.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax-feature-ql's People

Contributors

phaylon avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Forkers

sergeyromanov

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.