Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaz-utashiro/getopt-ex-rpn
RPN calculation module for Getopt::EX command option
https://github.com/kaz-utashiro/getopt-ex-rpn
Last synced: 8 days ago
JSON representation
RPN calculation module for Getopt::EX command option
- Host: GitHub
- URL: https://github.com/kaz-utashiro/getopt-ex-rpn
- Owner: kaz-utashiro
- License: other
- Created: 2022-09-28T14:33:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-28T23:23:26.000Z (over 2 years ago)
- Last Synced: 2024-11-08T07:17:19.959Z (2 months ago)
- Language: Perl
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
[![Actions Status](https://github.com/kaz-utashiro/Getopt-EX-RPN/actions/workflows/test.yml/badge.svg)](https://github.com/kaz-utashiro/Getopt-EX-RPN/actions)
# NAMEGetopt::EX::RPN - RPN calculation module for Getopt::EX command option
# SYNOPSIS
use Getopt::EX::RPN qw(rpn_calc);
# DESCRIPTION
Getopt::EX::RPN is a wrapper for [Math::RPN](https://metacpan.org/pod/Math%3A%3ARPN) package which implement
Reverse Polish Notation calculation. **rpn\_calc** function in this
package takes additional `HEIGHT` and `WIDTH` token which describe
terminal height and width.**rpn\_calc** recognize following tokens (case-insensitive) and numbers,
and ignore anything else. So you can use any other character as a
delimiter. Delimiter is not necessary if token boundary is clear.HEIGHT WIDTH
{ }
+,ADD ++,INCR -,SUB --,DECR *,MUL /,DIV %,MOD POW SQRT
SIN COS TAN
LOG EXP
ABS INT
&,AND |,OR !,NOT XOR ~
<,LT <=,LE =,==,EQ >,GT >=,GE !=,NE
IF
DUP EXCH POP
MIN MAX
TIME
RAND LRANDSince module [Getopt::EX::Func](https://metacpan.org/pod/Getopt%3A%3AEX%3A%3AFunc) uses comma to separate parameters,
you can't use comma as a token separator in RPN expression. This
package accept expression like this:&set(width=WIDTH:2/,height=HEIGHT:DUP:2%-2/)
# AUTHOR
Kazumasa Utashiro
# LICENSE
Copyright 2022 Kazumasa Utashiro.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.