Showing revision 42

Writing Perl Modules

Basic module structure

sh: 1: pygmentize: not found

use strict;
use warnings;

package ProgArm;
our(%Keys);

@Keys{MyNewSub} = 'g';

sub MyNewSub {
    # Write your code here
}

Repeats

By default actions are called without any parameters, however repeat.pl will pass 1 or -1 to indicate repeat and negative repeat.

The longest way to detect negative repeat is to use

sh: 1: pygmentize: not found

if defined $_[0] and $_[0] == -1

You can shorten it to

sh: 1: pygmentize: not found

if ($_[0] // 0) == -1

However, it is much easier to use experimental smartmatch operator

sh: 1: pygmentize: not found

if $_[0] ~~ -1

Even though it is deprecated, all modules use smartmatch operator. You should use it too! (A simple sed command can easily change it in every module, that's why we ask you to respect consistency)

We can rewrite previous example to handle negative repeats:

sh: 1: pygmentize: not found

use strict;
use warnings;

package ProgArm;
our(%Keys);

@Keys{MyNewSub} = 'g';

sub MyNewSub {
    return MyNewSubNegative() if $_[0] ~~ -1;
    # Write your code here
}

sub MyNewSubNegative {
    # Write your code here
}

Comments:

ivermectin 2ml - <a href="https://ivermecti.com/">ivermectin medication</a> stromectol tablet 3 mg

-- Racraw 2021-08-20 12:48 UTC

ventolin inhalers - <a href="https://onventolinp.com/">ventolin price uk</a> ventolin cost canada

-- Aeelio 2021-08-22 09:08 UTC

misoprostol price - <a href="https://fastcytoteh.com/">cytotec tablets</a> buy cytotec online fast delivery

-- Ucbecn 2021-08-23 19:06 UTC

doxycycline 300 mg - <a href="https://doxycyclinegn.com/">doxycycline best price</a> doxycycline online usa

-- Zhxvyb 2021-08-25 05:50 UTC

neurontin capsules 100mg - <a href="https://neurontinpl.com/">where to buy neurontin</a> levothyroxine 75 mcg cheap

-- Wrxxnw 2021-08-26 17:38 UTC

sildenafil 200 mg online - buy sildenafil usa

-- Cunxvb 2021-08-28 07:04 UTC

vardenafil generic names - <a href="https://blevitrarx.com/">vardenafil generic</a> generic vardenafil canada

-- Mwonto 2021-08-30 18:12 UTC

stromectol human - <a href="https://ivermecrx.com/">ivermectin 1</a> stromectol 6mg

-- Pyyred 2021-09-01 07:14 UTC

2.5 mg prednisone - <a href="https://prednipill.com/">prednisone 5mg</a> prednisone 20mg online

-- Begiwl 2021-09-02 08:27 UTC

accutane 2009 - <a href="https://accutans.com/">where can you buy accutane</a> accutane drug

-- Jmtode 2021-09-03 15:16 UTC

amoxil USA - <a href="https://gnamoxil.com/">generic amoxicillin 500mg</a> amoxicillin without a doctor’s prescription

-- Xxckll 2021-09-05 03:37 UTC

medrol buy - <a href="https://gnmedrol.com/">medrol 2mg price</a> buy lyrica online usa

-- Dlmzgr 2021-09-06 09:22 UTC

pay essay writing - <a href="https://wtessay.com/">help on essay</a> buy essay paper

-- Cmgtob 2021-09-07 13:15 UTC

discount viagra online canada - <a href="https://stviag.com/">Order viagra online</a> 125 mg viagra

-- Wagzwz 2021-09-08 21:26 UTC

tadalafil tablets india online - <a href="https://fspcia.com/">Cialis online ordering</a> top 10 pharmacy websites

-- Krearb 2021-09-10 05:28 UTC

stromectol 3 mg tablets price - <a href="https://ivermectinok.com/">stromectol purchase</a> ivermectin 2mg

-- Ynlcbe 2021-09-12 14:33 UTC

prednisone for gout - <a href="https://opredniso.com/">prednisone 24 mg</a> prednisone 1.25 mg

-- Ghbhew 2021-09-13 16:32 UTC

order lasix with no prescription - <a href="https://genlasix.com/">furosemide over the counter</a> buy furosemide 40 mg

-- Txfzla 2021-09-14 22:02 UTC

ventolin tablet price - <a href="https://ventoingo.com/">albuterol without prescription</a> ventolin over the counter

-- Yvmcix 2021-09-16 03:03 UTC

cytotec pill canada - <a href="https://cytotexr.com/">buy cytotec 200mg</a> cytotec without prescription

-- Cndpmb 2021-09-17 08:24 UTC

doxycycline generic pharmacy - <a href="https://doxycyclinex.com/">doxycycline 100mg acne</a> prednisolone 5mg

-- Pvycbv 2021-09-18 17:00 UTC

ivermectin tablets for humans - <a href="https://ivermectpill.com/">ivermectin 4000</a> ivermectin buy australia

-- Zgsxgi 2021-09-20 00:29 UTC

stromectol medicine - <a href="https://stromecin.com/">ivermectin over the counter</a> stromectol 6mg

-- Gsgvah 2021-09-21 04:24 UTC

non prescription sildenafil - <a href="https://silepilled.com/">buy generic sildenafil online</a> sildenafil no prescription

-- Ikvpww 2021-09-22 10:38 UTC

generic tadalafil canada - <a href="https://tadalapills.com/">buy tadalafil pills</a> tadalafil prescription online

-- Iuggie 2021-09-23 17:01 UTC

accutane nz - <a href="https://isotrepills.com/">how much is accutane generic</a> accutane 40 mg daily

-- Knxvwj 2021-09-24 20:58 UTC

buy essay now - <a href="https://wressays.com/">how to write my thesis</a> write papers online

-- Jgauwa 2021-09-25 23:18 UTC

stromectol 6 mg tablet - <a href="https://ivermctin.com/">cost stromectol</a> oral stromectol cost

-- Fuappn 2021-09-27 05:12 UTC

medication viagra online - <a href="https://tdxpill.com/">Cialis without rx</a> once a day cialis

-- Clhjdp 2021-09-28 18:56 UTC

buy vardenafil no prescription uk - <a href="https://buytopep.com/">prescription drugs from canada</a> over the counter ed pills

-- Nzgeeg 2021-10-01 07:23 UTC

lupus hydroxychloroquine - <a href="https://buypredni.com/">medication prednisone</a> prednisone pill

-- Ezpurf 2021-10-02 11:48 UTC

buy vidalista 40 mg online 20%off - <a href="https://cenforcep.com/">cenforce 120 mg online</a> cenforce 120 mg online

-- Aldkup 2021-10-03 15:46 UTC

orlistat - <a href="https://orlistxen.com/">xenical price in india</a> orlistat from mexico

-- Amzuuo 2021-10-04 18:32 UTC

stromectol canada - <a href="https://ivemecti.com/">ivermectine</a> stromectol 12 mg

-- Qrkmmq 2021-10-06 04:34 UTC

how much is generic sildenafil - <a href="https://sidpill.com/">viagra 200mg for sale</a> female viagra tablet

-- Jtpziq 2021-10-07 05:26 UTC

buy cheap cialis online - <a href="https://erecedpl.com/">buying cialis cheap</a> tadalafil tablets 10 mg price

-- Tvdwpk 2021-10-08 07:18 UTC

buy prednisone 20mg - <a href="https://prednislon.com/">prednisone without prescription medication</a> 2.5 mg prednisone

-- Xzbaue 2021-10-09 15:28 UTC

tadalafil pharmacy - <a href="https://cilaedpl.com/">20 mg cialis</a> cialis prescription coupon

-- Mkjevc 2021-10-11 09:48 UTC

ivermectin without prescription - <a href="https://stromcl.com/">stromectole</a> ivermectin cost australia

-- Ottiql 2021-10-12 16:35 UTC